[BE-W3A-114] Web3 Signature Security and Auditing - Step 114#657
Merged
Conversation
…to-cleanup Auth: Session expiry auto-cleanup, SEP-53 signature verification & Redis blacklist
|
@sochima2 is attempting to deploy a commit to the mAzI's projects Team on Vercel. A member of the Team first needs to authorize it. |
soomtochukwu
requested changes
May 29, 2026
Contributor
soomtochukwu
left a comment
There was a problem hiding this comment.
- see that the CI checks pass
Contributor
|
|
@sochima2 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #468
Description
Added address normalization and checksum-backed decoding using StrKey and Keypair and implemented SEP-53-style message hashing and signature decoding with decodeSignature and verifyStellarSignature.
Introduced Redis helpers and a fast blacklist lookup (isSessionBlacklisted) with a 1ms budget and hashed blacklist keys, plus bearer-token/cookie extraction and secure cookie parameters (lance_session).
Wrapped challenge upsert and session creation/cleanup in prisma.$transaction calls using ReadCommitted isolation and added cleanup_expired_sessions usage to keep tables trimmed.
Added PostgreSQL B-tree indexes and a migration 20260529000001_session_expiry_cleanup.sql plus corresponding Prisma schema indexes for expires_at on sessions and auth_challenges.
Added GET /session route that enforces blacklist checks and expiry validation, and added a lightweight test mockup at backend/scripts/auth-helpers.test.ts and wired npm test to run it.
Testing
Ran npx prisma generate to refresh the client and it completed successfully.
Ran the auth helper mock script via npm test (executes ts-node scripts/auth-helpers.test.ts) and the assertions passed.
Built the TypeScript project with npm run build (runs tsc) and the build completed successfully.