Package com.io7m.idstore.server.api
Record Class IdServerPasswordExpirationConfiguration
java.lang.Object
java.lang.Record
com.io7m.idstore.server.api.IdServerPasswordExpirationConfiguration
- Record Components:
userPasswordValidityDuration
- The duration for which user passwords are validadminPasswordValidityDuration
- The duration for which admin passwords are valid
public record IdServerPasswordExpirationConfiguration(Optional<Duration> userPasswordValidityDuration, Optional<Duration> adminPasswordValidityDuration)
extends Record
Configuration options relating to password expiration.
-
Constructor Summary
ConstructorDescriptionIdServerPasswordExpirationConfiguration
(Optional<Duration> userPasswordValidityDuration, Optional<Duration> adminPasswordValidityDuration) Configuration options relating to password expiration. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadminPasswordValidityDuration
record component.final boolean
Indicates whether some other object is "equal to" this one.expireAdminPasswordIfNecessary
(Clock clock, IdPassword password) Take the given password and apply an expiration date to it based on the current clock and settings.expireUserPasswordIfNecessary
(Clock clock, IdPassword password) Take the given password and apply an expiration date to it based on the current clock and settings.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.Returns the value of theuserPasswordValidityDuration
record component.
-
Constructor Details
-
IdServerPasswordExpirationConfiguration
public IdServerPasswordExpirationConfiguration(Optional<Duration> userPasswordValidityDuration, Optional<Duration> adminPasswordValidityDuration) Configuration options relating to password expiration.- Parameters:
userPasswordValidityDuration
- The duration for which user passwords are validadminPasswordValidityDuration
- The duration for which admin passwords are valid
-
-
Method Details
-
expireUserPasswordIfNecessary
Take the given password and apply an expiration date to it based on the current clock and settings.- Parameters:
clock
- The clockpassword
- The password- Returns:
- The password with a new expiration date
-
expireAdminPasswordIfNecessary
Take the given password and apply an expiration date to it based on the current clock and settings.- Parameters:
clock
- The clockpassword
- The password- Returns:
- The password with a new expiration date
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 withObjects::equals(Object,Object)
. -
userPasswordValidityDuration
Returns the value of theuserPasswordValidityDuration
record component.- Returns:
- the value of the
userPasswordValidityDuration
record component
-
adminPasswordValidityDuration
Returns the value of theadminPasswordValidityDuration
record component.- Returns:
- the value of the
adminPasswordValidityDuration
record component
-