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

[HttpKernel] Preserve security exceptions#27515

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

Closed
ro0NL wants to merge1 commit intosymfony:4.1fromro0NL:http-kernel/exceptionn-logging
Closed

[HttpKernel] Preserve security exceptions#27515

ro0NL wants to merge1 commit intosymfony:4.1fromro0NL:http-kernel/exceptionn-logging

Conversation

@ro0NL
Copy link
Contributor

@ro0NLro0NL commentedJun 6, 2018
edited
Loading

QA
Branch?4.1
Bug fix?yes
New feature?yes-ish
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#27440
LicenseMIT
Doc PRsymfony/symfony-docs#...

This PR introduces an approach that allows for skipping certain (origin) exception classes from being logged. In this case the security related ones.

@stof
Copy link
Member

stof commentedJun 6, 2018
edited
Loading

should we actually ignore these ?

These exceptions are handled by the exception listener registered by the firewall, so they should not reach the logging listener later. This looks like a priority issue instead.

->addTag('security.voter');
}

publicfunctionprocess(ContainerBuilder$container)
Copy link
Member

Choose a reason for hiding this comment

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

I would rather put this compiler pass in a dedicated class.

We have lots of different passes in each of our bundles, and this logic is not more related to the DI extension than other passes (rather less)

$request =$event->getRequest();
do {
foreach ($this->silentIgnoreas$class) {
if (is_a($exception,$class)) {
Copy link
Member

Choose a reason for hiding this comment

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

use$exception instanceof $class

return;
}
}
}while (null !==$exception =$exception->getPrevious());
Copy link
Member

Choose a reason for hiding this comment

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

use a different variable name for this loop, to avoid overriding the one containing the main exception

@nicolas-grekas
Copy link
Member

Just wondering: did#27516 change anything here?

@ro0NL
Copy link
ContributorAuthor

ro0NL commentedJun 6, 2018
edited
Loading

@nicolas-grekas yes :)

@stof i'm hesitating between this approach and raising the security exception listener from 0 to 2048+1,

edit: then again.. exceptions are edge-case-ish anyway.. so perhaps we can get away with it, along with a clear changelog entry. I do prefer the priority solution.. sure

@nicolas-grekasnicolas-grekas added this to the4.1 milestoneJun 7, 2018
@nicolas-grekas
Copy link
Member

Shouldn't we revert#25366 instead? This breaks a behavior that was accepted. Maybe only keep the early collection, but when a listener takes over handling, I see no reason to not let it decide what to do with the exception, don't you think? Especially given the comments on#27440.
I understand the original motivation, but I feel like we should look for something else.
WDYT?

@ro0NL
Copy link
ContributorAuthor

status: needs work

@ro0NL
Copy link
ContributorAuthor

closing in favor of#27562

@ro0NLro0NL closed thisJun 9, 2018
@ro0NLro0NL deleted the http-kernel/exceptionn-logging branchJune 9, 2018 07:52
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

4 participants

@ro0NL@stof@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp