Skip to content

Commit

Permalink
bug #36483 [SecurityBundle] fix accepting env vars in remember-me con…
Browse files Browse the repository at this point in the history
…figurations (zek)

This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] fix accepting env vars in remember-me configurations

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36271
| License       | MIT
| Doc PR        | -

As @wouterj explained we cannot use env variables after #35910 merged.

> Hmm, so I'm guessing this is what happens:
>
> * `lifetime` is now an `integerNode()`
> * For the Config component (which IIRC doesn't know anything about env variables), you're passing a string: `"%env(int:REMEMBER_ME_COOKIE_LIFETIME)%"`
> * This throws an error, although if it wouldn't, the DI component would sucessfully process the string into a integer before it's used by any PHP class.
>
> So we either make Config aware of environment variables (that's probably a huge feature) or we revert the `integerNode()` changes (as you suggested).
>
> @HeahDude am I mislooking something, or would reverting these 2 lines not result in much harm? (only a little less strict config processor)

Commits
-------

46c2783 [SecurityBundle] fix accepting env vars in remember-me configurations
  • Loading branch information
nicolas-grekas committed Apr 18, 2020
2 parents 0f1a5c4 + 46c2783 commit a347a84
Showing 1 changed file with 0 additions and 2 deletions.
Expand Up @@ -146,8 +146,6 @@ public function addConfiguration(NodeDefinition $node)
foreach ($this->options as $name => $value) {
if (\is_bool($value)) {
$builder->booleanNode($name)->defaultValue($value);
} elseif (\is_int($value)) {
$builder->integerNode($name)->defaultValue($value);
} else {
$builder->scalarNode($name)->defaultValue($value);
}
Expand Down

0 comments on commit a347a84

Please sign in to comment.