hslavich / OneloginSamlBundle

OneLogin SAML Bundle for Symfony
MIT License
149 stars 94 forks source link

Resolving of parameters values in SecurityCompilerPass #185

Closed azatkama closed 2 years ago

azatkama commented 2 years ago

Hello! Could you add please resolving of parameters values here DependencyInjection/Compiler/SecurityCompilerPass.php:16 something like this $configs = $container->getParameterBag()->resolveValue($configs); because it is not possible to set strict parameter from variable like this

hslavich_onelogin_saml:
  strict: '%saml.strict%'

I have added PR https://github.com/hslavich/OneloginSamlBundle/pull/186

a-menshchikov commented 2 years ago

@azatkama hello. Could you explain me more details about this issue. Why you need to resolve parameters exactly in SecurityCompilerPass?

azatkama commented 2 years ago

because if we add parameter like variable strict: '%saml.strict%' here DependencyInjection/Compiler/SecurityCompilerPass.php:16 $configs = $container->getExtensionConfig('hslavich_onelogin_saml'); we receive something like this $configs = [0 => ['strict' => '%saml.strict%']] but we need resolved values like this $configs = [0 => ['strict' => true]]

now we have exception about wrong type of parameter because this parameter has bool type ->booleanNode('strict')->end()

azatkama commented 2 years ago

@a-menshchikov is it clear? in extension in method HslavichOneloginSamlExtension::load we have already resloved array $configs it resolves here Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:62

a-menshchikov commented 2 years ago

@azatkama yes, it's clear.