Skip to content

[Security] query string can't be used in security.access_control > path #12605

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2019

Conversation

alexislefebvre
Copy link
Contributor

Goal: explain that GET parameters are ignored, so the following rule won't work:

- { path: ^/foo/bar\?foobar=[0-9]+, roles: [ ROLE_USER ], methods: [ GET ] }

Source: https://stackoverflow.com/questions/46600752/symfony-access-control-regex-with-get-parameter

@alexislefebvre alexislefebvre changed the title access_control.rst: query string is ignored [Security] query string can't be used in security.access_control > path Nov 8, 2019
Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

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

Oh wow, never thought about this. I definitely agree with adding this! It doesn't hurt and it'll save quite some time for people that think it is possible.

@javiereguiluz
Copy link
Member

javiereguiluz commented Nov 8, 2019

@alexislefebvre I like this proposal ... but I think it's too hidden in the new text. I'd create a separate phrase (or maybe a note?) clearly saying that query parameters are ignored for access_control regexp matches.

wouterj added a commit that referenced this pull request Nov 9, 2019
…_control > path (alexislefebvre)

This PR was merged into the 3.4 branch.

Discussion
----------

[Security] query string can't be used in security.access_control > path

Goal: explain that GET parameters are ignored, so the following rule won't work:

```
- { path: ^/foo/bar\?foobar=[0-9]+, roles: [ ROLE_USER ], methods: [ GET ] }
```

Source: https://stackoverflow.com/questions/46600752/symfony-access-control-regex-with-get-parameter

Commits
-------

2877f9b access_control.rst: query string is ignored
wouterj added a commit that referenced this pull request Nov 9, 2019
* 3.4:
  [#12605] Transformed GET parameter notice to caution
  access_control.rst: query string is ignored
wouterj added a commit that referenced this pull request Nov 9, 2019
* 4.3:
  [#12605] Transformed GET parameter notice to caution
  access_control.rst: query string is ignored
  [mercure] compatibility with v0.8
  Update doctrine.rst
wouterj added a commit that referenced this pull request Nov 9, 2019
* 4.4:
  [#12605] Transformed GET parameter notice to caution
  access_control.rst: query string is ignored
  [Console] Update some method names
  [mercure] compatibility with v0.8
  Update doctrine.rst
@wouterj wouterj merged commit 2877f9b into symfony:3.4 Nov 9, 2019
@wouterj
Copy link
Member

wouterj commented Nov 9, 2019

Thanks @alexislefebvre! I've applied Javier's suggestion of moving this into a more explicit caution in 35b812c

@alexislefebvre alexislefebvre deleted the patch-2 branch November 12, 2019 10:03
@alexislefebvre
Copy link
Contributor Author

Thanks a lot @wouterj!

@OskarStark OskarStark added this to the 3.4 milestone Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants