0
How can I replace the value of @ConditionalOnExpression
by the value passed in the SecurityConfig
?
Current code:
@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();
}
Code example desired (but not working):
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@EnableWebSecurity
@Configuration
@ConditionalOnExpression(SecurityConfig.class.getValue())
@EnableGlobalMethodSecurity(
prePostEnabled = true,
securedEnabled = true,
jsr250Enabled = true)
public @interface SecurityConfig {
String value();
}