-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
67 changed files
with
1,339 additions
and
805 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
parameters: | ||
level: 0 | ||
level: 4 | ||
paths: | ||
- tests | ||
tmpDir: build/phpstan | ||
tmpDir: build/phpstan/dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SimpleSAML\OpenID\Claims; | ||
|
||
use SimpleSAML\OpenID\Codebooks\ClaimsEnum; | ||
|
||
class JwksClaim | ||
{ | ||
/** | ||
* @param array{keys:non-empty-array<array<string,mixed>>} $value | ||
* @param non-empty-string $key | ||
*/ | ||
public function __construct( | ||
protected readonly array $value, | ||
protected readonly string $key = ClaimsEnum::Jwks->value, | ||
) { | ||
} | ||
|
||
/** | ||
* @return array{keys:non-empty-array<array<string,mixed>>} | ||
*/ | ||
public function getValue(): array | ||
{ | ||
return $this->value; | ||
} | ||
|
||
/** | ||
* @return non-empty-string | ||
*/ | ||
public function getKey(): string | ||
{ | ||
return $this->key; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SimpleSAML\OpenID\Federation\Claims; | ||
|
||
use JsonSerializable; | ||
|
||
class TrustMarkOwnersClaimBag implements JsonSerializable | ||
{ | ||
/** @var array<non-empty-string,\SimpleSAML\OpenID\Federation\Claims\TrustMarkOwnersClaimValue> */ | ||
protected array $trustMarkOwnersClaimValues = []; | ||
|
||
public function __construct(TrustMarkOwnersClaimValue ...$trustMarkOwnersClaimValues) | ||
{ | ||
$this->add(...$trustMarkOwnersClaimValues); | ||
} | ||
|
||
public function add(TrustMarkOwnersClaimValue ...$trustMarkOwnersClaimValues): void | ||
{ | ||
foreach ($trustMarkOwnersClaimValues as $trustMarkOwnersClaimValue) { | ||
$this->trustMarkOwnersClaimValues[$trustMarkOwnersClaimValue->getTrustMarkId()] = | ||
$trustMarkOwnersClaimValue; | ||
} | ||
} | ||
|
||
public function has(string $trustMarkId): bool | ||
{ | ||
return isset($this->trustMarkOwnersClaimValues[$trustMarkId]); | ||
} | ||
|
||
public function get(string $trustMarkId): ?TrustMarkOwnersClaimValue | ||
{ | ||
return $this->trustMarkOwnersClaimValues[$trustMarkId] ?? null; | ||
} | ||
|
||
/** | ||
* @return array<non-empty-string,\SimpleSAML\OpenID\Federation\Claims\TrustMarkOwnersClaimValue> | ||
*/ | ||
public function getAll(): array | ||
{ | ||
return $this->trustMarkOwnersClaimValues; | ||
} | ||
|
||
/** | ||
* @return array<non-empty-string,array<non-empty-string,mixed>> | ||
*/ | ||
public function jsonSerialize(): array | ||
{ | ||
return array_combine( | ||
array_keys($this->trustMarkOwnersClaimValues), | ||
array_map( | ||
fn(TrustMarkOwnersClaimValue $tMOCValue): array => $tMOCValue->jsonSerialize(), | ||
$this->trustMarkOwnersClaimValues, | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.