Interface RememberMeTokenStore
- All Known Implementing Classes:
InMemoryRememberMeTokenStore
Persistent store for
RememberMeTokenRecords — backs the
planned "remember me" / persistent-login flow (V00.70 Phase 7).
Tokens are looked up by their hash: an auth flow receives the plain token from a client cookie, hashes it, and queries this store. The plain value never enters the store, so an attacker who exfiltrates the store cannot impersonate the subject.
Implementations must be thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionbooleandeleteByHash(String tokenHash) Removes the record for the given hash.intdeleteBySubject(TenantId tenant, SubjectId subjectId) Drops every token issued tosubjectIdwithintenant.findByHash(String tokenHash) Looks up a token record by its hash.intpurgeExpired(Instant now) Drops every token whoseexpiresAtis at or beforenow.voidsave(RememberMeTokenRecord record) Persists or replaces the supplied token record (keyed onRememberMeTokenRecord.tokenHash()).
-
Method Details
-
findByHash
Looks up a token record by its hash.- Parameters:
tokenHash- token hash; must not benullor blank- Returns:
- the record, if present
-
save
Persists or replaces the supplied token record (keyed onRememberMeTokenRecord.tokenHash()).- Parameters:
record- record to persist; must not benull
-
deleteByHash
Removes the record for the given hash.- Parameters:
tokenHash- token hash; must not benullor blank- Returns:
trueif a record was removed,falsewhen no such token existed
-
deleteBySubject
-
purgeExpired
Drops every token whoseexpiresAtis at or beforenow. Idempotent.- Parameters:
now- retention boundary; must not benull- Returns:
- number of records purged
-