25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
2.1 KiB

  1. security:
  2. # https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
  3. password_hashers:
  4. Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
  5. # https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
  6. providers:
  7. app_user_provider:
  8. entity:
  9. class: Spt\SptCoreBundle\Entity\User
  10. property: email
  11. firewalls:
  12. dev:
  13. pattern: ^/(_(profiler|wdt)|css|images|js)/
  14. security: false
  15. main:
  16. lazy: true
  17. provider: app_user_provider
  18. nelmio_cors: ~
  19. json_login:
  20. # api_login is a route we will create below
  21. check_path: spt_core_api_login
  22. username_path: email
  23. password_path: password
  24. #check_path: spt-core/api/login
  25. # activate different ways to authenticate
  26. # https://symfony.com/doc/current/security.html#the-firewall
  27. # https://symfony.com/doc/current/security/impersonating_user.html
  28. # switch_user: true
  29. # Easy way to control access for large sections of your site
  30. # Note: Only the *first* access control that matches will be used
  31. access_control:
  32. - { path: ^/spt-core/api/login, roles: IS_AUTHENTICATED_FULLY }
  33. # - { path: ^/admin, roles: ROLE_ADMIN }
  34. # - { path: ^/profile, roles: ROLE_USER }
  35. when@test:
  36. security:
  37. password_hashers:
  38. # By default, password hashers are resource intensive and take time. This is
  39. # important to generate secure password hashes. In tests however, secure hashes
  40. # are not important, waste resources and increase test times. The following
  41. # reduces the work factor to the lowest possible values.
  42. Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
  43. algorithm: auto
  44. cost: 4 # Lowest possible value for bcrypt
  45. time_cost: 3 # Lowest possible value for argon
  46. memory_cost: 10 # Lowest possible value for argon