Class RehashDecisionEngine
java.lang.Object
com.svenruppert.jsentinel.credential.password.rehash.RehashDecisionEngine
Computes whether a successfully verified envelope must be
transparently rehashed under the active policy.
Reasons are evaluated in a deterministic precedence so two
verifications of the same envelope under the same policy always
yield the same RehashReason.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecide(PasswordHashEnvelope envelope, PasswordHashPolicy policy) Legacy two-argument overload that ignores pepper rotation.decide(PasswordHashEnvelope envelope, PasswordHashPolicy policy, Optional<String> activePepperKeyId)
-
Constructor Details
-
RehashDecisionEngine
public RehashDecisionEngine()
-
-
Method Details
-
decide
Legacy two-argument overload that ignores pepper rotation. Equivalent to callingdecide(PasswordHashEnvelope, PasswordHashPolicy, Optional)withOptional.empty(). -
decide
public RehashDecision decide(PasswordHashEnvelope envelope, PasswordHashPolicy policy, Optional<String> activePepperKeyId) - Parameters:
envelope- parsed envelope that the provider just verifiedpolicy- active policyactivePepperKeyId- currently active pepper key id, orOptional.empty()when peppering is disabled. A mismatch with the envelope's pepper key id triggersRehashReason.PEPPER_KEY_ROTATED.
-