Class ScriptedSecrets
java.lang.Object
org.forgerock.openam.scripting.api.secrets.ScriptedSecrets
A wrapper around the Secrets API that allows a simplified interface to access secrets from a scripting context.
- Since:
- AM 7.0.0
-
Constructor Summary
ConstructorDescriptionScriptedSecrets
(Secrets secrets, Realm realm) Constructor.ScriptedSecrets
(Secrets secrets, Realm realm, Set<String> validPrefixes) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetGenericSecret
(String secretId) Allows the caller to access a generic type of secret from the Secrets API.
-
Constructor Details
-
ScriptedSecrets
Constructor.- Parameters:
secrets
- The secrets storerealm
- The realm this API exists in
-
ScriptedSecrets
Constructor.- Parameters:
secrets
- The secrets storerealm
- The realm this API exists invalidPrefixes
- The secret ID prefixes that are valid for being obtained via this instance
-
-
Method Details
-
getGenericSecret
@Supported(scriptingApi=true) public Secret getGenericSecret(@Nonnull String secretId) throws NodeProcessException Allows the caller to access a generic type of secret from the Secrets API. When the caller requests the secret it will be up to theSecrets
class to resolve this secret to a value.- Parameters:
secretId
- A non null string identifier for the secret.- Returns:
- A non null
Secret
value object representing the secret requested. - Throws:
NodeProcessException
- If the secret is not found or is not accessible or the operation times out then this exception will be thrown.RuntimeException
- If the thread is interrupted while waiting for the promise to resolve the secret.
-