-
-
Notifications
You must be signed in to change notification settings - Fork 614
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
"token_ttl" must be a numeric value, but that's not compatible with Sf 3.2+ %env(FOO)%
mechanism
#323
Comments
Hi @drbenton, You should have a look at the is_numeric('42') // true So using environment variables for the ttl is actually fine regarding config validation. I will take care of fixing this very quickly. Thank you for pointing it out. |
Hi @chalasr Indeed, this is how Thank you very much for taking care of it! Olivier |
@drbenton I'm not sure to get what you mean. Why wouldn't the env var be a numeric value? Could you please give an example of the value that could reach this statement in your case? |
When using |
Yeah, because at build time we receive a "dynamic parameter placeholder" rather than a real value. As you can see on my XDebug session screenshot, even if I do have a So the setup is correct. The obstacle here is:
The only solution I could see would be to remove that "is numeric" check in the semantic configuration, and maybe add such a check in a PHP class when it receives the TTL to counterbalance that removed check? |
Ok got it! My reproducer was wrongly configured, sorry about the confusion. Instead of totally removing it, I would move it at runtime. There are two places relying on the TTL which are Would you mind to work on this? |
Hey @chalasr , Yeah, this is what I wanted to do: move the check from container build time to app runtime. I can take charge of this! |
Hi,
As we now have this shiny
%env(FOO)%
mechanism in Symfony configuration for a few months, and as it looks like it will be omnipresent in Symfony 4, it would be nice to be able to use it with this (wonderful) Bundle, wouldn't it?But if I'm not wrong, it's not possible at the moment, because of this check in the Bundle's semantic configuration.
From what I understood from that Symfony PR, these
%env(FOO)%
placeholders are actually replaced with placeholders (which are strings) at container compilation time, and will be replaced with the matching environment variables values at runtime.Because of this, with the following config:
...I get the following at container build time:
Hence the validation fail.
Maybe it would be worth removing that
is_numeric()
check, so that we could actually configure our tokens TTL via environment variables?If you're ok with that, I should be able to submit a PR soon.
Thanks!
The text was updated successfully, but these errors were encountered: