Skip to content

Commit 246f1ab

Browse files
authored
Update to draft 45 (#17)
* Introduce trust_anchor_hints claim * Ensure that trust_marks are not possible in subordinate statements * Ensure that trust_mark_issuers claim is not possible in subordinate statements * Ensure that trust_mark_owners claim is not possible in subordinate statements * Ensure that JWS does not use algorithm none * Start to always validate common timestamps * Introduce hasKeyId on JwksClaim * Merge with master
1 parent ac64c02 commit 246f1ab

35 files changed

Lines changed: 725 additions & 88 deletions

.github/workflows/php.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
php-version: ['8.2', '8.3', '8.4', '8.5']
23+
runs-on: [ubuntu-latest]
24+
steps:
25+
- run: echo "Temporary disabled"
2326

24-
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.5
25-
with:
26-
php-version: ${{ matrix.php-version }}
27+
# Temporarily disabled bc. of error: "The package "symfony/cache" conflicts with the extension "redis".
28+
# You need to disable it in order to run this application.
29+
# uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.5
30+
# with:
31+
# php-version: ${{ matrix.php-version }}
2732

2833
linter:
2934
name: 'Linter'
@@ -168,7 +173,7 @@ jobs:
168173
# https://github.com/shivammathur/setup-php
169174
uses: shivammathur/setup-php@v2
170175
with:
171-
# Should be the higest supported version, so we can use the newest tools
176+
# Should be the highest supported version, so we can use the newest tools
172177
php-version: '8.5'
173178
tools: composer, composer-require-checker, composer-unused, phpcs
174179
extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, soap, spl, xml

src/Algorithms/SignatureAlgorithmEnum.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,25 @@
2020
enum SignatureAlgorithmEnum: string
2121
{
2222
case EdDSA = 'EdDSA';
23+
2324
case ES256 = 'ES256';
25+
2426
case ES384 = 'ES384';
27+
2528
case ES512 = 'ES512';
29+
2630
case none = 'none';
31+
2732
case PS256 = 'PS256';
33+
2834
case PS384 = 'PS384';
35+
2936
case PS512 = 'PS512';
37+
3038
case RS256 = 'RS256';
39+
3140
case RS384 = 'RS384';
41+
3242
case RS512 = 'RS512';
3343

3444

src/Claims/JwksClaim.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,19 @@ public function jsonSerialize(): array
4646
$this->name => $this->value,
4747
];
4848
}
49+
50+
51+
/**
52+
* Check whether the JWKS contains a key with the given key ID.
53+
*/
54+
public function hasKeyId(string $keyId): bool
55+
{
56+
foreach ($this->value[ClaimsEnum::Keys->value] as $key) {
57+
if ($key[ClaimsEnum::Kid->value] === $keyId) {
58+
return true;
59+
}
60+
}
61+
62+
return false;
63+
}
4964
}

src/Codebooks/ApplicationTypesEnum.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
enum ApplicationTypesEnum: string
88
{
99
case Web = 'web';
10+
1011
case Native = 'native';
1112
}

0 commit comments

Comments
 (0)