1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
namespace lepiaf\SapientBundle\DependencyInjection; |
5
|
|
|
|
6
|
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
7
|
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface; |
8
|
|
|
|
9
|
|
|
class Configuration implements ConfigurationInterface |
10
|
|
|
{ |
11
|
17 |
|
public function getConfigTreeBuilder() |
12
|
|
|
{ |
13
|
17 |
|
$treeBuilder = new TreeBuilder(); |
14
|
|
|
|
15
|
17 |
|
$rootNode = $treeBuilder->root('sapient'); |
16
|
|
|
|
17
|
|
|
$rootNode |
18
|
17 |
|
->children() |
19
|
17 |
|
->arrayNode('sign')->canBeEnabled() |
20
|
17 |
|
->children() |
21
|
17 |
|
->scalarNode('private')->isRequired()->end() |
22
|
17 |
|
->scalarNode('public')->isRequired()->end() |
23
|
17 |
|
->scalarNode('host')->isRequired()->end() |
24
|
17 |
|
->scalarNode('response')->defaultFalse()->end() |
25
|
17 |
|
->end() |
26
|
17 |
|
->end() |
27
|
17 |
|
->arrayNode('seal')->canBeEnabled() |
28
|
17 |
|
->children() |
29
|
17 |
|
->scalarNode('private')->isRequired()->end() |
30
|
17 |
|
->scalarNode('public')->isRequired()->end() |
31
|
17 |
|
->scalarNode('response')->defaultFalse()->end() |
32
|
17 |
|
->end() |
33
|
17 |
|
->end() |
34
|
17 |
|
->arrayNode('guzzle_middleware')->canBeEnabled() |
35
|
17 |
|
->children() |
36
|
17 |
|
->booleanNode('unseal')->defaultFalse()->end() |
37
|
17 |
|
->booleanNode('verify')->defaultFalse()->end() |
38
|
17 |
|
->booleanNode('sign_request')->defaultFalse()->end() |
39
|
17 |
|
->booleanNode('seal_request')->defaultFalse()->end() |
40
|
17 |
|
->scalarNode('requester_host')->defaultFalse()->end() |
41
|
17 |
|
->end() |
42
|
17 |
|
->end() |
43
|
17 |
|
->arrayNode('sealing_public_keys') |
44
|
17 |
|
->arrayPrototype() |
45
|
17 |
|
->children() |
46
|
17 |
|
->scalarNode('host')->end() |
47
|
17 |
|
->scalarNode('key')->end() |
48
|
17 |
|
->end() |
49
|
17 |
|
->end() |
50
|
17 |
|
->end() |
51
|
17 |
|
->arrayNode('verifying_public_keys') |
52
|
17 |
|
->arrayPrototype() |
53
|
17 |
|
->children() |
54
|
17 |
|
->scalarNode('host')->end() |
55
|
17 |
|
->scalarNode('key')->end() |
56
|
17 |
|
->end() |
57
|
17 |
|
->end() |
58
|
17 |
|
->end() |
59
|
17 |
|
->booleanNode('verify_request')->defaultFalse()->end() |
60
|
17 |
|
->booleanNode('unseal_request')->defaultFalse()->end() |
61
|
17 |
|
->end() |
62
|
|
|
; |
63
|
|
|
|
64
|
17 |
|
return $treeBuilder; |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
|