Skip to content

feat(auth): integrate Redis token blacklisting and lifecycle hooks wi…#651

Open
godamongstmen897 wants to merge 3 commits into
DXmakers:mainfrom
godamongstmen897:feature/redis-session-revocation
Open

feat(auth): integrate Redis token blacklisting and lifecycle hooks wi…#651
godamongstmen897 wants to merge 3 commits into
DXmakers:mainfrom
godamongstmen897:feature/redis-session-revocation

Conversation

@godamongstmen897
Copy link
Copy Markdown
Contributor

Summary

Closes #455. Implements a robust Redis-backed session revocation and stateless JWT blacklisting mechanism to mitigate instant session termination security risks.

What Changed

  • Lifecycle Connectivity: Enhanced the main application entry point (backend/src/index.ts) to handle asynchronous redis.connect() initialization on bootstrap and structured graceful redis.quit() cleanups during process teardown (SIGTERM).
  • Middleware Integration: Connected token validation checking constraints across routes using the authGuard.ts interceptor layer, effectively verifying incoming tokens against the Redis blacklist database.
  • Token Validity Tracking: Configured token storage tracking to persist flagged tokens with a Time-to-Live (TTL) matching their exact remaining lifespan.
  • Verification Coverage: Scaffolded a comprehensive mock validation unit test suite under backend/test/ to mimic runtime Redis lookup operations and confirm proper endpoint blocking behaviors.

Testing & Validation

  • Verified system compilation with backend TypeScript compilation blocks (npm run build).
  • Asserted mock database configurations validate fast sub-1ms interception targets.

Closes #455

Copilot AI review requested due to automatic review settings May 29, 2026 14:29
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

@godamongstmen897 is attempting to deploy a commit to the mAzI's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@soomtochukwu soomtochukwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • see that the CI checks pass

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BE-W3A-101] Implement Session Revocation and JWT Blacklisting in Redis

3 participants