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] Added debug:firewall command#39326

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

Merged
wouterj merged 1 commit intosymfony:5.xfromTimoBakx:debug-firewall-command
Feb 19, 2021
Merged

[Security] Added debug:firewall command#39326

wouterj merged 1 commit intosymfony:5.xfromTimoBakx:debug-firewall-command
Feb 19, 2021

Conversation

TimoBakx
Copy link
Member

@TimoBakxTimoBakx commentedDec 5, 2020
edited
Loading

QA
Branch?5.x
Bug fix?no
New feature?yes
Deprecations?no
TicketsFix#39321
LicenseMIT
Doc PRsymfony/symfony-docs#14982
Tags#SymfonyHackday

Subtasks

  • Add list view (for use without arguments)
  • Add more information to list view
  • Add detail view (for use withfirewall argument)
  • Add more information to detail view table
  • Add authenticators list
  • Add event listeners & events (copy fromdebug:event-listener)
  • Add--include-listeners option (default: false)
  • Add helptext
  • Add documentation

Moved outside of current scope

  • Add allowed badges

Usage (and example output) for a list

bin/console debug:firewall

Firewalls========= The following firewalls are defined: --------   Name     --------   dev       public  main     --------  // To view details of a specific firewall, re-run this command with a firewall name. (e.g. debug:firewall               // main)

Usage (and example output) for details

bin/console debug:firewall main

Firewall "main"=============== ----------------------- ---------------------------------------------------   Option                  Value                                               ----------------------- ---------------------------------------------------   Name                    main                                                 Context                 main                                                 Lazy                    Yes                                                  Stateless               No                                                   User Checker            security.user_checker                                Provider                security.user.provider.concrete.app_user_provider    Entry Point             App\Security\LoginFormAuthenticator                  Access Denied URL                                                            Access Denied Handler                                                       ----------------------- --------------------------------------------------- User switching-------------- ----------- ---------------------------------------------------   Option      Value                                               ----------- ---------------------------------------------------   Parameter   test                                                 Provider    security.user.provider.concrete.app_user_provider    User Role   ROLE_SWITCH_POSSIBLE                                ----------- --------------------------------------------------- Event listeners for firewall "main"==================================="Symfony\Component\Security\Http\Event\LoginSuccessEvent" event--------------------------------------------------------------- ------- -------------------------------------------------------------------------------------------- ----------   Order   Callable                                                                                     Priority   ------- -------------------------------------------------------------------------------------------- ----------   #1      Symfony\Component\Security\Http\EventListener\UserCheckerListener::postCheckCredentials()    256         #2      Symfony\Component\Security\Http\EventListener\SessionStrategyListener::onSuccessfulLogin()   0           #3      Symfony\Component\Security\Http\EventListener\RememberMeListener::onSuccessfulLogin()        0           #4      App\Security\UpdateLastLogin::__invoke()                                                     0           #5      Symfony\Component\Security\Http\EventListener\PasswordMigratingListener::onLoginSuccess()    0          ------- -------------------------------------------------------------------------------------------- ---------- "Symfony\Component\Security\Http\Event\LogoutEvent" event--------------------------------------------------------- ------- ------------------------------------------------------------------------------------------- ----------   Order   Callable                                                                                    Priority   ------- ------------------------------------------------------------------------------------------- ----------   #1      Symfony\Component\Security\Http\EventListener\DefaultLogoutListener::onLogout()             64          #2      Symfony\Component\Security\Http\EventListener\SessionLogoutListener::onLogout()             0           #3      Symfony\Component\Security\Http\EventListener\RememberMeLogoutListener::onLogout()          0           #4      Symfony\Component\Security\Http\EventListener\CsrfTokenClearingLogoutListener::onLogout()   0          ------- ------------------------------------------------------------------------------------------- ---------- "Symfony\Component\Security\Http\Event\CheckPassportEvent" event---------------------------------------------------------------- ------- ------------------------------------------------------------------------------------------ ----------   Order   Callable                                                                                   Priority   ------- ------------------------------------------------------------------------------------------ ----------   #1      Symfony\Component\Security\Http\EventListener\LoginThrottlingListener::checkPassport()     2080        #2      Symfony\Component\Security\Http\EventListener\UserProviderListener::checkPassport()        2048        #3      Symfony\Component\Security\Http\EventListener\UserProviderListener::checkPassport()        1024        #4      Symfony\Component\Security\Http\EventListener\CsrfProtectionListener::checkPassport()      512         #5      Symfony\Component\Security\Http\EventListener\UserCheckerListener::preCheckCredentials()   256         #6      App\Security\DisallowBannedUsers::__invoke()                                               0           #7      Symfony\Component\Security\Http\EventListener\CheckCredentialsListener::checkPassport()    0          ------- ------------------------------------------------------------------------------------------ ---------- "Symfony\Component\Security\Http\Event\LoginFailureEvent" event--------------------------------------------------------------- ------- ----------------------------------------------------------------------------------- ----------   Order   Callable                                                                            Priority   ------- ----------------------------------------------------------------------------------- ----------   #1      Symfony\Component\Security\Http\EventListener\RememberMeListener::onFailedLogin()   0          ------- ----------------------------------------------------------------------------------- ---------- Authenticators for firewall "main"================================== // @TODO: List authenticator information

wouterj, OskarStark, chalasr, and andrewmy reacted with rocket emoji
@carsonbotcarsonbot changed the title[WIP] [Security] Added debug:firewall command[Security] [WIP] Added debug:firewall commandDec 5, 2020
@wouterjwouterj added this to the5.x milestoneDec 5, 2020
Copy link
Member

@wouterjwouterj left a comment

Choose a reason for hiding this comment

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

Looking great already :)

Copy link
Member

@wouterjwouterj left a comment

Choose a reason for hiding this comment

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

Just some comments. Thanks for your enthusiasm about this today!

Btw,#39276 is now merged (but you've probably already discovered that), so this PR is unlocked again

TimoBakx reacted with hooray emoji
@TimoBakxTimoBakx marked this pull request as draftDecember 6, 2020 16:07
Copy link
Member

@wouterjwouterj left a comment

Choose a reason for hiding this comment

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

If I'm correct, the 2 suggested changes are required to use the authenticator locator.

Or than that (and tests), is there anything preventing this command from being merged? It seems quite feature complete already (and we can always open new PRs to add even more features).

@TimoBakx
Copy link
MemberAuthor

@wouterj Thanks for your last suggestion. I'll check if I can make that work and finish up this PR this weekend.

@TimoBakxTimoBakx changed the title[Security] [WIP] Added debug:firewall command[Security] Added debug:firewall commandFeb 14, 2021
@TimoBakxTimoBakx marked this pull request as ready for reviewFebruary 14, 2021 16:09
@TimoBakx
Copy link
MemberAuthor

TimoBakx commentedFeb 14, 2021
edited
Loading

Made some changes for the last review comments. Added help text and documentation. I think this PR is ready to be reviewed.

OskarStark and wouterj reacted with thumbs up emoji

Copy link
Member

@wouterjwouterj left a comment
edited
Loading

Choose a reason for hiding this comment

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

I promise this was the final round of comments :)

I think this looks really nice and helpful (I've been testing it out on a demo project)! (the duplicateUserProviderListener in the output already catches my eyes, maybe there is a bug in the security code 👀 )

Most are about CS (we prefer longer lines over many small lines, it takes some getting used to when contributing). Can you please also update theCHANGELOG.md in the bundle?

TimoBakx reacted with thumbs up emoji
Copy link
Member

@wouterjwouterj left a comment

Choose a reason for hiding this comment

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

This looks perfect to me!

It's probably good to add some tests here some day. However, I see all other debug commands also don't have tests, so I'm fine with merging this feature as-is.

@TimoBakx
Copy link
MemberAuthor

Yeah, I've been thinking about tests, but right now it's kinda hard to test command output. Especially when my IDE keeps trying to remove trailing spaces from the expected table output.

Copy link
Member

@javiereguiluzjaviereguiluz left a comment

Choose a reason for hiding this comment

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

I like this proposal! Thanks Timo!

Copy link
Member

@chalasrchalasr left a comment

Choose a reason for hiding this comment

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

Here is a cosmetic review. Once addressed, this should be ready to go on my side.
Nice work@TimoBakx

@TimoBakx
Copy link
MemberAuthor

@chalasr Thank you for your CS pointers. It's much appreciated. I addressed all points except for the code-move that I can't do.

@wouterj
Copy link
Member

This is great. Thanks a ton Timo for updating your PR with all these review rounds and thinking so hard about all the info that could be displayed here!

TimoBakx reacted with heart emoji

@wouterjwouterj merged commit70ef5b3 intosymfony:5.xFeb 19, 2021
@TimoBakx
Copy link
MemberAuthor

Thank all of you for your reviews and encouragement. My first class added to Symfony. I'm so excited! 🎉

wouterj, chalasr, and ogizanagi reacted with hooray emojiwouterj and chalasr reacted with heart emoji

wouterj added a commit to symfony/symfony-docs that referenced this pull requestFeb 19, 2021
This PR was merged into the 5.3-dev branch.Discussion----------[Security] Added debug:firewall commandDocumentation forsymfony/symfony#39326Commits-------7512515 [Security] Added debug:firewall command
wouterj added a commit that referenced this pull requestFeb 19, 2021
@TimoBakxTimoBakx deleted the debug-firewall-command branchMarch 2, 2021 16:38
junaidbinfarooq pushed a commit to junaidbinfarooq/symfony that referenced this pull requestMar 2, 2021
@fabpotfabpot mentioned this pull requestApr 18, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@OskarStarkOskarStarkOskarStark left review comments

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@wouterjwouterjwouterj approved these changes

@chalasrchalasrchalasr approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
5.4
Development

Successfully merging this pull request may close these issues.

[Security] Add a debug:firewall command
6 participants
@TimoBakx@wouterj@javiereguiluz@OskarStark@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp