Skip to content

feat(auth): export SEP-53 helpers, add createAuthRouter DI factory, R…#656

Merged
soomtochukwu merged 1 commit into
DXmakers:mainfrom
Jayy4rl:feat/web3-auth-hardening-471-474
May 29, 2026
Merged

feat(auth): export SEP-53 helpers, add createAuthRouter DI factory, R…#656
soomtochukwu merged 1 commit into
DXmakers:mainfrom
Jayy4rl:feat/web3-auth-hardening-471-474

Conversation

@Jayy4rl
Copy link
Copy Markdown

@Jayy4rl Jayy4rl commented May 29, 2026

…BAC middleware, and session-hijacking guard

Closes #471,
Closes #472,
Closes #473,
Closes #474

…BAC middleware, and session-hijacking guard

- Export sanitizeStellarAddress (no-trim, strict checksum), buildChallenge,
  verifyStellarSignature, isChallengeFresh, isSessionRevoked (5ms timeout
  budget), and createAuthRouter for dependency-injection in tests (DXmakers#474, DXmakers#473)
- createAuthRouter wires to injected prismaClient/redisClient, uses the
  sessions table, returns 401 for missing/expired challenges, and atomically
  consumes each challenge with deleteMany to block replay attacks (DXmakers#473, DXmakers#472)
- Add backend/src/middleware/rbac.ts: requireRole(...roles) guards routes by
  the role claim in the JWT (freelancer | client | admin) (DXmakers#471)
- authGuard: add role? field to AuthRequest; validate address claim is a
  canonical Ed25519 Stellar key before trusting it (session-hijacking guard
  for DXmakers#472); import UserRole type from rbac.ts

Closes DXmakers#471, DXmakers#472, DXmakers#473, DXmakers#474
@Jayy4rl Jayy4rl requested a review from soomtochukwu as a code owner May 29, 2026 15:36
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

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

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@Jayy4rl Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@soomtochukwu soomtochukwu merged commit 0d510f1 into DXmakers:main May 29, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants