Package de.stklcode.jvault.connector
Class HTTPVaultConnector
- java.lang.Object
-
- de.stklcode.jvault.connector.HTTPVaultConnector
-
- All Implemented Interfaces:
VaultConnector,Serializable,AutoCloseable
public class HTTPVaultConnector extends Object implements VaultConnector
Vault Connector implementation using Vault's HTTP API.- Since:
- 0.1
- Author:
- Stefan Kalscheuer
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_TLS_VERSION-
Fields inherited from interface de.stklcode.jvault.connector.VaultConnector
PATH_SECRET
-
-
Constructor Summary
Constructors Constructor Description HTTPVaultConnector(String baseURL)Create connector using full URL.HTTPVaultConnector(String hostname, boolean useTLS)Create connector using hostname and schema.HTTPVaultConnector(String hostname, boolean useTLS, Integer port)Create connector using hostname, schema and port.HTTPVaultConnector(String hostname, boolean useTLS, Integer port, String prefix)Create connector using hostname, schema, port and path.HTTPVaultConnector(String hostname, boolean useTLS, Integer port, String prefix, X509Certificate trustedCaCert)Create connector using hostname, schema, port, path and trusted certificate.HTTPVaultConnector(String hostname, boolean useTLS, String tlsVersion, Integer port, String prefix, X509Certificate trustedCaCert, int numberOfRetries, Integer timeout)Create connector using hostname, schema, port, path and trusted certificate.HTTPVaultConnector(String baseURL, X509Certificate trustedCaCert)Create connector using full URL and trusted certificate.HTTPVaultConnector(String baseURL, X509Certificate trustedCaCert, int numberOfRetries)Create connector using full URL and trusted certificate.HTTPVaultConnector(String baseURL, X509Certificate trustedCaCert, int numberOfRetries, Integer timeout)Create connector using full URL and trusted certificate.HTTPVaultConnector(String baseURL, X509Certificate trustedCaCert, int numberOfRetries, Integer timeout, String tlsVersion)Create connector using full URL and trusted certificate.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AuthResponseauthAppId(String appID, String userID)Deprecated.AuthResponseauthAppRole(String roleID, String secretID)Authorize to Vault using AppRole method.TokenResponseauthToken(String token)Authorize to Vault using token.AuthResponseauthUserPass(String username, String password)Authorize to Vault using username and password.voidclose()booleancreateAppRole(AppRole role)Register a new AppRole role from given metamodel.AppRoleSecretResponsecreateAppRoleSecret(String roleName, AppRoleSecret secret)Register new AppRole secret with custom ID.booleancreateOrUpdateTokenRole(String name, TokenRole role)Create a new or update an existing token role.AuthResponsecreateToken(Token token)Create a new token.AuthResponsecreateToken(Token token, boolean orphan)Create a new token.AuthResponsecreateToken(Token token, String role)Create a new token for specific role.voiddelete(String key)Delete key from Vault.voiddeleteAllSecretVersions(String mount, String key)Delete latest version of a secret from Vault.booleandeleteAppRole(String roleName)Delete AppRole role from Vault.voiddeleteLatestSecretVersion(String mount, String key)Delete latest version of a secret from Vault.voiddeleteSecretVersions(String mount, String key, int... versions)Delete secret versions from Vault.booleandeleteTokenRole(String name)Delete a token role.booleandestroyAppRoleSecret(String roleName, String secretID)Destroy an AppRole secret.voiddestroySecretVersions(String mount, String key, int... versions)Destroy secret versions from Vault.StringgetAppRoleID(String roleName)Retrieve ID for an AppRole role.List<AuthBackend>getAuthBackends()Get all available authentication backends.HealthResponsegetHealth()Query server health information.booleanisAuthorized()Get authorization status.List<String>list(String path)List available nodes from Vault.List<String>listAppRoles()List existing (accessible) AppRole roles.List<String>listAppRoleSecrets(String roleName)List existing (accessible) secret IDs for AppRole role.List<String>listTokenRoles()List available token roles from Vault.AppRoleResponselookupAppRole(String roleName)Lookup an AppRole role.AppRoleSecretResponselookupAppRoleSecret(String roleName, String secretID)Lookup an AppRole secret.TokenResponselookupToken(String token)Lookup token information.SecretResponseread(String key)Retrieve any nodes content from Vault.MetadataResponsereadSecretMetadata(String mount, String key)Retrieve secret metadata from Vault.SecretResponsereadSecretVersion(String mount, String key, Integer version)Retrieve secret data from Vault.TokenRoleResponsereadTokenRole(String name)Lookup token information.booleanregisterAppId(String appID, String policy, String displayName)Deprecated.booleanregisterUserId(String appID, String userID)Deprecated.SecretResponserenew(String leaseID, Integer increment)Renew lease with given ID.voidresetAuth()Reset authorization information.voidrevoke(String leaseID)Revoke given lease immediately.voidseal()Seal vault.SealResponsesealStatus()Retrieve status of vault seal.booleansetAppRoleID(String roleName, String roleID)Set custom ID for an AppRole role.voidundeleteSecretVersions(String mount, String key, int... versions)Undelete (restore) secret versions from Vault.SealResponseunseal(String key, Boolean reset)Unseal vault.voidupdateSecretMetadata(String mount, String key, Integer maxVersions, boolean casRequired)Update secret metadata.voidwrite(String key, Map<String,Object> data, Map<String,Object> options)Write value to Vault.SecretVersionResponsewriteSecretData(String mount, String key, Map<String,Object> data, Integer cas)Write secret to Vault.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.stklcode.jvault.connector.VaultConnector
authAppRole, createAppRole, createAppRole, createAppRole, createAppRole, createAppRoleSecret, createAppRoleSecret, createOrUpdateTokenRole, deleteAllSecretVersions, deleteLatestSecretVersion, deleteSecret, deleteSecretVersions, destroySecretVersions, listSecrets, readDbCredentials, readMongoDbCredentials, readMsSqlCredentials, readMySqlCredentials, readPostgreSqlCredentials, readSecret, readSecretData, readSecretData, readSecretMetadata, readSecretVersion, registerAppUserId, renew, undeleteSecretVersions, unseal, updateSecretMetadata, write, write, writeSecret, writeSecret, writeSecretData, writeSecretData
-
-
-
-
Field Detail
-
DEFAULT_TLS_VERSION
public static final String DEFAULT_TLS_VERSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HTTPVaultConnector
public HTTPVaultConnector(String hostname, boolean useTLS)
Create connector using hostname and schema.- Parameters:
hostname- The hostnameuseTLS- If TRUE, use HTTPS, otherwise HTTP
-
HTTPVaultConnector
public HTTPVaultConnector(String hostname, boolean useTLS, Integer port)
Create connector using hostname, schema and port.- Parameters:
hostname- The hostnameuseTLS- If TRUE, use HTTPS, otherwise HTTPport- The port
-
HTTPVaultConnector
public HTTPVaultConnector(String hostname, boolean useTLS, Integer port, String prefix)
Create connector using hostname, schema, port and path.- Parameters:
hostname- The hostnameuseTLS- If TRUE, use HTTPS, otherwise HTTPport- The portprefix- HTTP API prefix (default: /v1/)
-
HTTPVaultConnector
public HTTPVaultConnector(String hostname, boolean useTLS, Integer port, String prefix, X509Certificate trustedCaCert)
Create connector using hostname, schema, port, path and trusted certificate.- Parameters:
hostname- The hostnameuseTLS- If TRUE, use HTTPS, otherwise HTTPport- The portprefix- HTTP API prefix (default: /v1/)trustedCaCert- Trusted CA certificate
-
HTTPVaultConnector
public HTTPVaultConnector(String hostname, boolean useTLS, String tlsVersion, Integer port, String prefix, X509Certificate trustedCaCert, int numberOfRetries, Integer timeout)
Create connector using hostname, schema, port, path and trusted certificate.- Parameters:
hostname- The hostnameuseTLS- If TRUE, use HTTPS, otherwise HTTPtlsVersion- TLS versionport- The portprefix- HTTP API prefix (default: /v1/)trustedCaCert- Trusted CA certificatenumberOfRetries- Number of retries on 5xx errorstimeout- Timeout for HTTP requests (milliseconds)
-
HTTPVaultConnector
public HTTPVaultConnector(String baseURL)
Create connector using full URL.- Parameters:
baseURL- The URL
-
HTTPVaultConnector
public HTTPVaultConnector(String baseURL, X509Certificate trustedCaCert)
Create connector using full URL and trusted certificate.- Parameters:
baseURL- The URLtrustedCaCert- Trusted CA certificate
-
HTTPVaultConnector
public HTTPVaultConnector(String baseURL, X509Certificate trustedCaCert, int numberOfRetries)
Create connector using full URL and trusted certificate.- Parameters:
baseURL- The URLtrustedCaCert- Trusted CA certificatenumberOfRetries- Number of retries on 5xx errors
-
HTTPVaultConnector
public HTTPVaultConnector(String baseURL, X509Certificate trustedCaCert, int numberOfRetries, Integer timeout)
Create connector using full URL and trusted certificate.- Parameters:
baseURL- The URLtrustedCaCert- Trusted CA certificatenumberOfRetries- Number of retries on 5xx errorstimeout- Timeout for HTTP requests (milliseconds)
-
HTTPVaultConnector
public HTTPVaultConnector(String baseURL, X509Certificate trustedCaCert, int numberOfRetries, Integer timeout, String tlsVersion)
Create connector using full URL and trusted certificate.- Parameters:
baseURL- The URLtrustedCaCert- Trusted CA certificatenumberOfRetries- Number of retries on 5xx errorstimeout- Timeout for HTTP requests (milliseconds)tlsVersion- TLS Version.
-
-
Method Detail
-
resetAuth
public final void resetAuth()
Description copied from interface:VaultConnectorReset authorization information.- Specified by:
resetAuthin interfaceVaultConnector
-
sealStatus
public final SealResponse sealStatus() throws VaultConnectorException
Description copied from interface:VaultConnectorRetrieve status of vault seal.- Specified by:
sealStatusin interfaceVaultConnector- Returns:
- Seal status
- Throws:
VaultConnectorException- on error
-
seal
public final void seal() throws VaultConnectorExceptionDescription copied from interface:VaultConnectorSeal vault.- Specified by:
sealin interfaceVaultConnector- Throws:
VaultConnectorException- on error
-
unseal
public final SealResponse unseal(String key, Boolean reset) throws VaultConnectorException
Description copied from interface:VaultConnectorUnseal vault.- Specified by:
unsealin interfaceVaultConnector- Parameters:
key- A single master share keyreset- Discard previously provided keys (optional)- Returns:
- Response with seal status
- Throws:
VaultConnectorException- on error
-
getHealth
public HealthResponse getHealth() throws VaultConnectorException
Description copied from interface:VaultConnectorQuery server health information.- Specified by:
getHealthin interfaceVaultConnector- Returns:
- Health information.
- Throws:
VaultConnectorException- on error
-
isAuthorized
public final boolean isAuthorized()
Description copied from interface:VaultConnectorGet authorization status.- Specified by:
isAuthorizedin interfaceVaultConnector- Returns:
- TRUE, if successfully authorized
-
getAuthBackends
public final List<AuthBackend> getAuthBackends() throws VaultConnectorException
Description copied from interface:VaultConnectorGet all available authentication backends.- Specified by:
getAuthBackendsin interfaceVaultConnector- Returns:
- List of backends
- Throws:
VaultConnectorException- on error
-
authToken
public final TokenResponse authToken(String token) throws VaultConnectorException
Description copied from interface:VaultConnectorAuthorize to Vault using token.- Specified by:
authTokenin interfaceVaultConnector- Parameters:
token- The token- Returns:
- Token response
- Throws:
VaultConnectorException- on error
-
authUserPass
public final AuthResponse authUserPass(String username, String password) throws VaultConnectorException
Description copied from interface:VaultConnectorAuthorize to Vault using username and password.- Specified by:
authUserPassin interfaceVaultConnector- Parameters:
username- The usernamepassword- The password- Returns:
- Authorization result
- Throws:
VaultConnectorException- on error
-
authAppId
@Deprecated public final AuthResponse authAppId(String appID, String userID) throws VaultConnectorException
Deprecated.Description copied from interface:VaultConnectorAuthorize to Vault using AppID method.- Specified by:
authAppIdin interfaceVaultConnector- Parameters:
appID- The App IDuserID- The User ID- Returns:
- The
AuthResponse - Throws:
VaultConnectorException- on error
-
authAppRole
public final AuthResponse authAppRole(String roleID, String secretID) throws VaultConnectorException
Description copied from interface:VaultConnectorAuthorize to Vault using AppRole method.- Specified by:
authAppRolein interfaceVaultConnector- Parameters:
roleID- The role IDsecretID- The secret ID- Returns:
- The
AuthResponse - Throws:
VaultConnectorException- on error
-
registerAppId
@Deprecated public final boolean registerAppId(String appID, String policy, String displayName) throws VaultConnectorException
Deprecated.Description copied from interface:VaultConnectorRegister new App-ID with policy.- Specified by:
registerAppIdin interfaceVaultConnector- Parameters:
appID- The unique App-IDpolicy- The policy to associate withdisplayName- Arbitrary name to display- Returns:
trueon success- Throws:
VaultConnectorException- on error
-
registerUserId
@Deprecated public final boolean registerUserId(String appID, String userID) throws VaultConnectorException
Deprecated.Description copied from interface:VaultConnectorRegister User-ID with App-ID.- Specified by:
registerUserIdin interfaceVaultConnector- Parameters:
appID- The App-IDuserID- The User-ID- Returns:
trueon success- Throws:
VaultConnectorException- on error
-
createAppRole
public final boolean createAppRole(AppRole role) throws VaultConnectorException
Description copied from interface:VaultConnectorRegister a new AppRole role from given metamodel.- Specified by:
createAppRolein interfaceVaultConnector- Parameters:
role- The role- Returns:
trueon success- Throws:
VaultConnectorException- on error
-
lookupAppRole
public final AppRoleResponse lookupAppRole(String roleName) throws VaultConnectorException
Description copied from interface:VaultConnectorLookup an AppRole role.- Specified by:
lookupAppRolein interfaceVaultConnector- Parameters:
roleName- The role name- Returns:
- Result of the lookup
- Throws:
VaultConnectorException- on error
-
deleteAppRole
public final boolean deleteAppRole(String roleName) throws VaultConnectorException
Description copied from interface:VaultConnectorDelete AppRole role from Vault.- Specified by:
deleteAppRolein interfaceVaultConnector- Parameters:
roleName- The role name- Returns:
trueon success- Throws:
VaultConnectorException- on error
-
getAppRoleID
public final String getAppRoleID(String roleName) throws VaultConnectorException
Description copied from interface:VaultConnectorRetrieve ID for an AppRole role.- Specified by:
getAppRoleIDin interfaceVaultConnector- Parameters:
roleName- The role name- Returns:
- The role ID
- Throws:
VaultConnectorException- on error
-
setAppRoleID
public final boolean setAppRoleID(String roleName, String roleID) throws VaultConnectorException
Description copied from interface:VaultConnectorSet custom ID for an AppRole role.- Specified by:
setAppRoleIDin interfaceVaultConnector- Parameters:
roleName- The role nameroleID- The role ID- Returns:
trueon success- Throws:
VaultConnectorException- on error
-
createAppRoleSecret
public final AppRoleSecretResponse createAppRoleSecret(String roleName, AppRoleSecret secret) throws VaultConnectorException
Description copied from interface:VaultConnectorRegister new AppRole secret with custom ID.- Specified by:
createAppRoleSecretin interfaceVaultConnector- Parameters:
roleName- The role namesecret- The secret meta object- Returns:
- The secret ID
- Throws:
VaultConnectorException- on error
-
lookupAppRoleSecret
public final AppRoleSecretResponse lookupAppRoleSecret(String roleName, String secretID) throws VaultConnectorException
Description copied from interface:VaultConnectorLookup an AppRole secret.- Specified by:
lookupAppRoleSecretin interfaceVaultConnector- Parameters:
roleName- The role namesecretID- The secret ID- Returns:
- Result of the lookup
- Throws:
VaultConnectorException- on error
-
destroyAppRoleSecret
public final boolean destroyAppRoleSecret(String roleName, String secretID) throws VaultConnectorException
Description copied from interface:VaultConnectorDestroy an AppRole secret.- Specified by:
destroyAppRoleSecretin interfaceVaultConnector- Parameters:
roleName- The role namesecretID- The secret meta object- Returns:
- The secret ID
- Throws:
VaultConnectorException- on error
-
listAppRoles
public final List<String> listAppRoles() throws VaultConnectorException
Description copied from interface:VaultConnectorList existing (accessible) AppRole roles.- Specified by:
listAppRolesin interfaceVaultConnector- Returns:
- List of roles
- Throws:
VaultConnectorException- on error
-
listAppRoleSecrets
public final List<String> listAppRoleSecrets(String roleName) throws VaultConnectorException
Description copied from interface:VaultConnectorList existing (accessible) secret IDs for AppRole role.- Specified by:
listAppRoleSecretsin interfaceVaultConnector- Parameters:
roleName- The role name- Returns:
- List of roles
- Throws:
VaultConnectorException- on error
-
read
public final SecretResponse read(String key) throws VaultConnectorException
Description copied from interface:VaultConnectorRetrieve any nodes content from Vault.- Specified by:
readin interfaceVaultConnector- Parameters:
key- Secret identifier- Returns:
- Secret response
- Throws:
VaultConnectorException- on error
-
readSecretVersion
public final SecretResponse readSecretVersion(String mount, String key, Integer version) throws VaultConnectorException
Description copied from interface:VaultConnectorRetrieve secret data from Vault.
Path<mount>/data/<key>is read here. Only available for KV v2 secrets.- Specified by:
readSecretVersionin interfaceVaultConnector- Parameters:
mount- Secret store mount point (without leading or trailing slash).key- Secret identifierversion- Version to read. Ifnullor zero, the latest version will be returned.- Returns:
- Secret response.
- Throws:
VaultConnectorException- on error
-
readSecretMetadata
public final MetadataResponse readSecretMetadata(String mount, String key) throws VaultConnectorException
Description copied from interface:VaultConnectorRetrieve secret metadata from Vault.
Path<mount>/metadata/<key>is read here. Only available for KV v2 secrets.- Specified by:
readSecretMetadatain interfaceVaultConnector- Parameters:
mount- Secret store mount point (without leading or trailing slash).key- Secret identifier- Returns:
- Metadata response
- Throws:
VaultConnectorException- on error
-
updateSecretMetadata
public void updateSecretMetadata(String mount, String key, Integer maxVersions, boolean casRequired) throws VaultConnectorException
Description copied from interface:VaultConnectorUpdate secret metadata.
Path<mount>/metadata/<key>is written here. Only available for KV v2 secrets.- Specified by:
updateSecretMetadatain interfaceVaultConnector- Parameters:
mount- Secret store mount point (without leading or trailing slash).key- Secret identifiermaxVersions- Maximum number of versions (fallback to backend default ifnull)casRequired- Specify if Check-And-Set is required for this secret.- Throws:
VaultConnectorException- on error
-
writeSecretData
public final SecretVersionResponse writeSecretData(String mount, String key, Map<String,Object> data, Integer cas) throws VaultConnectorException
Description copied from interface:VaultConnectorWrite secret to Vault.
Path<mount>/data/<key>is written here. Only available for KV v2 secrets.- Specified by:
writeSecretDatain interfaceVaultConnector- Parameters:
mount- Secret store mount point (without leading or trailing slash).key- Secret identifierdata- Secret content. Value must be be JSON serializable.cas- Use Check-And-Set operation, i.e. only allow writing if current version matches this value.- Returns:
- Metadata for the created/updated secret.
- Throws:
VaultConnectorException- on error
-
list
public final List<String> list(String path) throws VaultConnectorException
Description copied from interface:VaultConnectorList available nodes from Vault.- Specified by:
listin interfaceVaultConnector- Parameters:
path- Root path to search- Returns:
- List of secret keys
- Throws:
VaultConnectorException- on error
-
write
public final void write(String key, Map<String,Object> data, Map<String,Object> options) throws VaultConnectorException
Description copied from interface:VaultConnectorWrite value to Vault.- Specified by:
writein interfaceVaultConnector- Parameters:
key- Secret pathdata- Secret content. Value must be be JSON serializable.options- Secret options (optional).- Throws:
VaultConnectorException- on error
-
delete
public final void delete(String key) throws VaultConnectorException
Description copied from interface:VaultConnectorDelete key from Vault.- Specified by:
deletein interfaceVaultConnector- Parameters:
key- Secret path- Throws:
VaultConnectorException- on error
-
deleteLatestSecretVersion
public final void deleteLatestSecretVersion(String mount, String key) throws VaultConnectorException
Description copied from interface:VaultConnectorDelete latest version of a secret from Vault.
Only available for KV v2 stores.- Specified by:
deleteLatestSecretVersionin interfaceVaultConnector- Parameters:
mount- Secret store mount point (without leading or trailing slash).key- Secret path.- Throws:
VaultConnectorException- on error
-
deleteAllSecretVersions
public final void deleteAllSecretVersions(String mount, String key) throws VaultConnectorException
Description copied from interface:VaultConnectorDelete latest version of a secret from Vault.
Prefixsecret/is automatically added to path. Only available for KV v2 stores.- Specified by:
deleteAllSecretVersionsin interfaceVaultConnector- Parameters:
mount- Secret store mount point (without leading or trailing slash).key- Secret path.- Throws:
VaultConnectorException- on error
-
deleteSecretVersions
public final void deleteSecretVersions(String mount, String key, int... versions) throws VaultConnectorException
Description copied from interface:VaultConnectorDelete secret versions from Vault.
Only available for KV v2 stores.- Specified by:
deleteSecretVersionsin interfaceVaultConnector- Parameters:
mount- Secret store mount point (without leading or trailing slash).key- Secret path.versions- Versions of the secret to delete.- Throws:
VaultConnectorException- on error
-
undeleteSecretVersions
public final void undeleteSecretVersions(String mount, String key, int... versions) throws VaultConnectorException
Description copied from interface:VaultConnectorUndelete (restore) secret versions from Vault. Only available for KV v2 stores.- Specified by:
undeleteSecretVersionsin interfaceVaultConnector- Parameters:
mount- Secret store mount point (without leading or trailing slash).key- Secret path.versions- Versions of the secret to undelete.- Throws:
VaultConnectorException- on error
-
destroySecretVersions
public final void destroySecretVersions(String mount, String key, int... versions) throws VaultConnectorException
Description copied from interface:VaultConnectorDestroy secret versions from Vault. Only available for KV v2 stores.- Specified by:
destroySecretVersionsin interfaceVaultConnector- Parameters:
mount- Secret store mount point (without leading or trailing slash).key- Secret path.versions- Versions of the secret to destroy.- Throws:
VaultConnectorException- on error
-
revoke
public final void revoke(String leaseID) throws VaultConnectorException
Description copied from interface:VaultConnectorRevoke given lease immediately.- Specified by:
revokein interfaceVaultConnector- Parameters:
leaseID- the lease ID- Throws:
VaultConnectorException- on error
-
renew
public final SecretResponse renew(String leaseID, Integer increment) throws VaultConnectorException
Description copied from interface:VaultConnectorRenew lease with given ID.- Specified by:
renewin interfaceVaultConnector- Parameters:
leaseID- the lase IDincrement- number of seconds to extend lease time- Returns:
- Renewed lease
- Throws:
VaultConnectorException- on error
-
createToken
public final AuthResponse createToken(Token token) throws VaultConnectorException
Description copied from interface:VaultConnectorCreate a new token.- Specified by:
createTokenin interfaceVaultConnector- Parameters:
token- the token- Returns:
- the result response
- Throws:
VaultConnectorException- on error
-
createToken
public final AuthResponse createToken(Token token, boolean orphan) throws VaultConnectorException
Description copied from interface:VaultConnectorCreate a new token.- Specified by:
createTokenin interfaceVaultConnector- Parameters:
token- the tokenorphan- create orphan token- Returns:
- the result response
- Throws:
VaultConnectorException- on error
-
createToken
public final AuthResponse createToken(Token token, String role) throws VaultConnectorException
Description copied from interface:VaultConnectorCreate a new token for specific role.- Specified by:
createTokenin interfaceVaultConnector- Parameters:
token- the tokenrole- the role name- Returns:
- the result response
- Throws:
VaultConnectorException- on error
-
close
public final void close()
- Specified by:
closein interfaceAutoCloseable
-
lookupToken
public final TokenResponse lookupToken(String token) throws VaultConnectorException
Description copied from interface:VaultConnectorLookup token information.- Specified by:
lookupTokenin interfaceVaultConnector- Parameters:
token- the token- Returns:
- the result response
- Throws:
VaultConnectorException- on error
-
createOrUpdateTokenRole
public boolean createOrUpdateTokenRole(String name, TokenRole role) throws VaultConnectorException
Description copied from interface:VaultConnectorCreate a new or update an existing token role.- Specified by:
createOrUpdateTokenRolein interfaceVaultConnector- Parameters:
name- the role name (overrides name possibly set in role entity)role- the role entity- Returns:
trueon success- Throws:
VaultConnectorException- on error
-
readTokenRole
public TokenRoleResponse readTokenRole(String name) throws VaultConnectorException
Description copied from interface:VaultConnectorLookup token information.- Specified by:
readTokenRolein interfaceVaultConnector- Parameters:
name- the role name- Returns:
- the result response
- Throws:
VaultConnectorException- on error
-
listTokenRoles
public List<String> listTokenRoles() throws VaultConnectorException
Description copied from interface:VaultConnectorList available token roles from Vault.- Specified by:
listTokenRolesin interfaceVaultConnector- Returns:
- List of token roles
- Throws:
VaultConnectorException- on error
-
deleteTokenRole
public boolean deleteTokenRole(String name) throws VaultConnectorException
Description copied from interface:VaultConnectorDelete a token role.- Specified by:
deleteTokenRolein interfaceVaultConnector- Parameters:
name- the role name to delete- Returns:
trueon success- Throws:
VaultConnectorException- on error
-
-