/
container1.php
108 lines (104 loc) · 3.46 KB
/
container1.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
$container->loadFromExtension('security', [
'encoders' => [
'JMS\FooBundle\Entity\User1' => 'plaintext',
'JMS\FooBundle\Entity\User2' => [
'algorithm' => 'sha1',
'encode_as_base64' => false,
'iterations' => 5,
],
'JMS\FooBundle\Entity\User3' => [
'algorithm' => 'md5',
],
'JMS\FooBundle\Entity\User4' => [
'id' => 'security.encoder.foo',
],
'JMS\FooBundle\Entity\User5' => [
'algorithm' => 'pbkdf2',
'hash_algorithm' => 'sha1',
'encode_as_base64' => false,
'iterations' => 5,
'key_length' => 30,
],
'JMS\FooBundle\Entity\User6' => [
'algorithm' => 'native',
'time_cost' => 8,
'memory_cost' => 100,
'cost' => 15,
],
'JMS\FooBundle\Entity\User7' => [
'algorithm' => 'auto',
],
],
'providers' => [
'default' => [
'memory' => [
'users' => [
'foo' => ['password' => 'foo', 'roles' => 'ROLE_USER'],
],
],
],
'digest' => [
'memory' => [
'users' => [
'foo' => ['password' => 'foo', 'roles' => 'ROLE_USER, ROLE_ADMIN'],
],
],
],
'basic' => [
'memory' => [
'users' => [
'foo' => ['password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => 'ROLE_SUPER_ADMIN'],
'bar' => ['password' => '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'roles' => ['ROLE_USER', 'ROLE_ADMIN']],
],
],
],
'service' => [
'id' => 'user.manager',
],
'chain' => [
'chain' => [
'providers' => ['service', 'basic'],
],
],
],
'firewalls' => [
'simple' => ['provider' => 'default', 'pattern' => '/login', 'security' => false],
'secure' => ['stateless' => true,
'provider' => 'default',
'http_basic' => true,
'form_login' => true,
'anonymous' => true,
'switch_user' => true,
'x509' => true,
'remote_user' => true,
'logout' => true,
'remember_me' => ['secret' => 'TheSecret'],
'user_checker' => null,
],
'host' => [
'provider' => 'default',
'pattern' => '/test',
'host' => 'foo\\.example\\.org',
'methods' => ['GET', 'POST'],
'anonymous' => true,
'http_basic' => true,
],
'with_user_checker' => [
'provider' => 'default',
'user_checker' => 'app.user_checker',
'anonymous' => true,
'http_basic' => true,
],
],
'access_control' => [
['path' => '/blog/524', 'role' => 'ROLE_USER', 'requires_channel' => 'https', 'methods' => ['get', 'POST'], 'port' => 8000],
['path' => '/blog/.*', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY'],
['path' => '/blog/524', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY', 'allow_if' => "token.getUsername() matches '/^admin/'"],
],
'role_hierarchy' => [
'ROLE_ADMIN' => 'ROLE_USER',
'ROLE_SUPER_ADMIN' => ['ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'],
'ROLE_REMOTE' => 'ROLE_USER,ROLE_ADMIN',
],
]);