Token Blocklist
Component Detail
Infrastructure
medium complexity
Shared Component
backend
0
Dependencies
1
Dependents
1
Entities
0
Integrations
Description
Short-lived storage for revoked JWT access token JTIs to ensure immediate revocation takes effect within the token's remaining TTL. Implemented as a database blocklist table for MVP (Redis upgrade path available post-MVP). Checked on every authenticated request via middleware.
token-blocklist
Responsibilities
- Store revoked access token JTIs with TTL matching the token's remaining lifetime
- Check incoming JTIs against the blocklist on every authenticated request
- Purge expired blocklist entries to prevent unbounded table growth
- Provide fast lookup to minimize per-request latency
Interfaces
addToBlocklist(jti: string, expiresAt: Date): void
isBlocked(jti: string): boolean
purgeExpired(): void
getBlocklistSize(): number