Package org.apache.juneau.commons.secret
package org.apache.juneau.commons.secret
A small, JDK-only SPI for storing and retrieving secrets by key — the secure, mutable sibling of
PropertySource.
The interface + built-in implementations in this package have zero third-party runtime dependencies.
Sensitivity is intrinsic: secret values are held as char[] (never String) and are never
toString()'d, logged, or dumped. Backends that reach an OS keychain, a remote vault, or a cloud
secret manager live in separate opt-in modules, never here.
Key types:
SecretStore— the SPI (store / find / exists / delete).InMemorySecretStore— the zero-config, process-local default.EnvVarSecretStore— a read-only, environment-variable-backed source.SecretStoreProvider—ServiceLoaderdiscovery.SecretStores—BeanStoreresolution (defaultInMemorySecretStore).SecretStorePropertySource— an opt-in bridge exposing a store as a redactingPropertySource.
- Since:
- 10.0.0
-
ClassDescriptionA read-only
SecretStorebacked bySystem.getenv(String).Provider forEnvVarSecretStore, discoverable throughSecretStores.fromServiceLoader().The policy a network- or OS-backedSecretStoreapplies when its backing store cannot answer — for example when the OS keychain tool is missing or a remote vault is unreachable.Built-in defaultSecretStore: a per-process,ConcurrentHashMap-backed key-to-secret map.SPI for storing and retrieving a secret by key — the secure, mutable sibling ofPropertySource.Opt-in bridge that exposes a chosenSecretStoreas aPropertySource, so a secret can be resolved through the property/$P{...}/@Valuemachinery only where a consumer deliberately wires it in.Provider SPI for contributing aSecretStoreviaServiceLoader.Resolution helpers for selecting the activeSecretStore.Marker specialization ofPropertySourcewhose values are sensitive and must be redacted anywhere they would otherwise be surfaced — atoString(), a settings dump, or a log line.