Package com.irurueta.authserver.authorization.domain.account
Issues and verifies short-lived, signed, self-contained tokens (JWTs) that are bound to one purpose. The contract is deliberately independent of the account use cases so that other features can reuse it, for example the client assertions of a later issue:
issue(subject, purpose, ttl)returns a compact token whose subject, purpose and expiry are signed; the expiry is the issue instant plusttl.verify(token, purpose)returns the subject only when the signature, the issuer, the timestamps and the purpose all check out; for anything else (expired, tampered, wrong purpose, malformed) it returns an empty optional and never throws, and it never reveals which check failed.- A token proves a claim but is not single-use: anything that must be consumed once uses an
AccountTokenRepositoryinstead.
Sends the transactional e-mails of the account lifecycle. The messages are plain text and the implementation
chooses the wording and the language, never the platform's default locale. A delivery failure is reported as an
AccountMailException (never the mail framework's own
type, and never with the address or the token in it), so that the calling use case's transaction rolls back and
nothing is left stored for a message that was never delivered. The callers keep their answer independent of
whether an address is registered: every registration path sends a message, and the reset-request endpoint answers
the same even when its message cannot be delivered. The methods receive the raw token or the link material the
message must contain and never a password.
-
ClassDescriptionPort that sends the e-mails of the account lifecycle.An account message could not be delivered.A single-use token that proves the right to perform one account operation.Port that stores single-use account tokens.The presented account token is unknown, expired, already used or issued for another purpose.Port that issues and verifies signed, purpose-bound tokens.Port that creates random opaque tokens and hashes them for storage.