Como consigo substituir o valor do @ConditionalOnExpression
pelo valor passado na annotation SecurityConfig
?
Código atual:
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@EnableWebSecurity
@Configuration
@ConditionalOnExpression("'${auth.provedor:NULL}'.equals('DEV-JWT')")
@EnableGlobalMethodSecurity(
prePostEnabled = true,
securedEnabled = true,
jsr250Enabled = true)
public @interface SecurityConfig {
String value();
}
Exemplo de código desejado (porém não funciona):
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@EnableWebSecurity
@Configuration
@ConditionalOnExpression(SecurityConfig.class.getValue())
@EnableGlobalMethodSecurity(
prePostEnabled = true,
securedEnabled = true,
jsr250Enabled = true)
public @interface SecurityConfig {
String value();
}