public interface SecretProvider
keyStoreBased(KeyStoreHandler) or fallback(String, char[]).| Modifier and Type | Method and Description |
|---|---|
boolean |
deleteToken()
Delete the stored token, if any.
|
static SecretProvider |
fallback(String username,
char... password)
For cases where there is no KeyStore support available in JDK, this secret provider stores all secrets in plain
text.
|
char[] |
getPassword()
Retrieve password used to connect to Zonky API.
|
Optional<char[]> |
getSecret(String secretId)
Retrieve a secret stored through
setSecret(String, char[]). |
Optional<Reader> |
getToken()
Retrieve serialization of Zonky's OAuth token.
|
String |
getUsername()
Retrieve username used to connect to Zonky API.
|
boolean |
isPersistent()
Whether or not this provider will store all data in such a way that it survives JVM restart.
|
static SecretProvider |
keyStoreBased(KeyStoreHandler ksh)
Create a @
KeyStore-based provider based on a given key store. |
static SecretProvider |
keyStoreBased(KeyStoreHandler ksh,
String user,
char... password)
Create a @
KeyStore-based provider based on a given key store, filled with initial username and password. |
boolean |
setSecret(String secretId,
char... secret)
Store a secret.
|
boolean |
setToken(Reader token)
Store serialization of Zonky's OAuth token.
|
static SecretProvider keyStoreBased(KeyStoreHandler ksh)
KeyStore-based provider based on a given key store.ksh - Initialized KeyStore for the provider to work with.static SecretProvider keyStoreBased(KeyStoreHandler ksh, String user, char... password)
KeyStore-based provider based on a given key store, filled with initial username and password.ksh - Initialized KeyStore for the provider to work with.user - Zonky username to store in the key store.password - Zonky password to store in the key store.static SecretProvider fallback(String username, char... password)
username - Zonky username.password - Zonky password.char[] getPassword()
String getUsername()
Optional<Reader> getToken()
setToken(Reader) previously called, unless deleteToken() was called after
that.boolean setToken(Reader token)
token - The serialization of the token to be stored.Optional<char[]> getSecret(String secretId)
setSecret(String, char[]).secretId - ID of the secret to retrieve.boolean setSecret(String secretId, char... secret)
secretId - ID of the secret.secret - The secret to store.boolean deleteToken()
boolean isPersistent()
Copyright © 2017. All rights reserved.