1 | <?php |
||
22 | class JwksUriEndpointSource implements Component |
||
23 | { |
||
24 | /** |
||
25 | * @return string |
||
26 | */ |
||
27 | public function name(): string |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | public function load(array $configs, ContainerBuilder $container) |
||
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | public function getNodeDefinition(NodeDefinition $node) |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function prepend(ContainerBuilder $container, array $config): array |
||
68 | { |
||
69 | $currentPath = '[endpoint][jwks_uri]'; |
||
70 | $accessor = PropertyAccess::createPropertyAccessor(); |
||
71 | $sourceConfig = $accessor->getValue($config, $currentPath); |
||
72 | if (true === $sourceConfig['enabled']) { |
||
73 | ConfigurationHelper::addKeyset($container, 'oauth2_server.endpoint.jwks_uri', 'jwkset', ['value' => $sourceConfig['key_set']]); |
||
74 | ConfigurationHelper::addKeyUri($container, 'oauth2_server.endpoint.jwks_uri', ['id' => 'jose.key_set.oauth2_server.endpoint.jwks_uri', 'path' => $sourceConfig['path'], 'max_age' => $sourceConfig['max_age']]); |
||
75 | } |
||
76 | return []; |
||
77 | } |
||
79 |