Package org.forgerock.openam.secrets
Class Secrets
java.lang.Object
org.forgerock.openam.secrets.Secrets
The top-level API to obtain secrets in AM. This class will provide secrets from all secret stores that are defined in
SMS configuration, and any other sources that are applicable to the AM runtime.
- Since:
- AM 6.5.0
-
Constructor Summary
ConstructorDescriptionSecrets
(AnnotatedServiceRegistry serviceRegistry, DirectoryWatcher directoryWatcher, org.forgerock.openam.secrets.SecretsProviderFacadeFactory secretsProviderFacadeFactory, org.forgerock.openam.secrets.ActiveSecretsProviderFacadeFactory activeSecretsProviderFacadeFactory) DI constructor for theSecrets
class. -
Method Summary
Modifier and TypeMethodDescriptionGet the global active secrets provider for the realm.getActiveRealmSecrets
(Realm realm) Get an active secrets provider for the realm.Get the global secrets provider for the realm.getRealmSecrets
(Realm realm) Get a secrets provider for the realm.protected SecretsReferenceProvider
getSecretsReferenceProvider
(List<SecretStore> allStores) boolean
isGlobalSecretsService
(String serviceName) Check to see if this is a purpose.boolean
isSecretService
(String serviceName) Check to see if a service is a Secret API service.void
registerSecretStore
(Class<? extends BaseSecretStoreProvider> storeType) Register a secret store type.void
start()
Start the secrets service.
-
Constructor Details
-
Secrets
@Inject public Secrets(AnnotatedServiceRegistry serviceRegistry, DirectoryWatcher directoryWatcher, org.forgerock.openam.secrets.SecretsProviderFacadeFactory secretsProviderFacadeFactory, org.forgerock.openam.secrets.ActiveSecretsProviderFacadeFactory activeSecretsProviderFacadeFactory) DI constructor for theSecrets
class.- Parameters:
serviceRegistry
- The service registry for annotated services, which all configuration-based secret stores are expected to be.directoryWatcher
- The directory watcher to use to watch for filesystem changes when using filesystem secret stores.
-
-
Method Details
-
registerSecretStore
Register a secret store type. This method is only expected to be called from the plugin tools.- Parameters:
storeType
- The type of the secrets store.
-
start
public void start()Start the secrets service. -
getGlobalSecrets
Get the global secrets provider for the realm.- Returns:
- A secrets provider for all the secret stores that are configured globally.
- Throws:
SecretException
- In the case of failure to read configuration.
-
getActiveGlobalSecrets
Get the global active secrets provider for the realm.- Returns:
- An active secrets provider for all the secret stores that are configured globally.
- Throws:
SecretException
- In the case of failure to read configuration.
-
getRealmSecrets
Get a secrets provider for the realm.- Parameters:
realm
- The realm.- Returns:
- A secrets provider for all the secret stores that are configured.
- Throws:
SecretException
- In the case of failure to read configuration.
-
getActiveRealmSecrets
Get an active secrets provider for the realm.- Parameters:
realm
- The realm.- Returns:
- An active secrets provider for all the secret stores that are configured.
- Throws:
SecretException
- In the case of failure to read configuration.
-
isSecretService
Check to see if a service is a Secret API service.- Parameters:
serviceName
- The name of the service to check.
-
isGlobalSecretsService
Check to see if this is a purpose.- Parameters:
serviceName
- The name of the service to check.
-
getSecretsReferenceProvider
-