use of com.sequenceiq.cloudbreak.service.secret.vault.VaultSecret in project cloudbreak by hortonworks.
the class SecretService method getByResponse.
/**
* Fetches the secret from Secret's store. If the secret is not found then null is returned.
* If the secret is null then null is returned.
*
* @param secretResponse SecretResponse that refers to a Secret in the Secret engine
* @return Secret content or null if the secret secret is not found.
*/
public String getByResponse(SecretResponse secretResponse) {
if (secretResponse == null) {
return null;
}
VaultSecret vaultSecret = new VaultSecret(secretResponse.getEnginePath(), VaultKvV2Engine.class.getCanonicalName(), secretResponse.getSecretPath());
String secretAsJson = new Gson().toJson(vaultSecret);
return get(secretAsJson);
}
Aggregations