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

[SecurityBundle] fixed DebugAccessDecisionManager config#18566

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
HeahDude wants to merge3 commits intosymfony:masterfromHeahDude:fix/debug-adm

Conversation

@HeahDude
Copy link
Contributor

QA
Branch?master
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#18554
LicenseMIT
Doc PR~

@linaori
Copy link
Contributor

This is not the way you're supposed to define the decorator. In fact, I would expect this to inject itself and cause a recursive dependency. Maybe there's another bug at hand causing this or is this intended behavior?

@HeahDude
Copy link
ContributorAuthor

@iltar, I'm not an expert of the DI component but this seems logical if we consider that the decoration is also "hardcoded", seehere andhere.

If I understand correctly, if the container handles the debug adm as a decorator it is automatically injected and those lines should not be needed, am I missing something ?

This is also how the decorated choice list factories are defined (without using thedecorates parameter).

@gharlan
Copy link
Contributor

@HeahDude thanks for working on this.

I can confirm that it fixes the issue. (But I don't know if it is the "correct" way to fix it.)

@ghost
Copy link

This fix works fine here. Please merge it. 👍

@stof
Copy link
Member

The fix does not work fine. It simply means that the debug service will never be used, as it does not replace the original service with the decorated version, making it useless.

so this PR does not fix a bug. It breaks the feature entirely.

@HeahDude
Copy link
ContributorAuthor

@stof please see the links of my comment above. This fix does not break the feature as tested with the fork linked in#18554.

@stof
Copy link
Member

@HeahDude but do you still get the votes in the profiler ? This is what the debug decorator is about.

@HeahDude
Copy link
ContributorAuthor

Yes it works perfectly fine :)

@HeahDude
Copy link
ContributorAuthor

Can anyone else (re-)confirm? ping @JHGitty@gharlan

@gharlan
Copy link
Contributor

Yes I can confirm it. It fixes the bug, and the new access decision log in profiler is still there.

@HeahDude
Copy link
ContributorAuthor

Thank you@gharlan

@xabbuh
Copy link
Member

@stof This works for the core as the injected access decision manager is changed manually in the extension class:https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L100-L105

However, this will not work if someone injected the default access decision manager somewhere else as those places would now not use the decorated one anymore.

@linaori
Copy link
Contributor

One solution could be the following delegator class in dev:

@Internalfinalclass VoterProxyimplements VoterInterface{private$voterId;private$container;publicfunction__construct($voterId,ContainerInterface$container)    {$this->voterId =$voterId;$this->container =$container;    }publicfunctionvote(TokenInterface$token,$subject,array$attributes)    {return$this->container->get($this->voterId)->vote($token,$subject,$attributes);    }}

Imo this is the only "clean" solution will will keep working in the future, possible even in prod (though you might want to cache the container get call then)

@HeahDude
Copy link
ContributorAuthor

HeahDude commentedApr 24, 2016
edited
Loading

Ok I've reverted the first fix ina6fce2d and pushed8e4f98b to fix it while keeping the debug adm injected properly, considering the good point of@xabbuh.

I've tested it was passed to theSecurityDataCollector when removingdebug from its argument name inSecurityBundle/Resources/config/collectors.xml using the fork provided in#18554.

If some one could test it again, we should be good now :)

@HeahDude
Copy link
ContributorAuthor

Actually, the test with the collector is extra safety, since the feature works without overridingsecurity.authorization_checker argument in the config thanks to the last fix.

@HeahDude
Copy link
ContributorAuthor

There was a major update on this PR wich actually fixes a BC break on 3.1. Anyone for a review?

ping@gharlan @JHGitty@iltar Could you please (re-)confirm it works for you?

Thanks.

@HeahDude
Copy link
ContributorAuthor

HeahDude commentedApr 25, 2016
edited
Loading

Isn't the "critical" label needed when a BC break prevents the application from running?

@gharlan
Copy link
Contributor

ping@gharlan @JHGitty@iltar Could you please (re-)confirm it works for you?

It works!

@HeahDude
Copy link
ContributorAuthor

Thank you@gharlan, again :)

Simperfit reacted with thumbs up emoji

@fabpot
Copy link
Member

Thank you@HeahDude.

@fabpotfabpot closed thisApr 28, 2016
fabpot added a commit that referenced this pull requestApr 28, 2016
…HeahDude)This PR was squashed before being merged into the 3.1-dev branch (closes#18566).Discussion----------[SecurityBundle] fixed DebugAccessDecisionManager config| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#18554| License       | MIT| Doc PR        | ~Commits-------53c78fe [SecurityBundle] fixed DebugAccessDecisionManager config
@HeahDudeHeahDude deleted the fix/debug-adm branchApril 28, 2016 10:38
@fabpotfabpot mentioned this pull requestMay 13, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

8 participants

@HeahDude@linaori@gharlan@stof@xabbuh@fabpot@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp