com.sap.cloud.security.ams.spring.autoconfig.PolicyDecisionPointAutoConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-ams Show documentation
Show all versions of spring-ams Show documentation
Client Library for integrating Spring applications with SAP Authorization Management Service (AMS)
The newest version!
/************************************************************************
* © 2019-2023 SAP SE or an SAP affiliate company. All rights reserved. *
************************************************************************/
package com.sap.cloud.security.ams.spring.autoconfig;
import com.sap.cloud.security.ams.dcl.client.pdp.PolicyDecisionPoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
import java.util.List;
import static com.sap.cloud.security.ams.dcl.client.pdp.PolicyDecisionPoint.Parameters.FAIL_ON_STARTUP_HEALTH_CHECK;
import static com.sap.cloud.security.ams.dcl.client.pdp.PolicyDecisionPoint.Parameters.STARTUP_HEALTH_CHECK_TIMEOUT;
import static com.sap.cloud.security.ams.factory.AmsPolicyDecisionPointFactory.DEFAULT;
@Configuration
@ConditionalOnProperty(name = "com.sap.cloud.security.ams.auto", havingValue = "true", matchIfMissing = true)
public class PolicyDecisionPointAutoConfiguration {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Value("${com.sap.dcl.client.startupHealthCheckTimeout:#{null}}")
private Long startupCheckTimeout;
@Value("${com.sap.dcl.client.failOnStartupCheck:#{null}}")
private Boolean failOnStartup;
@Bean
@ConditionalOnMissingBean(PolicyDecisionPoint.class)
public PolicyDecisionPoint policyDecisionPoint() {
logger.debug("auto-configures PolicyDecisionPoint.");
return PolicyDecisionPoint.create(DEFAULT, processPdpArgs());
}
private Object[] processPdpArgs() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy