Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Security] Simplifying the DEV firewall's pattern#20794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ThomasLandauer wants to merge3 commits intosymfony:6.4
base:6.4
Choose a base branch
Loading
fromThomasLandauer:patch-17
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletionssecurity.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -497,7 +497,7 @@
# the order in which firewalls are defined is very important, as the
# request will be handled by the first firewall whose pattern matches
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
pattern: ^/_profiler|_wdt|assets|build/ # `assets` is for AssetMapper; `build` is for Webpack Encore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
pattern: ^/_profiler|_wdt|assets|build/ # `assets` is for AssetMapper; `build` is for Webpack Encore
pattern: ^/(_profiler|_wdt|assets|build)/ # `assets` is for AssetMapper; `build` is for Webpack Encore

security: false
# a firewall with no pattern should be defined last because it will match all requests
main:
Expand All@@ -509,7 +509,7 @@
# https://symfony.com/doc/current/security.html#firewalls-authentication

# https://symfony.com/doc/current/security/impersonating_user.html
# switch_user: true

Check failure on line 512 in security.rst

View workflow job for this annotation

GitHub Actions/ Code Blocks

[Cache Warmup] In SecurityExtension.php line 399: Invalid firewall "main": user provider "app_user_provider" not found. 2025-03-23T10:22:38+00:00 [info] User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\Bundle::build()" might add "void" as a native return type declaration in the future. Do the same in child class "Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle" now to avoid errors or add an explicit@return annotation to suppress this message.

.. code-block:: xml

Expand All@@ -529,8 +529,8 @@
<!-- the order in which firewalls are defined is very important, as the
request will be handled by the first firewall whose pattern matches -->
<firewall name="dev"
pattern="^/(_(profiler|wdt)|css|images|js)/"
security="false"/>
pattern="^/_profiler|_wdt|assets|build/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
pattern="^/_profiler|_wdt|assets|build/"
pattern="^/(_profiler|_wdt|assets|build)/"

security="false"/> <!-- `assets` is for AssetMapper; `build` is for Webpack Encore -->

<!-- a firewall with no pattern should be defined last because it will match all requests -->
<firewall name="main"
Expand All@@ -555,7 +555,7 @@
// the order in which firewalls are defined is very important, as the
// request will be handled by the first firewall whose pattern matches
$security->firewall('dev')
->pattern('^/(_(profiler|wdt)|css|images|js)/')
->pattern('^/_profiler|_wdt|assets|build/') // `assets` is for AssetMapper; `build` is for Webpack Encore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
->pattern('^/_profiler|_wdt|assets|build/') // `assets` is for AssetMapper; `build` is for Webpack Encore
->pattern('^/(_profiler|_wdt|assets|build)/') // `assets` is for AssetMapper; `build` is for Webpack Encore

->security(false)
;

Expand DownExpand Up@@ -598,9 +598,7 @@
pattern:
- ^/_profiler/
- ^/_wdt/
- ^/css/
- ^/images/
- ^/js/
- ^/assets/
# ...

.. code-block:: php
Expand All@@ -614,9 +612,7 @@
->pattern([
'^/_profiler/',
'^/_wdt/',
'^/css/',
'^/images/',
'^/js/',
'^/assets/',
])
->security(false)
;
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp