1 | <?php |
||
20 | final class ConfigurationHelper |
||
21 | { |
||
22 | const BUNDLE_ALIAS = 'jose'; |
||
23 | |||
24 | /** |
||
25 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
||
26 | * @param string $name |
||
27 | * @param string[] $header_checkers |
||
28 | * @param string[] $claim_checkers |
||
29 | * @param bool $is_public |
||
30 | */ |
||
31 | public static function addChecker(ContainerBuilder $container, $name, array $header_checkers, array $claim_checkers, $is_public = true) |
||
36 | |||
37 | /** |
||
38 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
||
39 | * @param string $name |
||
40 | * @param string[] $signature_algorithms |
||
41 | * @param bool $create_verifier |
||
42 | * @param bool $is_public |
||
43 | */ |
||
44 | public static function addSigner(ContainerBuilder $container, $name, array $signature_algorithms, $create_verifier = false, $is_public = true) |
||
49 | |||
50 | /** |
||
51 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
||
52 | * @param string $name |
||
53 | * @param string[] $signature_algorithms |
||
54 | * @param bool $is_public |
||
55 | */ |
||
56 | public static function addVerifier(ContainerBuilder $container, $name, array $signature_algorithms, $is_public = true) |
||
61 | |||
62 | /** |
||
63 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
||
64 | * @param string $name |
||
65 | * @param string[] $key_encryption_algorithms |
||
66 | * @param string[] $content_encryption_algorithms |
||
67 | * @param string[] $compression_methods |
||
68 | * @param bool $create_decrypter |
||
69 | * @param bool $is_public |
||
70 | */ |
||
71 | public static function addEncrypter(ContainerBuilder $container, $name, array $key_encryption_algorithms, array $content_encryption_algorithms, array $compression_methods = ['DEF'], $create_decrypter = false, $is_public = true) |
||
76 | |||
77 | /** |
||
78 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
||
79 | * @param string $name |
||
80 | * @param string[] $key_encryption_algorithms |
||
81 | * @param string[] $content_encryption_algorithms |
||
82 | * @param string[] $compression_methods |
||
83 | * @param bool $is_public |
||
84 | */ |
||
85 | public static function addDecrypter(ContainerBuilder $container, $name, array $key_encryption_algorithms, array $content_encryption_algorithms, array $compression_methods = ['DEF'], $is_public = true) |
||
90 | |||
91 | /** |
||
92 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
||
93 | * @param string $name |
||
94 | * @param string $signer |
||
95 | * @param string|null $encrypter |
||
96 | * @param bool $is_public |
||
97 | */ |
||
98 | public static function addJWTCreator(ContainerBuilder $container, $name, $signer, $encrypter = null, $is_public = true) |
||
103 | |||
104 | /** |
||
105 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
||
106 | * @param string $name |
||
107 | * @param string $verifier |
||
108 | * @param string $checker |
||
109 | * @param string|null $decrypter |
||
110 | * @param bool $is_public |
||
111 | */ |
||
112 | public static function addJWTLoader(ContainerBuilder $container, $name, $verifier, $checker, $decrypter = null, $is_public = true) |
||
117 | |||
118 | /** |
||
119 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
||
120 | * @param string $name |
||
121 | * @param string $storage_path |
||
122 | * @param int $nb_keys |
||
123 | * @param array $key_configuration |
||
124 | * @param bool $is_rotatable |
||
125 | * @param bool $is_public |
||
126 | */ |
||
127 | public static function addRandomJWKSet(ContainerBuilder $container, $name, $storage_path, $nb_keys, array $key_configuration, $is_rotatable = false, $is_public = true) |
||
132 | |||
133 | /** |
||
134 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
||
135 | * @param string $name |
||
136 | * @param string $jwkset |
||
137 | * @param bool $is_public |
||
138 | */ |
||
139 | public static function addPublicJWKSet(ContainerBuilder $container, $name, $jwkset, $is_public = true) |
||
144 | |||
145 | /** |
||
146 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
||
147 | * @param string $name |
||
148 | * @param string[] $jwksets |
||
149 | * @param bool $is_public |
||
150 | */ |
||
151 | public static function addJWKSets(ContainerBuilder $container, $name, array $jwksets, $is_public = true) |
||
156 | |||
157 | /** |
||
158 | * @param string $name |
||
159 | * @param string[] $header_checkers |
||
160 | * @param string[] $claim_checkers |
||
161 | * @param bool $is_public |
||
162 | * |
||
163 | * @return array |
||
164 | */ |
||
165 | private static function getCheckerConfiguration($name, array $header_checkers, array $claim_checkers, $is_public = true) |
||
183 | |||
184 | /** |
||
185 | * @param string $name |
||
186 | * @param string[] $signature_algorithms |
||
187 | * @param bool $create_verifier |
||
188 | * @param bool $is_public |
||
189 | * |
||
190 | * @return array |
||
191 | */ |
||
192 | private static function getSignerConfiguration($name, array $signature_algorithms, $create_verifier = false, $is_public = true) |
||
211 | |||
212 | /** |
||
213 | * @param string $name |
||
214 | * @param string[] $signature_algorithms |
||
215 | * @param bool $is_public |
||
216 | * |
||
217 | * @return array |
||
218 | */ |
||
219 | private static function getVerifierConfiguration($name, array $signature_algorithms, $is_public = true) |
||
236 | |||
237 | /** |
||
238 | * @param string $name |
||
239 | * @param string[] $key_encryption_algorithms |
||
240 | * @param string[] $content_encryption_algorithms |
||
241 | * @param string[] $compression_methods |
||
242 | * @param bool $create_decrypter |
||
243 | * @param bool $is_public |
||
244 | * |
||
245 | * @return array |
||
246 | */ |
||
247 | private static function getEncrypterConfiguration($name, array $key_encryption_algorithms, array $content_encryption_algorithms, array $compression_methods = ['DEF'], $create_decrypter = false, $is_public = true) |
||
270 | |||
271 | /** |
||
272 | * @param string $name |
||
273 | * @param string[] $key_encryption_algorithms |
||
274 | * @param string[] $content_encryption_algorithms |
||
275 | * @param string[] $compression_methods |
||
276 | * @param bool $is_public |
||
277 | * |
||
278 | * @return array |
||
279 | */ |
||
280 | private static function getDecrypterConfiguration($name, array $key_encryption_algorithms, array $content_encryption_algorithms, array $compression_methods = ['DEF'], $is_public = true) |
||
301 | |||
302 | /** |
||
303 | * @param string $name |
||
304 | * @param string $signer |
||
305 | * @param string|null $encrypter |
||
306 | * @param bool $is_public |
||
307 | * |
||
308 | * @return array |
||
309 | */ |
||
310 | private static function getJWTCreatorConfiguration($name, $signer, $encrypter = null, $is_public = true) |
||
329 | |||
330 | /** |
||
331 | * @param string $name |
||
332 | * @param string $verifier |
||
333 | * @param string $checker |
||
334 | * @param string|null $decrypter |
||
335 | * @param bool $is_public |
||
336 | * |
||
337 | * @return array |
||
338 | */ |
||
339 | private static function getJWTLoaderConfiguration($name, $verifier, $checker, $decrypter = null, $is_public = true) |
||
361 | |||
362 | /** |
||
363 | * @param string $name |
||
364 | * @param string $storage_path |
||
365 | * @param int $nb_keys |
||
366 | * @param array $key_configuration |
||
367 | * @param bool $is_rotatable |
||
368 | * @param bool $is_public |
||
369 | * |
||
370 | * @return array |
||
371 | */ |
||
372 | private static function getRandomJWKSetConfiguration($name, $storage_path, $nb_keys, array $key_configuration, $is_rotatable = false, $is_public = true) |
||
397 | |||
398 | /** |
||
399 | * @param string $name |
||
400 | * @param string $jwkset |
||
401 | * @param bool $is_public |
||
402 | * |
||
403 | * @return array |
||
404 | */ |
||
405 | private static function getPublicJWKSetConfiguration($name, $jwkset, $is_public = true) |
||
424 | |||
425 | /** |
||
426 | * @param string $name |
||
427 | * @param string[] $jwksets |
||
428 | * @param bool $is_public |
||
429 | * |
||
430 | * @return array |
||
431 | */ |
||
432 | private static function getJWKSetsConfiguration($name, array $jwksets, $is_public = true) |
||
452 | |||
453 | /** |
||
454 | * @param string $name |
||
455 | * @param bool $is_public |
||
456 | */ |
||
457 | private static function checkParameters($name, $is_public) |
||
463 | |||
464 | /** |
||
465 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
||
466 | * @param array $config |
||
467 | * @param string $element |
||
468 | */ |
||
469 | private static function updateJoseConfiguration(ContainerBuilder $container, array $config, $element) |
||
479 | |||
480 | /** |
||
481 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
||
482 | * |
||
483 | * @throws \InvalidArgumentException |
||
484 | */ |
||
485 | private static function checkJoseBundleEnabled(ContainerBuilder $container) |
||
490 | } |
||
491 |