Skip to content

Commit 20c126a

Browse files
committed
Only add keys if features are enabled
1 parent f95f2ee commit 20c126a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Controllers/JwksController.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,19 @@ public function __construct(
3636
*/
3737
public function __invoke(): JsonResponse
3838
{
39+
$federationPublicKeys = $this->moduleConfig->getFederationEnabled()
40+
? $this->moduleConfig->getFederationSignatureKeyPairBag()->getAllPublicKeys()
41+
: [];
42+
43+
$vciPublicKeys = $this->moduleConfig->getVciEnabled()
44+
? $this->moduleConfig->getVciSignatureKeyPairBag()->getAllPublicKeys()
45+
: [];
46+
3947
return new JsonResponse(
4048
$this->jwks->jwksDecoratorFactory()->fromJwkDecorators(
4149
...$this->moduleConfig->getProtocolSignatureKeyPairBag()->getAllPublicKeys(),
42-
...$this->moduleConfig->getFederationSignatureKeyPairBag()->getAllPublicKeys(),
43-
...$this->moduleConfig->getVciSignatureKeyPairBag()->getAllPublicKeys(),
50+
...$federationPublicKeys,
51+
...$vciPublicKeys,
4452
)->jsonSerialize(),
4553
);
4654
}

0 commit comments

Comments
 (0)