Class Vaults
- java.lang.Object
-
- com.homeofthewizard.maven.plugins.vault.Vaults
-
public final class Vaults extends Object
Provides static methods for working with Vault.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
authenticateIfNecessary(List<Server> servers, AuthenticationMethodProvider factory)
Authenticate to one or more Vault servers and paths from aProperties
instance.static void
pull(List<Server> servers, Properties properties)
Pulls secrets from one or more Vault servers and paths and updates aProperties
instance with the values.static void
push(List<Server> servers, Properties properties)
Pushes secrets to one or more Vault servers and paths from aProperties
instance.static com.bettercloud.vault.VaultConfig
vaultConfig(String server, String token, String namespace, boolean sslVerify, File sslCertificate, Integer engineVersion)
Returns a configured instance of theVaultConfig
class.
-
-
-
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 aProperties
instance with the values.- Parameters:
servers
- the serversproperties
- 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 aProperties
instance.- Parameters:
servers
- the serversproperties
- 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 aProperties
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 theVaultConfig
class.- Parameters:
server
- the servertoken
- the tokennamespace
- the namespacesslVerify
-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
-
-