File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class SignatureKeyPairConfig
1111 /**
1212 * @param \SimpleSAML\OpenID\Algorithms\SignatureAlgorithmEnum $signatureAlgorithm Signature algorithm
1313 * to use for signing JWTs.
14- * @param \SimpleSAML\OpenID\ValueAbstracts\KeyPairFilenameConfig $keyPairConfig Key pair configuration to use for
14+ * @param \SimpleSAML\OpenID\ValueAbstracts\KeyPairConfigInterface $keyPairConfig Key pair configuration to use for
1515 * signing JWTs.
1616 */
1717 public function __construct (
@@ -27,7 +27,7 @@ public function getSignatureAlgorithm(): SignatureAlgorithmEnum
2727 }
2828
2929
30- public function getKeyPairConfig (): KeyPairFilenameConfig
30+ public function getKeyPairConfig (): KeyPairConfigInterface
3131 {
3232 return $ this ->keyPairConfig ;
3333 }
Original file line number Diff line number Diff line change 44
55namespace SimpleSAML \OpenID \ValueAbstracts ;
66
7+ use SimpleSAML \OpenID \Exceptions \OpenIdException ;
8+
79class SignatureKeyPairConfigBag
810{
911 /**
@@ -69,4 +71,15 @@ public function getFirst(): ?SignatureKeyPairConfig
6971 {
7072 return $ this ->signatureKeyPairConfigs [array_key_first ($ this ->signatureKeyPairConfigs )] ?? null ;
7173 }
74+
75+
76+ /**
77+ * @throws \SimpleSAML\OpenID\Exceptions\OpenIdException
78+ */
79+ public function getFirstOrFail (): SignatureKeyPairConfig
80+ {
81+ return $ this ->getFirst () ?? throw new OpenIdException (
82+ 'Signature key pair config is not set. ' ,
83+ );
84+ }
7285}
You can’t perform that action at this time.
0 commit comments