|
@@ 136-147 (lines=12) @@
|
| 133 |
|
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
| 134 |
|
* @param \SpomkyLabs\JoseBundle\DependencyInjection\JWKSetSource\JWKSetSourceInterface[] $jwk_set_sources |
| 135 |
|
*/ |
| 136 |
|
private function createJWKSet($name, array $config, ContainerBuilder $container, array $jwk_set_sources) |
| 137 |
|
{ |
| 138 |
|
foreach ($config as $key => $adapter) { |
| 139 |
|
if (array_key_exists($key, $jwk_set_sources)) { |
| 140 |
|
$service_id = sprintf('jose.key_set.%s', $name); |
| 141 |
|
$jwk_set_sources[$key]->create($container, $service_id, $adapter); |
| 142 |
|
|
| 143 |
|
return; |
| 144 |
|
} |
| 145 |
|
} |
| 146 |
|
throw new \LogicException(sprintf('The JWKSet definition "%s" is not configured.', $name)); |
| 147 |
|
} |
| 148 |
|
|
| 149 |
|
/** |
| 150 |
|
* @param string $name |
|
@@ 155-166 (lines=12) @@
|
| 152 |
|
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
| 153 |
|
* @param \SpomkyLabs\JoseBundle\DependencyInjection\JWKSource\JWKSourceInterface[] $jwk_sources |
| 154 |
|
*/ |
| 155 |
|
private function createJWK($name, array $config, ContainerBuilder $container, array $jwk_sources) |
| 156 |
|
{ |
| 157 |
|
foreach ($config as $key => $adapter) { |
| 158 |
|
if (array_key_exists($key, $jwk_sources)) { |
| 159 |
|
$service_id = sprintf('jose.key.%s', $name); |
| 160 |
|
$jwk_sources[$key]->create($container, $service_id, $adapter); |
| 161 |
|
|
| 162 |
|
return; |
| 163 |
|
} |
| 164 |
|
} |
| 165 |
|
throw new \LogicException(sprintf('The JWK definition "%s" is not configured.', $name)); |
| 166 |
|
} |
| 167 |
|
|
| 168 |
|
/** |
| 169 |
|
* @param string $name |