public interface VaultConnector
Modifier and Type | Method and Description |
---|---|
AuthResponse |
authAppId(String appID,
String userID)
Deprecated.
As of Vault 0.6.1 App-ID is superseded by AppRole. Consider using
authAppRole(java.lang.String) instead. |
default AuthResponse |
authAppRole(String roleID)
Authorize to Vault using AppRole method without secret ID.
|
AuthResponse |
authAppRole(String roleID,
String secretID)
Authorize to Vault using AppRole method.
|
TokenResponse |
authToken(String token)
Authorize to Vault using token.
|
AuthResponse |
authUserPass(String username,
String password)
Authorize to Vault using username and password.
|
boolean |
createAppRole(AppRole role)
Register a new AppRole role from given metamodel.
|
default boolean |
createAppRole(String roleName)
Register new AppRole role with default policy.
|
default boolean |
createAppRole(String roleName,
List<String> policies)
Register new AppRole role with policies.
|
default boolean |
createAppRole(String roleName,
List<String> policies,
String roleID)
Register new AppRole role with policies and custom ID.
|
default boolean |
createAppRole(String roleName,
String roleID)
Register new AppRole role with default policy and custom ID.
|
default AppRoleSecretResponse |
createAppRoleSecret(String roleName)
Register new random generated AppRole secret.
|
AppRoleSecretResponse |
createAppRoleSecret(String roleName,
AppRoleSecret secret)
Register new AppRole secret with custom ID.
|
default AppRoleSecretResponse |
createAppRoleSecret(String roleName,
String secretID)
Register new AppRole secret with custom ID.
|
AuthResponse |
createToken(Token token)
Create a new token.
|
AuthResponse |
createToken(Token token,
boolean orphan)
Create a new token.
|
AuthResponse |
createToken(Token token,
String role)
Create a new token for specific role.
|
boolean |
deleteAppRole(String roleName)
Delete AppRole role from Vault.
|
boolean |
deleteSecret(String key)
Delete secret from Vault.
|
boolean |
destroyAppRoleSecret(String roleName,
String secretID)
Destroy an AppRole secret.
|
String |
getAppRoleID(String roleName)
Retrieve ID for an AppRole role.
|
List<AuthBackend> |
getAuthBackends()
Get all availale authentication backends.
|
boolean |
init()
Verify that vault connection is initialized.
|
boolean |
isAuthorized()
Get authorization status
|
List<String> |
listAppRoles()
List existing (accessible) AppRole roles.
|
List<String> |
listAppRoleSecretss(String roleName)
List existing (accessible) secret IDs for AppRole role.
|
List<String> |
listSecrets(String path)
List available secrets from Vault.
|
AppRoleResponse |
lookupAppRole(String roleName)
Lookup an AppRole role.
|
AppRoleSecretResponse |
lookupAppRoleSecret(String roleName,
String secretID)
Lookup an AppRole secret.
|
TokenResponse |
lookupToken(String token)
Lookup token information.
|
SecretResponse |
readSecret(String key)
Retrieve secret form Vault.
|
boolean |
registerAppId(String appID,
String policy,
String displayName)
Deprecated.
As of Vault 0.6.1 App-ID is superseded by AppRole. Consider using
createAppRole(de.stklcode.jvault.connector.model.AppRole) instead. |
default boolean |
registerAppUserId(String appID,
String policy,
String displayName,
String userID)
Deprecated.
As of Vault 0.6.1 App-ID is superseded by AppRole.
|
boolean |
registerUserId(String appID,
String userID)
Deprecated.
As of Vault 0.6.1 App-ID is superseded by AppRole. Consider using
createAppRoleSecret(java.lang.String) instead. |
default SecretResponse |
renew(String leaseID)
Renew lease with given ID.
|
SecretResponse |
renew(String leaseID,
Integer increment)
Renew lease with given ID.
|
void |
resetAuth()
Reset authorization information.
|
boolean |
revoke(String leaseID)
Revoke given lease immediately.
|
boolean |
seal()
Seal vault.
|
SealResponse |
sealStatus()
Retrieve status of vault seal.
|
boolean |
setAppRoleID(String roleName,
String roleID)
Set custom ID for an AppRole role.
|
default SealResponse |
unseal(String key)
Unseal vault.
|
SealResponse |
unseal(String key,
Boolean reset)
Unseal vault.
|
boolean |
writeSecret(String key,
String value)
Write secret to Vault.
|
boolean init()
void resetAuth()
SealResponse sealStatus()
boolean seal()
SealResponse unseal(String key, Boolean reset)
key
- A single master share keyreset
- Discard previously provided keys (optional)default SealResponse unseal(String key)
key
- A single master share keyList<AuthBackend> getAuthBackends() throws VaultConnectorException
VaultConnectorException
- on errorTokenResponse authToken(String token) throws VaultConnectorException
token
- The tokenVaultConnectorException
- on errorAuthResponse authUserPass(String username, String password) throws VaultConnectorException
username
- The usernamepassword
- The passwordVaultConnectorException
- on error@Deprecated AuthResponse authAppId(String appID, String userID) throws VaultConnectorException
authAppRole(java.lang.String)
instead.appID
- The App IDuserID
- The User IDVaultConnectorException
- on errordefault AuthResponse authAppRole(String roleID) throws VaultConnectorException
roleID
- The role IDVaultConnectorException
- on errorAuthResponse authAppRole(String roleID, String secretID) throws VaultConnectorException
roleID
- The role IDsecretID
- The secret IDVaultConnectorException
- on error@Deprecated boolean registerAppId(String appID, String policy, String displayName) throws VaultConnectorException
createAppRole(de.stklcode.jvault.connector.model.AppRole)
instead.appID
- The unique App-IDpolicy
- The policy to associate withdisplayName
- Arbitrary name to displayVaultConnectorException
- on errorboolean createAppRole(AppRole role) throws VaultConnectorException
role
- The roleVaultConnectorException
- on errordefault boolean createAppRole(String roleName) throws VaultConnectorException
roleName
- The role nameVaultConnectorException
- on errordefault boolean createAppRole(String roleName, List<String> policies) throws VaultConnectorException
roleName
- The role namepolicies
- The policies to associate withVaultConnectorException
- on errordefault boolean createAppRole(String roleName, String roleID) throws VaultConnectorException
roleName
- The role nameroleID
- A custom role IDVaultConnectorException
- on errordefault boolean createAppRole(String roleName, List<String> policies, String roleID) throws VaultConnectorException
roleName
- The role namepolicies
- The policies to associate withroleID
- A custom role IDVaultConnectorException
- on errorboolean deleteAppRole(String roleName) throws VaultConnectorException
roleName
- The role anmeVaultConnectorException
- on errorAppRoleResponse lookupAppRole(String roleName) throws VaultConnectorException
roleName
- The role nameVaultConnectorException
- on errorString getAppRoleID(String roleName) throws VaultConnectorException
roleName
- The role nameVaultConnectorException
- on errorboolean setAppRoleID(String roleName, String roleID) throws VaultConnectorException
roleName
- The role nameroleID
- The role IDVaultConnectorException
- on errordefault AppRoleSecretResponse createAppRoleSecret(String roleName) throws VaultConnectorException
roleName
- The role nameVaultConnectorException
- on errordefault AppRoleSecretResponse createAppRoleSecret(String roleName, String secretID) throws VaultConnectorException
roleName
- The role namesecretID
- A custom secret IDVaultConnectorException
- on errorAppRoleSecretResponse createAppRoleSecret(String roleName, AppRoleSecret secret) throws VaultConnectorException
roleName
- The role namesecret
- The secret meta objectVaultConnectorException
- on errorAppRoleSecretResponse lookupAppRoleSecret(String roleName, String secretID) throws VaultConnectorException
roleName
- The role namesecretID
- The secret IDVaultConnectorException
- on errorboolean destroyAppRoleSecret(String roleName, String secretID) throws VaultConnectorException
roleName
- The role namesecretID
- The secret meta objectVaultConnectorException
- on errorList<String> listAppRoles() throws VaultConnectorException
VaultConnectorException
- on errorList<String> listAppRoleSecretss(String roleName) throws VaultConnectorException
roleName
- The role nameVaultConnectorException
- on error@Deprecated boolean registerUserId(String appID, String userID) throws VaultConnectorException
createAppRoleSecret(java.lang.String)
instead.appID
- The App-IDuserID
- The User-IDVaultConnectorException
- on error@Deprecated default boolean registerAppUserId(String appID, String policy, String displayName, String userID) throws VaultConnectorException
appID
- The App-IDpolicy
- The policy to associate withdisplayName
- Arbitrary name to displayuserID
- The User-IDVaultConnectorException
- on errorboolean isAuthorized()
SecretResponse readSecret(String key) throws VaultConnectorException
key
- Secret identifierVaultConnectorException
- on errorList<String> listSecrets(String path) throws VaultConnectorException
path
- Root path to searchVaultConnectorException
- on errorboolean writeSecret(String key, String value) throws VaultConnectorException
key
- Secret pathvalue
- Secret valueVaultConnectorException
- on errorboolean deleteSecret(String key) throws VaultConnectorException
key
- Secret pathVaultConnectorException
- on errorboolean revoke(String leaseID) throws VaultConnectorException
leaseID
- the lease IDVaultConnectorException
- on errordefault SecretResponse renew(String leaseID) throws VaultConnectorException
leaseID
- the lase IDVaultConnectorException
SecretResponse renew(String leaseID, Integer increment) throws VaultConnectorException
leaseID
- the lase IDincrement
- number of seconds to extend lease timeVaultConnectorException
AuthResponse createToken(Token token) throws VaultConnectorException
token
- the tokenVaultConnectorException
- on errorAuthResponse createToken(Token token, boolean orphan) throws VaultConnectorException
token
- the tokenorphan
- create orphan tokenVaultConnectorException
- on errorAuthResponse createToken(Token token, String role) throws VaultConnectorException
token
- the tokenrole
- the role nameVaultConnectorException
- on errorTokenResponse lookupToken(String token) throws VaultConnectorException
token
- the tokenVaultConnectorException
- on errorCopyright © 2016. All rights reserved.