-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[SecurityBundle] Make firewalls event dispatcher traceable on debug mode #49021
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
Conversation
Could you illustrate what this brings to userland with e.g. a screenshot? |
@chalasr done! |
688e0bf
to
9c80f15
Compare
Can you add some test? Also can you double check that there is no existing compiler pass that could be patched instead of adding a new one? |
Did not find anything related, which kind of surprised me because what I’m doing here feels like it could be generic 🤔 |
Damn I broke |
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.
LGTM once tests are green :)
...le/SecurityBundle/DependencyInjection/Compiler/MakeFirewallsEventDispatcherTraceablePass.php
Outdated
Show resolved
Hide resolved
...le/SecurityBundle/DependencyInjection/Compiler/MakeFirewallsEventDispatcherTraceablePass.php
Outdated
Show resolved
Hide resolved
754690d
to
4817130
Compare
Looks like #49021 (comment) was the cause of the failing test, which is weird? How could it register |
c1d91ea
to
c5407ce
Compare
Thank you @MatTheCat. |
…(MatTheCat) This PR was merged into the 6.3 branch. Discussion ---------- [HttpKernel] Collect data from every event dispatcher | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A Follow-up of #49021: instead of only passing the main event dispatcher to the `EventDataCollector`, we pass them all (thanks to the `event_dispatcher.dispatcher` tag).  (The heading is now “Dispatched Events”.) Check “Hide whitespace” when reviewing. Commits ------- 7a77b3a [HttpKernel] Collect data from every event dispatcher
…firewall event dispatcher (danielburger1337) This PR was squashed before being merged into the 7.1 branch. Discussion ---------- [SecurityBundle] Use "event" monolog channel in traceable firewall event dispatcher | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | n/a | License | MIT I think since #49021 was merged, security events in debug mode are logged inside the "app" (default) channel. This is very annoying in an API use case as every request generates about 10 _useless_ log entries. This PR changes the monolog channel of the traceable event dispatcher to `event` and also tags it with `kernel.reset`. This matches the behavior of `debug.event_dispatcher`. Commits ------- 3995c71 [SecurityBundle] Use "event" monolog channel in traceable firewall event dispatcher
…firewall event dispatcher (danielburger1337) This PR was squashed before being merged into the 7.1 branch. Discussion ---------- [SecurityBundle] Use "event" monolog channel in traceable firewall event dispatcher | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | n/a | License | MIT I think since symfony/symfony#49021 was merged, security events in debug mode are logged inside the "app" (default) channel. This is very annoying in an API use case as every request generates about 10 _useless_ log entries. This PR changes the monolog channel of the traceable event dispatcher to `event` and also tags it with `kernel.reset`. This matches the behavior of `debug.event_dispatcher`. Commits ------- 3995c71b61 [SecurityBundle] Use "event" monolog channel in traceable firewall event dispatcher
This PR decorates firewalls event dispatcher with
TraceableEventDispatcher
on debug mode. This will display security events and listeners in the profiler’stime
panel.Before
After
They still won’t appear in the
events
panel (because theEventDataCollector
is only injecteddebug.event_dispatcher
) but I think it will be best handled in a separate PR.