All Downloads are FREE. Search and download functionalities are using the official Maven repository.

driven-adapter.secrets-vault-reactive.secrets-config.mustache Maven / Gradle / Ivy

Go to download

Gradle plugin to create a clean application in Java that already works, It follows our best practices!

There is a newer version: 3.20.10
Show newest version
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