
driven-adapter.secrets.secrets-config.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scaffold-clean-architecture Show documentation
Show all versions of scaffold-clean-architecture Show documentation
Gradle plugin to create a clean application in Java that already works, It follows our best practices!
package {{package}}.config;
import co.com.bancolombia.secretsmanager.api.GenericManager;
import co.com.bancolombia.secretsmanager.connector.AWSSecretManagerConnector;
import co.com.bancolombia.secretsmanager.api.exceptions.SecretException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SecretsConfig {
{{^include-secret}}
@Bean
public Object getSecret(@Value("${aws.secretName}") String secretName, GenericManager connector) throws SecretException {
return connector.getSecret(secretName, Object.class); // TODO Change the Object class for Secret model
}
{{/include-secret}}
@Bean
public GenericManager getSecretManager(@Value("${aws.region}") String region) {
return new AWSSecretManagerConnector(region);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy