
driven-adapter.secrets-vault-reactive.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.GenericManagerAsync;
import co.com.bancolombia.secretsmanager.api.exceptions.SecretException;
import co.com.bancolombia.secretsmanager.connector.VaultSecretManagerConfigurator;
import co.com.bancolombia.secretsmanager.vault.config.VaultSecretsManagerProperties;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SecretsConfig {
@Bean
public GenericManagerAsync getSecretManager(@Value("${vault.host:localhost}") String host,
@Value("${vault.port:8200}") int port) throws SecretException {
VaultSecretManagerConfigurator configurator = VaultSecretManagerConfigurator.builder()
.withProperties(VaultSecretsManagerProperties.builder()
.host(host)
.port(port)
.ssl(false)
//.roleId("")
//.secretId("my secret id for auth with vault>")
.token("") // or if you already have a token
.build()
)
.build();
return configurator.getVaultClient();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy