Class ScriptedSecrets

java.lang.Object
org.forgerock.openam.scripting.api.secrets.ScriptedSecrets
All Implemented Interfaces:
org.forgerock.openam.scripting.api.secrets.IScriptedSecrets

@Supported public class ScriptedSecrets extends Object implements org.forgerock.openam.scripting.api.secrets.IScriptedSecrets
A wrapper around the Secrets API that allows a simplified interface to access secrets from a scripting context.
Since:
AM 7.0.0
  • Constructor Details

    • ScriptedSecrets

      @Supported public ScriptedSecrets(Secrets secrets, Realm realm)
      Constructor.
      Parameters:
      secrets - The secrets store
      realm - The realm this API exists in
    • ScriptedSecrets

      @Inject @Supported public ScriptedSecrets(Secrets secrets, Realm realm, Set<String> validPrefixes)
      Constructor.
      Parameters:
      secrets - The secrets store
      realm - The realm this API exists in
      validPrefixes - 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 org.forgerock.openam.scripting.api.secrets.ScriptedSecretsException
      Description copied from interface: org.forgerock.openam.scripting.api.secrets.IScriptedSecrets
      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 the Secrets class to resolve this secret to a value.
      Specified by:
      getGenericSecret in interface org.forgerock.openam.scripting.api.secrets.IScriptedSecrets
      Parameters:
      secretId - A non null string identifier for the secret.
      Returns:
      A non null Secret value object representing the secret requested.
      Throws:
      org.forgerock.openam.scripting.api.secrets.ScriptedSecretsException - If the secret is not found or is not accessible or the operation times out then this exception will be thrown.