Record Class PasswordHistoryPolicy
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.history.PasswordHistoryPolicy
- Record Components:
enabled- whether the history check runs at allretainLast- how many historical verifiers to keep per user; only consulted whenenabledis true
Opt-in password-history policy.
Trade-off
Password history rejects reuse of the last N passwords, which can reduce easy rotation cycles. The trade-off is real, however: every stored verifier is an additional attack surface (CWE-522). The Konzept ยง15 explicitly recommends keeping password history off by default and never enabling it together with forced periodic rotation โ that combination drives users toward the weakest possible incremental passwords.
-
Constructor Summary
ConstructorsConstructorDescriptionPasswordHistoryPolicy(boolean enabled, int retainLast) Creates an instance of aPasswordHistoryPolicyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic PasswordHistoryPolicydisabled()History disabled โ the production default.booleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static PasswordHistoryPolicyretain(int retainLast) History enabled withretainLastverifiers per user.intReturns the value of theretainLastrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PasswordHistoryPolicy
public PasswordHistoryPolicy(boolean enabled, int retainLast) Creates an instance of aPasswordHistoryPolicyrecord class.- Parameters:
enabled- the value for theenabledrecord componentretainLast- the value for theretainLastrecord component
-
-
Method Details
-
disabled
History disabled โ the production default. -
retain
History enabled withretainLastverifiers per user. -
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
enabled
-
retainLast
public int retainLast()Returns the value of theretainLastrecord component.- Returns:
- the value of the
retainLastrecord component
-