2015-01-22 08:30:07 +01:00
|
|
|
security:
|
|
|
|
encoders:
|
2015-09-29 14:31:52 +02:00
|
|
|
FOS\UserBundle\Model\UserInterface: sha512
|
2015-01-22 08:30:07 +01:00
|
|
|
|
|
|
|
role_hierarchy:
|
2016-06-24 11:28:07 +02:00
|
|
|
ROLE_ADMIN: ROLE_USER
|
2015-01-31 15:14:10 +01:00
|
|
|
ROLE_SUPER_ADMIN: [ ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH ]
|
2015-01-22 08:30:07 +01:00
|
|
|
|
|
|
|
providers:
|
2015-01-31 15:14:10 +01:00
|
|
|
administrators:
|
2016-06-24 11:28:07 +02:00
|
|
|
entity:
|
2022-08-25 23:34:56 +02:00
|
|
|
class: 'Wallabag\UserBundle\Entity\User'
|
2016-06-24 11:28:07 +02:00
|
|
|
property: username
|
2015-08-18 11:08:45 +02:00
|
|
|
fos_userbundle:
|
2018-03-28 21:56:55 +02:00
|
|
|
id: fos_user.user_provider.username_email
|
2015-01-22 08:30:07 +01:00
|
|
|
|
|
|
|
# the main part of the security, where you can set up firewalls
|
|
|
|
# for specific sections of your app
|
|
|
|
firewalls:
|
2015-12-22 13:00:37 +01:00
|
|
|
# disables authentication for assets and the profiler, adapt it according to your needs
|
|
|
|
dev:
|
|
|
|
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
|
|
|
security: false
|
|
|
|
|
2015-09-29 14:31:52 +02:00
|
|
|
oauth_token:
|
|
|
|
pattern: ^/oauth/v2/token
|
|
|
|
security: false
|
2015-10-03 13:30:12 +02:00
|
|
|
|
2015-09-29 14:31:52 +02:00
|
|
|
api:
|
|
|
|
pattern: /api/.*
|
|
|
|
fos_oauth: true
|
|
|
|
stateless: true
|
2015-09-29 14:52:46 +02:00
|
|
|
anonymous: true
|
2018-10-04 14:07:20 +02:00
|
|
|
provider: fos_userbundle
|
2015-09-29 14:31:52 +02:00
|
|
|
|
2015-01-31 15:14:10 +01:00
|
|
|
login_firewall:
|
2018-10-04 14:07:20 +02:00
|
|
|
logout_on_user_change: true
|
2016-06-24 11:28:07 +02:00
|
|
|
pattern: ^/login$
|
2015-01-31 15:14:10 +01:00
|
|
|
anonymous: ~
|
|
|
|
|
2015-02-08 21:47:36 +01:00
|
|
|
secured_area:
|
2018-10-04 14:07:20 +02:00
|
|
|
logout_on_user_change: true
|
2015-08-18 11:08:45 +02:00
|
|
|
pattern: ^/
|
2015-02-08 21:47:36 +01:00
|
|
|
form_login:
|
2015-08-18 11:08:45 +02:00
|
|
|
provider: fos_userbundle
|
2015-12-22 13:00:37 +01:00
|
|
|
csrf_token_generator: security.csrf.token_manager
|
2015-02-08 21:47:36 +01:00
|
|
|
|
2016-06-24 11:28:07 +02:00
|
|
|
anonymous: true
|
2015-08-12 12:27:12 +02:00
|
|
|
remember_me:
|
2016-06-24 11:28:07 +02:00
|
|
|
secret: "%secret%"
|
2015-08-12 12:27:12 +02:00
|
|
|
lifetime: 31536000
|
2016-06-24 11:28:07 +02:00
|
|
|
path: /
|
|
|
|
domain: ~
|
2015-08-12 12:27:12 +02:00
|
|
|
|
2015-02-08 21:47:36 +01:00
|
|
|
logout:
|
|
|
|
path: /logout
|
|
|
|
target: /
|
2015-01-31 15:14:10 +01:00
|
|
|
|
2018-12-02 12:43:05 +01:00
|
|
|
two_factor:
|
|
|
|
provider: fos_userbundle
|
|
|
|
auth_form_path: 2fa_login
|
|
|
|
check_path: 2fa_login_check
|
|
|
|
|
2015-01-22 08:30:07 +01:00
|
|
|
access_control:
|
2019-01-15 10:17:11 +01:00
|
|
|
- { path: ^/api/(doc|version|info|user), roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
2015-01-31 15:14:10 +01:00
|
|
|
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
2018-12-02 12:43:05 +01:00
|
|
|
# force role for logout otherwise when 2fa enable, you won't be able to logout
|
|
|
|
# https://github.com/scheb/two-factor-bundle/issues/168#issuecomment-430822478
|
|
|
|
- { path: ^/logout, roles: [IS_AUTHENTICATED_ANONYMOUSLY, IS_AUTHENTICATED_2FA_IN_PROGRESS] }
|
2015-09-29 14:31:52 +02:00
|
|
|
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
2015-10-02 14:51:41 +02:00
|
|
|
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
2020-04-26 14:09:16 +02:00
|
|
|
- { path: /(unread|starred|archive|annotated|all).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
2017-06-12 17:23:35 +02:00
|
|
|
- { path: ^/locale, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
2017-06-10 13:11:08 +02:00
|
|
|
- { path: /tags/(.*).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
2017-06-13 18:48:10 +02:00
|
|
|
- { path: ^/feed, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
2020-04-26 14:09:16 +02:00
|
|
|
- { path: /(unread|starred|archive|annotated).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } # For backwards compatibility
|
2016-04-10 17:33:15 +02:00
|
|
|
- { path: ^/share, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
2016-01-21 08:53:09 +01:00
|
|
|
- { path: ^/settings, roles: ROLE_SUPER_ADMIN }
|
2016-02-07 16:52:59 +01:00
|
|
|
- { path: ^/annotations, roles: ROLE_USER }
|
2018-12-02 12:43:05 +01:00
|
|
|
- { path: ^/2fa, role: IS_AUTHENTICATED_2FA_IN_PROGRESS }
|
2016-09-30 20:09:06 +02:00
|
|
|
- { path: ^/users, roles: ROLE_SUPER_ADMIN }
|
2019-08-27 00:03:30 +02:00
|
|
|
- { path: ^/ignore-origin-instance-rules, roles: ROLE_SUPER_ADMIN }
|
2016-01-22 18:48:04 +01:00
|
|
|
- { path: ^/, roles: ROLE_USER }
|