Class PasswordHashProviderRegistry
java.lang.Object
com.svenruppert.jsentinel.credential.password.provider.PasswordHashProviderRegistry
Lookup of
PasswordHashProviders by stored envelope metadata.
The registry resolves providers by the providerId that is
embedded in the envelope — not by the active policy.
That way a stored hash always finds the implementation that produced
it, regardless of policy churn (CWE-693).
Construction takes a defensive copy. Duplicate providerId
values are rejected at construction time so that misconfiguration
surfaces fast (CWE-755).
-
Constructor Summary
ConstructorsConstructorDescriptionPasswordHashProviderRegistry(Collection<? extends PasswordHashProvider> providers) -
Method Summary
Modifier and TypeMethodDescriptionstatic PasswordHashProviderRegistryBuilds a registry from everyPasswordHashProviderdiscovered throughServiceLoaderon the current thread's context class loader.Returns the provider identifiers known to this registry, in registration order.Returns the providers registered with this instance.Resolves the provider associated with the given envelope metadata.
-
Constructor Details
-
PasswordHashProviderRegistry
-
-
Method Details
-
resolve
Resolves the provider associated with the given envelope metadata.- Returns:
- the matching provider, or
Optional.empty()when no provider with thatproviderIdis registered, or the registered provider declines tosupports(...)the requested algorithm
-
knownProviderIds
-
providers
Returns the providers registered with this instance. -
fromServiceLoader
Builds a registry from everyPasswordHashProviderdiscovered throughServiceLoaderon the current thread's context class loader.The global JCA provider order is not modified by this call. Providers are only registered with this registry instance; the caller decides where to hand the registry next.
-