Conditional for autoconfig

This commit is contained in:
Timo Bejan 2023-05-30 13:38:23 +03:00
parent 302907012f
commit 1683f9521c
2 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package com.knecon.fforesight.keycloakcommons;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
@ -8,6 +9,7 @@ import com.knecon.fforesight.keycloakcommons.security.properties.CommonsKeyCloak
@ComponentScan
@AutoConfiguration
@ConditionalOnProperty(prefix = "fforesight.keycloak", value = "enabled", havingValue = "true")
@EnableConfigurationProperties(CommonsKeyCloakProperties.class)
public class DefaultKeyCloakCommonsAutoConfiguration {

View File

@ -12,5 +12,6 @@ import lombok.Data;
public class CommonsKeyCloakProperties {
private List<String> ignoredEndpoints = new ArrayList<>();
private boolean enabled;
}