feat: implement challenge-response wallet session token generation sub-module (#16)#107
Open
Husten150 wants to merge 2 commits into
Open
feat: implement challenge-response wallet session token generation sub-module (#16)#107Husten150 wants to merge 2 commits into
Husten150 wants to merge 2 commits into
Conversation
…b-module Implements issue VeriNode-Labs#16 - Challenge-Response Wallet Session Token Generation. Adds: - POST /api/v1/auth/challenge - generates 32-byte random nonce, stores in memory store with 5-min TTL, returns nonce (base64) and serverId - POST /api/v1/auth/verify - validates nonce existence/expiry, IP binding, Stellar StrKey format, Ed25519 signature of SHA256(nonce || serverId); on success issues JWT access token (1h) and refresh token (7d) - POST /api/v1/auth/refresh - refresh token rotation with single-use invalidation of old refresh token - SessionMiddleware - extracts JWT from Authorization: Bearer header, verifies signature using RS256 public key, attaches nodeId to req - Rate limiting - 10/ip/min on challenge, 5/ip/min on verify - In-memory NonceStore abstraction for challenge records & refresh hashes - 22 integration tests covering full auth flow, replay protection, invalid signatures, session middleware, refresh rotation
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.
Closes #16
Summary
Implements the Challenge-Response Wallet Session Token Generation Sub-Module for passwordless authentication using Stellar wallet keypairs.
Endpoints
Components
Security Features
Testing