Class SecretStores
SecretStore.
The active store is resolved from a BeanStore, defaulting to an InMemorySecretStore when none has
been contributed — the same beanStore.getBean(...)-with-drop-in-default idiom other framework-owned
components use. An explicit BeanStore contribution always wins.
fromServiceLoader() is the separate classpath-contribution path, mirroring
Settings's opt-in useServiceLoader(). It is deliberately
not consulted by resolve(BeanStore), so the no-contribution default stays a deterministic
InMemorySecretStore rather than silently becoming whatever store happens to be on the classpath (which, for
an environment-variable-backed provider, would quietly turn arbitrary env vars into secrets). A consumer that
wants a classpath-contributed store can seed its BeanStore from fromServiceLoader().
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<SecretStore>Discovers a secret store contributed on the classpath viaSecretStoreProviderandServiceLoader.static SecretStoreResolves the active secret store from the specified bean store, defaulting to a newInMemorySecretStorewhen none is contributed.
-
Method Details
-
resolve
Resolves the active secret store from the specified bean store, defaulting to a newInMemorySecretStorewhen none is contributed.- Parameters:
beanStore- The bean store to resolve from. Can benull , in which case the default is returned.- Returns:
- The resolved store. Never
null .
-
fromServiceLoader
Discovers a secret store contributed on the classpath viaSecretStoreProviderandServiceLoader.Providers are sorted by
SecretStoreProvider.order()(lowest first) and the first one that yields a non-null store wins.- Returns:
- The discovered store, or
Optional.empty()if none is registered on the classpath.
-