container1.php 3.6 KB

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