Record Class SelectorVerifierToken
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.token.SelectorVerifierToken
Two-part token used for password-reset, email-verification and
remember-me flows.
The selector is a non-secret lookup key persisted next to
the digest of the verifier; it lets the store find the right record
in O(1) without scanning. The verifier is the secret half
— exposed only on the wire while the user clicks the link and held
in a SecretValue otherwise so toString() can never
leak it (CWE-522 / CWE-209).
The wire format is selector.verifier (both Base64URL
without padding). TokenDigestService.parse(String) performs
the inverse.
-
Constructor Summary
ConstructorsConstructorDescriptionSelectorVerifierToken(String selector, SecretValue verifier) Creates an instance of aSelectorVerifierTokenrecord class. -
Method Summary
Modifier and TypeMethodDescriptionencode()Returns the wire formselector.verifier.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.selector()Returns the value of theselectorrecord component.toString()Returns a string representation of this record class.verifier()Returns the value of theverifierrecord component.
-
Constructor Details
-
SelectorVerifierToken
Creates an instance of aSelectorVerifierTokenrecord class.- Parameters:
selector- the value for theselectorrecord componentverifier- the value for theverifierrecord component
-
-
Method Details
-
encode
Returns the wire formselector.verifier. The caller is responsible for zeroing the returnedCharSequence-derived string after use. -
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 withObjects::equals(Object,Object). -
selector
Returns the value of theselectorrecord component.- Returns:
- the value of the
selectorrecord component
-
verifier
Returns the value of theverifierrecord component.- Returns:
- the value of the
verifierrecord component
-