Record Class CompromisedPasswordPolicy
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.compromised.CompromisedPasswordPolicy
public record CompromisedPasswordPolicy(boolean checkOnSetOrChange, boolean checkOnLogin, CheckFailurePolicy onFailure)
extends Record
Operator-controlled policy that governs when the compromised
password check runs and how a failed check is interpreted.
Defaults:
checkOnSetOrChange= true — NIST SP 800-63B §5.1.1checkOnLogin= false — checking on every login would leak timing information and rate-limit budget (CWE-203 / CWE-307)onFailure=CheckFailurePolicy.ALLOWfor online checkers; deployments that prefer fail-closed should set this toCheckFailurePolicy.BLOCKexplicitly.
-
Constructor Summary
ConstructorsConstructorDescriptionCompromisedPasswordPolicy(boolean checkOnSetOrChange, boolean checkOnLogin, CheckFailurePolicy onFailure) Creates an instance of aCompromisedPasswordPolicyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecheckOnLoginrecord component.booleanReturns the value of thecheckOnSetOrChangerecord component.static CompromisedPasswordPolicydefaults()Defaults: check on set / change only, allow on check failure.static CompromisedPasswordPolicydisabled()Disabled variant: no check is ever invoked.final booleanIndicates whether some other object is "equal to" this one.static CompromisedPasswordPolicyFail-closed variant: any check failure rejects the change.final inthashCode()Returns a hash code value for this object.Returns the value of theonFailurerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CompromisedPasswordPolicy
public CompromisedPasswordPolicy(boolean checkOnSetOrChange, boolean checkOnLogin, CheckFailurePolicy onFailure) Creates an instance of aCompromisedPasswordPolicyrecord class.- Parameters:
checkOnSetOrChange- the value for thecheckOnSetOrChangerecord componentcheckOnLogin- the value for thecheckOnLoginrecord componentonFailure- the value for theonFailurerecord component
-
-
Method Details
-
defaults
Defaults: check on set / change only, allow on check failure. -
failClosed
Fail-closed variant: any check failure rejects the change. -
disabled
Disabled variant: no check is ever invoked. Callers can use this to short-circuit the compromised-password pipeline without removing the SPI binding. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
checkOnSetOrChange
public boolean checkOnSetOrChange()Returns the value of thecheckOnSetOrChangerecord component.- Returns:
- the value of the
checkOnSetOrChangerecord component
-
checkOnLogin
public boolean checkOnLogin()Returns the value of thecheckOnLoginrecord component.- Returns:
- the value of the
checkOnLoginrecord component
-
onFailure
Returns the value of theonFailurerecord component.- Returns:
- the value of the
onFailurerecord component
-