-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Environment Variable Processors not working in security.yml #37836
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
Comments
i believe this is the same issue as #27683 see also #27683 (comment) - the docs are wrong. |
I have the same issue in Symfony 5.1 secyrity.yml
but it does not work |
@x1a why do you think your issue is related to the original description? "it does not work" could have thousands or different reasons... |
Closing as duplicate of #27683 |
@nicolas-grekas because it is also related to using environment variables in security.yaml I tried such two simple cases (on fresh installed Symfony 5.1)
and
for first case it works as expected (security is turned off), for second case it does not This test is passed for both cases
It looks weird for me though may be I don't understand smth |
Symfony version(s) affected: 4.4
Description
https://symfony.com/doc/current/configuration/env_var_processors.html says that there are json and csv processors which can be used for environment variables like
%env(csv:TRUSTED_HOSTS)%
withenv(TRUSTED_HOSTS): "10.0.0.1, 10.0.0.2"
However using this for IP-protection in security.yml like https://symfony.com/doc/current/security/access_control.html#matching-access-control-by-ip fails with
Invalid type for path "security.access_control.2.ips.0". Expected one of "bool", "int", "float", "string", but got "array".
How to reproduce
Execute
bin/console cache:clear
The same is happening when using json-processor with
%env(csv:TRUSTED_HOSTS)%
and'TRUSTED_HOSTS' => '["10.0.0.1", "10.0.0.2"]',
Additional context
Failure message:
The text was updated successfully, but these errors were encountered: