Skip to content

Commit

Permalink
feature #21718 [SecurityBundle] Don't normalize username of in-memory…
Browse files Browse the repository at this point in the history
… users (chalasr)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[SecurityBundle] Don't normalize username of in-memory users

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

It's common to have e.g. emails as keys in `security.providers.in_memory.users` since keys are username. Actually they are normalized so `foo-bar@gmail.com` becomes `foo_bar@gmail.com` and authentication fails unexpectedly.

Commits
-------

8d03332 [SecurityBundle] Don't normalize keys of in-memory users
  • Loading branch information
fabpot committed Feb 22, 2017
2 parents 99f60dc + 8d03332 commit d69bb30
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions UPGRADE-3.3.md
Expand Up @@ -113,6 +113,8 @@ SecurityBundle
* `UserPasswordEncoderCommand::getContainer()` is deprecated, and this class won't
extend `ContainerAwareCommand` nor implement `ContainerAwareInterface` anymore in 4.0.

* [BC BREAK] Keys of the `users` node for `in_memory` user provider are no longer normalized.

Serializer
----------

Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Bundle/SecurityBundle/CHANGELOG.md
Expand Up @@ -9,6 +9,7 @@ CHANGELOG
* Deprecated `UserPasswordEncoderCommand::getContainer()` and relying on the
`ContainerAwareInterface` interface for this command.
* Deprecated the `FirewallMap::$map` and `$container` properties.
* [BC BREAK] Keys of the `users` node for `in_memory` user provider are no longer normalized.

3.2.0
-----
Expand Down
Expand Up @@ -52,6 +52,7 @@ public function addConfiguration(NodeDefinition $node)
->children()
->arrayNode('users')
->useAttributeAsKey('name')
->normalizeKeys(false)
->prototype('array')
->children()
->scalarNode('password')->defaultValue(uniqid('', true))->end()
Expand Down

0 comments on commit d69bb30

Please sign in to comment.