-
-
Notifications
You must be signed in to change notification settings - Fork 424
Add access_control rule for form login auth #460
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
base: 1.x
Are you sure you want to change the base?
Conversation
Hello, |
Hi! Yes, it's done here: If an existing config is detected, the line is not added. The test case name is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, we are almost there!
$accessControlRules = $newData['security']['access_control'] ?? []; | ||
|
||
foreach ($accessControlRules as $rule) { | ||
if ('^/login$' === $rule['path']) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that check is a little bit too strict: I think we should check for ^/login
, it's the syntax from the (old) documentation: https://symfony.com/doc/4.0/security/form_login_setup.html#be-sure-the-login-page-isn-t-secure-redirect-loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
- | ||
path: ^/login$ | ||
roles: IS_AUTHENTICATED_ANONYMOUSLY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way to use the inline syntax (as in simple_security_with_access_control.yaml
) instead of that one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that I'm aware of. It was pointed out in the related issue that this might happen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thank you for the clarification!
Hiya! This generally look very good (including the tests). But, I think I need to do a bit of work on |
This PR was squashed before being merged into the 1.0-dev branch (closes #487). Discussion ---------- Yaml source manipulator - fix access control This helps #460 by fixing a few bugs with YamlSourceManipulator. But, it doesn't yet allow for the `access_control` array structure to be printed in an inline format (#460 (comment)). Cheers! Commits ------- aa6c358 Fixing bug where a scalar value would become and array, but comment placement was wrong 1927d14 Fixing bug when a yaml key with no value ends a file
A rebase is required |
7525d82
to
ef5d7cc
Compare
Rebase done ! |
This PR was squashed before being merged into the 1.0-dev branch (closes #487). Discussion ---------- Yaml source manipulator - fix access control This helps #460 by fixing a few bugs with YamlSourceManipulator. But, it doesn't yet allow for the `access_control` array structure to be printed in an inline format (symfony/maker-bundle#460 (comment)). Cheers! Commits ------- aa6c358 Fixing bug where a scalar value would become and array, but comment placement was wrong 1927d14 Fixing bug when a yaml key with no value ends a file
Add
access_control
rule whenmake:auth
command is used with login form authenticator