Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[SecurityBundle] something is broken after recent commits #21809

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

Closed
antanas-arvasevicius opened this issue Mar 1, 2017 · 10 comments
Closed

[SecurityBundle] something is broken after recent commits #21809

antanas-arvasevicius opened this issue Mar 1, 2017 · 10 comments

Comments

@antanas-arvasevicius
Copy link
Contributor

antanas-arvasevicius commented Mar 1, 2017

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3.0-dev

Today we've got build error in our system:
Restored to last worked version on 'd69bb304001e57e00678b86e8e499067889db538'
Hope this info will help to spot a problem.

[04:39:32][Ant output]      [exec]      [exec] > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
[04:39:32][Ant output]      [exec]      [exec] 
[04:39:32][Ant output]      [exec]      [exec] 
[04:39:32][Ant output]      [exec]      [exec]   [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
[04:39:32][Ant output]      [exec]      [exec]   The service "security.authentication.provider.simple_form.default" has a de
[04:39:32][Ant output]      [exec]      [exec]   pendency on a non-existent service "security.user.provider.concrete.carrier
[04:39:32][Ant output]      [exec]      [exec]   User".

Our security.yml:

security:
    providers:
        carrierUser:
            entity:
                class: System\Entity\CarrierUser
                property: email

    erase_credentials: false
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

        default:
            anonymous: ~
            provider: carrierUser
            simple-form:
                check_path: /login_check
                require_previous_session: false
                authenticator: tms.security.authentication.provider
                failure_handler: auth.failure_handler
                failure_forward: true
                failure_path: false

    encoders:
        System\Entity\CarrierUser: bcrypt
@antanas-arvasevicius
Copy link
Contributor Author

Little findings: on working version there line in container build logs:
Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.user.provider.concrete.carrieruser" to "security.firewall.map.context.default".

but in not working version there is line

``Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass: Inlined service "security.user.provider.concrete.carrierUser" to "security.firewall.map.context.default".```

Previous version automatically lowercased every provider name, but new version looks like not converting to lower cases. Maybe this is a case.

@xabbuh
Copy link
Member

xabbuh commented Mar 1, 2017

Which commit exactly did you use when experiencing this issue?

@antanas-arvasevicius
Copy link
Contributor Author

today latest i think, just checked out from teamcity work dir:
here is: 28a00da

@antanas-arvasevicius
Copy link
Contributor Author

But I don't know exactly which commit fails.

@xabbuh
Copy link
Member

xabbuh commented Mar 1, 2017

Can you check if the issue still persists when you only use lowercase letters for the user provider name?

@xabbuh xabbuh added this to the 3.3 milestone Mar 1, 2017
@mvrhov
Copy link

mvrhov commented Mar 1, 2017

If only the case sensitivity is the problem AFAIR this was done on purpose. And it should be in Changelog/Upgrade document.

@antanas-arvasevicius
Copy link
Contributor Author

Yes, works then lowercasered. If it's by purpose then should throw exception about saying what is wrong exactly during configuration validation I think.
I'll probably tracked which commit broken this and will write details soon

@antanas-arvasevicius
Copy link
Contributor Author

found a problem, it was during inconsistent getUserProviderId() usage, sometimes it was called like:
getUserProviderId(strtolower($name)); sometimes like getUserProviderId($name);

Fixed by putting strtolower() inside getUserProviderId

fbd9f88#diff-2be909961a57bf75fbb600c1f5fc46e3R320

@xabbuh
Copy link
Member

xabbuh commented Mar 1, 2017

@antanas-arvasevicius That commit was reverted later on. That's why I wonder if you still experience the issue when using the latest master branch.

@xabbuh
Copy link
Member

xabbuh commented Mar 1, 2017

Never mind, I see that f6637dd wasn't merged up to master yet.

antanas-arvasevicius pushed a commit to antanas-arvasevicius/symfony that referenced this issue Mar 1, 2017
…ntains upper cases then container didn't compile
antanas-arvasevicius pushed a commit to antanas-arvasevicius/symfony that referenced this issue Mar 1, 2017
…ntains upper cases then container didn't compile
fabpot added a commit that referenced this issue Mar 1, 2017
… (xabbuh)

This PR was merged into the 3.3-dev branch.

Discussion
----------

Revert "[SecurityBundle] only pass relevant user provider"

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21809, #21810
| License       | MIT
| Doc PR        |

This reverts commit d97e07f (applies #21798 on `master`). There is no merge commit that could be reverted.

Commits
-------

5b016ce Revert "[SecurityBundle] only pass relevant user provider"
@fabpot fabpot closed this as completed Mar 1, 2017
fabpot pushed a commit that referenced this issue Mar 23, 2017
fabpot added a commit that referenced this issue Mar 23, 2017
…e contains upper cases then container didn't compile (Antanas Arvasevicius)

This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #21810).

Discussion
----------

#21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? no
| Tests pass?   | yes
| Fixed tickets | #21809
| License       | MIT

then security.yml  providers was with upper case, on container compile error was thrown:
````
[04:39:32][Ant output]      [exec]      [exec] > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
[04:39:32][Ant output]      [exec]      [exec]
[04:39:32][Ant output]      [exec]      [exec]
[04:39:32][Ant output]      [exec]      [exec]   [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
[04:39:32][Ant output]      [exec]      [exec]   The service "security.authentication.provider.simple_form.default" has a de
[04:39:32][Ant output]      [exec]      [exec]   pendency on a non-existent service "security.user.provider.concrete.carrier
[04:39:32][Ant output]      [exec]      [exec]   User".

`````

Problem has occurred with this commit line:
fbd9f88#diff-2be909961a57bf75fbb600c1f5fc46e3R320

Issue fixes with this PR.

Commits
-------

6d23c8c #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
fabpot added a commit that referenced this issue Mar 23, 2017
* 2.7:
  removed test that does not test anything
  fixed tests
  #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
  [Validator] fix URL validator to detect non supported chars according to RFC 3986
  [Security] Fixed roles serialization on token from user object
fabpot added a commit that referenced this issue Mar 23, 2017
* 2.8:
  removed test that does not test anything
  fixed tests
  #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
  [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page
  Set Date header in Response constructor already
  [Validator] fix URL validator to detect non supported chars according to RFC 3986
  [Security] Fixed roles serialization on token from user object
fabpot added a commit that referenced this issue Mar 26, 2017
* 3.2:
  [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite
  [WebProfilerBundle] Include badge status in translation tabs
  [FrameworkBundle] Cache pool clear command requires at least 1 pool
  [HttpFoundation][bugfix]  should always be initialized
  MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work
  normalize paths before making them relative
  removed test that does not test anything
  fixed tests
  #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
  [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page
  Set Date header in Response constructor already
  [Validator] fix URL validator to detect non supported chars according to RFC 3986
  [Security] Fixed roles serialization on token from user object
This was referenced Apr 4, 2017
ostrolucky pushed a commit to ostrolucky/symfony that referenced this issue Mar 25, 2018
* 2.8:
  removed test that does not test anything
  fixed tests
  symfony#21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
  [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page
  Set Date header in Response constructor already
  [Validator] fix URL validator to detect non supported chars according to RFC 3986
  [Security] Fixed roles serialization on token from user object
ostrolucky pushed a commit to ostrolucky/symfony that referenced this issue Mar 25, 2018
* 3.2:
  [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite
  [WebProfilerBundle] Include badge status in translation tabs
  [FrameworkBundle] Cache pool clear command requires at least 1 pool
  [HttpFoundation][bugfix]  should always be initialized
  MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work
  normalize paths before making them relative
  removed test that does not test anything
  fixed tests
  symfony#21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
  [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page
  Set Date header in Response constructor already
  [Validator] fix URL validator to detect non supported chars according to RFC 3986
  [Security] Fixed roles serialization on token from user object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants