feat(backend): implement SIWS message verification (#108)#272
Open
omonxooo-commits wants to merge 1 commit intoDXmakers:mainfrom
Open
feat(backend): implement SIWS message verification (#108)#272omonxooo-commits wants to merge 1 commit intoDXmakers:mainfrom
omonxooo-commits wants to merge 1 commit intoDXmakers:mainfrom
Conversation
- Add services/siws.rs: nonce generation, canonical message builder, Stellar strkey decode, ed25519 signature verification - Add routes/auth.rs: POST /api/v1/auth/nonce and /verify endpoints with one-time nonce consumption (replay-safe) - Extend AppState with in-memory NonceStore (Arc<Mutex<HashMap>>) - Register /auth router in api_router - Add APP_DOMAIN and SESSION_SECRET to .env.example - Add rand, hex, base32 dependencies to Cargo.toml
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.
Summary
Closes #108
Implements Sign-In With Stellar (SIWS) message verification on the backend.
Changes
services/siws.rs— nonce generation, canonical SIWS message builder, Stellar strkey → ed25519 pubkey decode,verify_strictsignature checkroutes/auth.rs—POST /api/v1/auth/nonceandPOST /api/v1/auth/verifywith one-time nonce consumption (replay-safe)db.rs—NonceStore(Arc<Mutex<HashMap>>) added toAppStateroutes/mod.rs—/authrouter registered under/api/v1Cargo.toml— addedrand,hex,base32deps.env.example— addedAPP_DOMAINandSESSION_SECRETAuth flow
Security
verify_strictrejects malleable signatures