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

[FrameworkBundle][Workflow] better errors when security deps are missing#23638

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
lyrixx merged 1 commit intosymfony:3.3fromxabbuh:guard-listener-security-deps
Aug 4, 2017

Conversation

@xabbuh
Copy link
Member

QA
Branch?3.3
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#23499 (comment)
LicenseMIT
Doc PR

All the referenced services must either be explicitly configured or the SecurityBundle must be installed with some security related config being enabled. Otherwise, you will end up with a not so useful error message.

@xabbuhxabbuh added this to the3.3 milestoneJul 24, 2017
@xabbuhxabbuh changed the titlebetter errors when security deps are missing[FrameworkBundle][Workflow] better errors when security deps are missingJul 24, 2017
/**
* @author Christian Flothmann <christian.flothmann@sensiolabs.de>
*/
class GuardListenerPass implements CompilerPassInterface
Copy link
Member

Choose a reason for hiding this comment

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

The name should probably containWorkflow as this is really just the for workflow configuration.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

renamed toWorkflowGuardListenerPass

@xabbuhxabbuhforce-pushed theguard-listener-security-deps branch from9bb2c28 tof54c374CompareJuly 24, 2017 07:42

public function testListenersAreNotRemovedIfAllDependenciesArePresent()
{
$this->container->setParameter('workflow.guard_listeners', ['foo.listener.guard', 'bar.listener.guard']);
Copy link
Member

Choose a reason for hiding this comment

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

should use long array syntax

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

thx

@xabbuhxabbuhforce-pushed theguard-listener-security-deps branch fromf54c374 to8ec0db2CompareJuly 25, 2017 13:09
*/
public function process(ContainerBuilder $container)
{
if (!$container->hasParameter('workflow.guard_listeners')) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't see the place setting this parameter in FrameworkBundle. Are you sure your code works fine ?

chalasr reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

good catch, fixed

@xabbuhxabbuhforce-pushed theguard-listener-security-deps branch from8ec0db2 to3b884b0CompareAugust 1, 2017 13:49
Copy link
Member

@lyrixxlyrixx left a comment

Choose a reason for hiding this comment

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

👍 except one little change.

return;
}

if (!$container->has('security.token_storage')) {
Copy link
Member

Choose a reason for hiding this comment

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

Could you remove the parameterworkflow.has_guard_listeners? It's not need at runtime.
(I added the comment here because I guess you will do it a this line ;) )

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

fixed :)

* file that was distributed with this source code.
*/

namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler;
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure it's need but now we add all Compiler pass in the associated component.
It's a forgetfulness or it's done on purpose? (I dont this it's necessary here but ...)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

IMO this is completely specifc to the FrameworkBundle. If you want to register the listener in the container in your own application, you will probably have better ways to check if all needed dependencies are present.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@xabbuhxabbuhforce-pushed theguard-listener-security-deps branch from3b884b0 to56ee4aaCompareAugust 4, 2017 07:27
@lyrixx
Copy link
Member

👍

@lyrixx
Copy link
Member

Thank you@xabbuh.

@lyrixxlyrixx merged commit56ee4aa intosymfony:3.3Aug 4, 2017
lyrixx added a commit that referenced this pull requestAug 4, 2017
…ps are missing (xabbuh)This PR was merged into the 3.3 branch.Discussion----------[FrameworkBundle][Workflow] better errors when security deps are missing| Q             | A| ------------- | ---| Branch?       | 3.3| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#23499 (comment)| License       | MIT| Doc PR        |All the referenced services must either be explicitly configured or the SecurityBundle must be installed with some security related config being enabled. Otherwise, you will end up with a not so useful error message.Commits-------56ee4aa better errors when security deps are missing
@xabbuhxabbuh deleted the guard-listener-security-deps branchAugust 4, 2017 08:11
@fabpotfabpot mentioned this pull requestAug 28, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@lyrixxlyrixxlyrixx approved these changes

@chalasrchalasrchalasr left review comments

@stofstofstof requested changes

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

6 participants

@xabbuh@lyrixx@fabpot@stof@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp