Class AbstractStorageSecretEngine
- java.lang.Object
-
- com.netflix.spinnaker.kork.secrets.engines.AbstractStorageSecretEngine
-
- All Implemented Interfaces:
SecretEngine
public abstract class AbstractStorageSecretEngine extends java.lang.Object implements SecretEngine
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>cacheprotected static java.lang.StringSTORAGE_BUCKETprotected static java.lang.StringSTORAGE_FILE_URIprotected static java.lang.StringSTORAGE_PROP_KEYprotected static java.lang.StringSTORAGE_REGION
-
Constructor Summary
Constructors Constructor Description AbstractStorageSecretEngine()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclearCache()byte[]decrypt(EncryptedSecret encryptedSecret)protected abstract java.io.InputStreamdownloadRemoteFile(EncryptedSecret encryptedSecret)EncryptedSecretencrypt(java.lang.String secretToEncrypt)protected byte[]getParsedValue(java.lang.String fileURI, java.lang.String yamlPath)protected voidparseAsYaml(java.lang.String fileURI, java.io.InputStream inputStream)protected byte[]readAll(java.io.InputStream inputStream)voidvalidate(EncryptedSecret encryptedSecret)In order for a secretEngine to decrypt an EncryptedSecret, it may require extra information (e.g.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.netflix.spinnaker.kork.secrets.SecretEngine
identifier
-
-
-
-
Field Detail
-
STORAGE_BUCKET
protected static final java.lang.String STORAGE_BUCKET
- See Also:
- Constant Field Values
-
STORAGE_REGION
protected static final java.lang.String STORAGE_REGION
- See Also:
- Constant Field Values
-
STORAGE_FILE_URI
protected static final java.lang.String STORAGE_FILE_URI
- See Also:
- Constant Field Values
-
STORAGE_PROP_KEY
protected static final java.lang.String STORAGE_PROP_KEY
- See Also:
- Constant Field Values
-
cache
protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> cache
-
-
Method Detail
-
decrypt
public byte[] decrypt(EncryptedSecret encryptedSecret)
- Specified by:
decryptin interfaceSecretEngine
-
validate
public void validate(EncryptedSecret encryptedSecret) throws InvalidSecretFormatException
Description copied from interface:SecretEngineIn order for a secretEngine to decrypt an EncryptedSecret, it may require extra information (e.g. decryptionKey, location, encryptionMethod, etc). This method takes an EncryptedSecret and validates it contains the required information the service needs for decryption. Parameter names should not contain ':'- Specified by:
validatein interfaceSecretEngine- Parameters:
encryptedSecret- The encrypted secret- Throws:
InvalidSecretFormatException- If the encrypted secret is malformed
-
encrypt
public EncryptedSecret encrypt(java.lang.String secretToEncrypt) throws java.lang.UnsupportedOperationException
- Specified by:
encryptin interfaceSecretEngine- Throws:
java.lang.UnsupportedOperationException
-
downloadRemoteFile
protected abstract java.io.InputStream downloadRemoteFile(EncryptedSecret encryptedSecret) throws java.io.IOException
- Throws:
java.io.IOException
-
readAll
protected byte[] readAll(java.io.InputStream inputStream) throws java.io.IOException- Throws:
java.io.IOException
-
parseAsYaml
protected void parseAsYaml(java.lang.String fileURI, java.io.InputStream inputStream)
-
getParsedValue
protected byte[] getParsedValue(java.lang.String fileURI, java.lang.String yamlPath) throws SecretDecryptionException- Throws:
SecretDecryptionException
-
clearCache
public void clearCache()
- Specified by:
clearCachein interfaceSecretEngine
-
-