wallabag/app/config/security.yml

82 lines
3 KiB
YAML
Raw Normal View History

2015-01-22 07:30:07 +00:00
security:
encoders:
FOS\UserBundle\Model\UserInterface: sha512
2015-01-22 07:30:07 +00:00
role_hierarchy:
2016-06-24 09:28:07 +00:00
ROLE_ADMIN: ROLE_USER
2015-01-31 14:14:10 +00:00
ROLE_SUPER_ADMIN: [ ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH ]
2015-01-22 07:30:07 +00:00
providers:
2015-01-31 14:14:10 +00:00
administrators:
2016-06-24 09:28:07 +00:00
entity:
2023-12-30 22:32:36 +00:00
class: 'Wallabag\CoreBundle\Entity\User'
2016-06-24 09:28:07 +00:00
property: username
2015-08-18 09:08:45 +00:00
fos_userbundle:
2018-03-28 19:56:55 +00:00
id: fos_user.user_provider.username_email
2015-01-22 07:30:07 +00:00
# the main part of the security, where you can set up firewalls
# for specific sections of your app
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
oauth_token:
pattern: ^/oauth/v2/token
security: false
api:
pattern: /api/.*
fos_oauth: true
stateless: true
2015-09-29 12:52:46 +00:00
anonymous: true
provider: fos_userbundle
2015-01-31 14:14:10 +00:00
login_firewall:
2016-06-24 09:28:07 +00:00
pattern: ^/login$
2015-01-31 14:14:10 +00:00
anonymous: ~
secured_area:
2015-08-18 09:08:45 +00:00
pattern: ^/
form_login:
2015-08-18 09:08:45 +00:00
provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager
2016-06-24 09:28:07 +00:00
anonymous: true
2015-08-12 10:27:12 +00:00
remember_me:
2016-06-24 09:28:07 +00:00
secret: "%secret%"
2015-08-12 10:27:12 +00:00
lifetime: 31536000
2016-06-24 09:28:07 +00:00
path: /
domain: ~
2015-08-12 10:27:12 +00:00
logout:
path: /logout
target: /
2015-01-31 14:14:10 +00:00
two_factor:
provider: fos_userbundle
auth_form_path: 2fa_login
check_path: 2fa_login_check
2015-01-22 07:30:07 +00:00
access_control:
- { path: ^/api/(doc|version|info|user), roles: IS_AUTHENTICATED_ANONYMOUSLY }
2015-01-31 14:14:10 +00:00
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
# 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] }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
2020-04-26 12:09:16 +00:00
- { path: /(unread|starred|archive|annotated|all).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/locale, role: IS_AUTHENTICATED_ANONYMOUSLY }
2017-06-10 11:11:08 +00:00
- { path: /tags/(.*).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/feed, roles: IS_AUTHENTICATED_ANONYMOUSLY }
2020-04-26 12:09:16 +00:00
- { path: /(unread|starred|archive|annotated).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } # For backwards compatibility
2016-04-10 15:33:15 +00:00
- { path: ^/share, roles: IS_AUTHENTICATED_ANONYMOUSLY }
2016-01-21 07:53:09 +00:00
- { path: ^/settings, roles: ROLE_SUPER_ADMIN }
- { path: ^/annotations, roles: ROLE_USER }
- { path: ^/2fa, role: IS_AUTHENTICATED_2FA_IN_PROGRESS }
- { path: ^/users, roles: ROLE_SUPER_ADMIN }
- { path: ^/ignore-origin-instance-rules, roles: ROLE_SUPER_ADMIN }
2016-01-22 17:48:04 +00:00
- { path: ^/, roles: ROLE_USER }