Generic vault credential type that provides the minimum necessary implementation required by the VaultService class.
To run this example, clone Jervis and execute ./gradlew console to bring up a Groovy Console with the classpath set up.
import net.gleske.jervis.remotes.interfaces.VaultCredential
import net.gleske.jervis.remotes.VaultService
class VaultToken implements VaultCredential {
final String vault_url
String token
VaultToken(String vault_url, String token) {
this.vault_url = vault_url
this.token = token
}
}
VaultToken creds = new VaultToken('http://active.vault.service.consul:8200/', 's.Aas...')
VaultService vault = new VaultService(creds)
println creds.getToken()
println vault.getSecret('path/to/secret')
Type Params | Return Type | Name and description |
---|---|---|
|
String |
getVault_url() When implemented, this method should return a String that is the URL to a HashiCorp Vault instance API endpoint. |
Methods inherited from class | Name |
---|---|
interface TokenCredential |
getToken, setToken |
When implemented, this method should return a String that is the URL to a HashiCorp Vault instance API endpoint.