Class Vaults


  • public final class Vaults
    extends Object
    Provides static methods for working with Vault.
    • Method Detail

      • pull

        public static void pull​(List<Server> servers,
                                Properties properties)
                         throws com.bettercloud.vault.VaultException
        Pulls secrets from one or more Vault servers and paths and updates a Properties instance with the values.
        Parameters:
        servers - the servers
        properties - the properties
        Throws:
        com.bettercloud.vault.VaultException - if an exception is throw pulling the secrets
      • push

        public static void push​(List<Server> servers,
                                Properties properties)
                         throws com.bettercloud.vault.VaultException
        Pushes secrets to one or more Vault servers and paths from a Properties instance.
        Parameters:
        servers - the servers
        properties - the properties
        Throws:
        com.bettercloud.vault.VaultException - if an exception is throw pushing the secrets
      • authenticateIfNecessary

        public static void authenticateIfNecessary​(List<Server> servers,
                                                   AuthenticationMethodProvider factory)
                                            throws com.bettercloud.vault.VaultException
        Authenticate to one or more Vault servers and paths from a Properties instance.
        Parameters:
        servers - the servers
        Throws:
        com.bettercloud.vault.VaultException - if an exception is throw authenticating
      • vaultConfig

        public static com.bettercloud.vault.VaultConfig vaultConfig​(String server,
                                                                    String token,
                                                                    String namespace,
                                                                    boolean sslVerify,
                                                                    File sslCertificate,
                                                                    Integer engineVersion)
                                                             throws com.bettercloud.vault.VaultException
        Returns a configured instance of the VaultConfig class.
        Parameters:
        server - the server
        token - the token
        namespace - the namespace
        sslVerify - true if the connection should be verified; otherwise, false
        sslCertificate - the certificate file or null if not needed
        Returns:
        the vaultConfig
        Throws:
        com.bettercloud.vault.VaultException