Skip to content

Commit b6d91b2

Browse files
javiereguiluznicolas-grekas
authored andcommitted
Removed most deprecations
1 parent 997ce81 commit b6d91b2

18 files changed

+74
-40
lines changed

config/packages/dev/mailer.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

config/packages/framework.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ framework:
1010
handler_id: null
1111
cookie_secure: auto
1212
cookie_samesite: lax
13+
storage_factory_id: session.storage.factory.native
1314

1415
# When using the HTTP Cache, ESI allows to render page fragments separately
1516
# and with different cache configurations for each fragment
@@ -25,3 +26,9 @@ framework:
2526
# When 'ide' is set to null the file is opened in your web browser.
2627
# See https://symfony.com/doc/current/reference/configuration/framework.html#ide
2728
ide: null
29+
30+
when@test:
31+
framework:
32+
test: true
33+
session:
34+
storage_factory_id: session.storage.factory.mock_file

config/packages/mailer.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
framework:
22
mailer:
33
dsn: '%env(MAILER_DSN)%'
4+
5+
when@dev:
6+
framework:
7+
mailer:
8+
# this disables delivery of messages entirely
9+
dsn: 'null://null'
10+
11+
when@test:
12+
framework:
13+
mailer:
14+
# this disables delivery of messages entirely
15+
dsn: 'null://null'

config/packages/prod/routing.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

config/packages/routing.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ framework:
55
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
66
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
77
#default_uri: http://localhost
8+
9+
when@prod:
10+
framework:
11+
router:
12+
strict_requirements: null

config/packages/security.yaml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
security:
2-
encoders:
2+
# a new authentication system is available since Symfony 5.1 to make
3+
# Symfony security more extensible and easier to understand
4+
# https://symfony.com/doc/current/security/experimental_authenticators.html
5+
enable_authenticator_manager: true
6+
7+
password_hashers:
38
# Our user class and the algorithm we'll use to encode passwords
49
# 'auto' means to let Symfony choose the best possible password hasher (Argon2 or Bcrypt)
510
# https://symfony.com/doc/current/security.html#c-encoding-passwords
@@ -23,9 +28,6 @@ security:
2328
# this firewall applies to all URLs
2429
pattern: ^/
2530

26-
# but the firewall does not require login on every page
27-
# denying access is done in access_control or in your controllers
28-
anonymous: true
2931
lazy: true
3032

3133
# The user provider to use.
@@ -40,8 +42,8 @@ security:
4042
# When the user tries to access a protected page, they are redirected here
4143
login_path: security_login
4244
# Secure the login form against CSRF
43-
# Reference: https://symfony.com/doc/current/security/csrf.html#csrf-protection-in-login-forms
44-
csrf_token_generator: security.csrf.token_manager
45+
# Reference: https://symfony.com/doc/current/security/csrf.html
46+
enable_csrf: true
4547
# The page users are redirect to when there is no previous page stored in the
4648
# session (for example when the users access directly to the login page).
4749
default_target_path: blog_index
@@ -52,6 +54,12 @@ security:
5254
# The name of the route to redirect to after logging out
5355
target: homepage
5456

57+
# needed because in tests we redefine the 'main' firewall to use
58+
# HTTP Basic instead of he login form, so this firewall has
59+
# multiple authenticators
60+
# See https://symfony.com/doc/current/security/experimental_authenticators.html#configuring-the-authentication-entry-point
61+
entry_point: 'form_login'
62+
5563
# Easy way to control access for large sections of your site
5664
# Note: Only the *first* access control that matches will be used
5765
access_control:
@@ -61,3 +69,11 @@ security:
6169

6270
role_hierarchy:
6371
ROLE_ADMIN: ROLE_USER
72+
73+
when@test:
74+
# this configuration simplifies testing URLs protected by the security mechanism
75+
# See https://symfony.com/doc/current/testing/http_authentication.html
76+
security:
77+
firewalls:
78+
main:
79+
http_basic: ~

config/packages/test/framework.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

config/packages/test/mailer.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

config/packages/test/security.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

config/packages/test/twig.yaml

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)