|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Copyright 2014 SURFnet bv |
|
5
|
|
|
* |
|
6
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
7
|
|
|
* you may not use this file except in compliance with the License. |
|
8
|
|
|
* You may obtain a copy of the License at |
|
9
|
|
|
* |
|
10
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
|
11
|
|
|
* |
|
12
|
|
|
* Unless required by applicable law or agreed to in writing, software |
|
13
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
14
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15
|
|
|
* See the License for the specific language governing permissions and |
|
16
|
|
|
* limitations under the License. |
|
17
|
|
|
*/ |
|
|
|
|
|
|
18
|
|
|
|
|
19
|
|
|
namespace Surfnet\StepupMiddleware\MiddlewareBundle\DependencyInjection; |
|
20
|
|
|
|
|
21
|
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
|
22
|
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface; |
|
23
|
|
|
|
|
24
|
|
|
class Configuration implements ConfigurationInterface |
|
|
|
|
|
|
25
|
|
|
{ |
|
26
|
|
|
public function getConfigTreeBuilder(): TreeBuilder |
|
27
|
|
|
{ |
|
28
|
|
|
$treeBuilder = new TreeBuilder('surfnet_stepup_middleware_middleware'); |
|
29
|
|
|
$rootNode = $treeBuilder->getRootNode(); |
|
30
|
|
|
$rootNode |
|
31
|
|
|
->children() |
|
32
|
|
|
->arrayNode('second_factors_display_name')->isRequired()->scalarPrototype()->end()->end() |
|
33
|
|
|
->scalarNode('email_verification_window') |
|
34
|
|
|
->info('The amount of seconds after which the email verification url/code expires') |
|
35
|
|
|
->defaultValue(3600) |
|
36
|
|
|
->validate() |
|
37
|
|
|
->ifTrue(fn($seconds): bool => !is_int($seconds) || $seconds < 1) |
|
38
|
|
|
->thenInvalid( |
|
39
|
|
|
'The email verification window must be a positive integer', |
|
40
|
|
|
) |
|
41
|
|
|
->end() |
|
42
|
|
|
->end() |
|
43
|
|
|
->arrayNode('enabled_generic_second_factors') |
|
44
|
|
|
->isRequired() |
|
45
|
|
|
->prototype('array') |
|
46
|
|
|
->children() |
|
47
|
|
|
->scalarNode('loa') |
|
48
|
|
|
->isRequired() |
|
49
|
|
|
->info('The lao level of the Gssf') |
|
50
|
|
|
->end() |
|
51
|
|
|
->end() |
|
52
|
|
|
->end() |
|
53
|
|
|
->end(); |
|
54
|
|
|
|
|
55
|
|
|
return $treeBuilder; |
|
56
|
|
|
} |
|
57
|
|
|
} |
|
58
|
|
|
|