Skip to content

feat(backend): implement JWT auth with Stellar wallet signature#45

Merged
Xuccessor merged 1 commit into
BountyOnChain:mainfrom
Blaqkenny:feat/jwt-stellar-auth
May 20, 2026
Merged

feat(backend): implement JWT auth with Stellar wallet signature#45
Xuccessor merged 1 commit into
BountyOnChain:mainfrom
Blaqkenny:feat/jwt-stellar-auth

Conversation

@Blaqkenny
Copy link
Copy Markdown
Contributor

Summary

Implements JWT authentication via Stellar wallet signature as described in #8.

Changes

  • GET /auth/challenge?address=G... — returns a one-time hex nonce (stored in-memory, 5-min TTL)
  • POST /auth/verify { address, signature, nonce } — verifies the Stellar keypair signature using @stellar/stellar-sdk, issues a 24h JWT signed with JWT_SECRET
  • JwtAuthGuard applied to POST, PATCH, DELETE on /bounties
  • Replay protection: nonce is deleted after first successful use
  • 7 unit tests covering all verify scenarios

Tested

  • npm test — 7/7 passing
  • npm run build — no errors

Closes #8

…tyOnChain#8)

- Add AuthModule with GET /auth/challenge and POST /auth/verify
- Verify Stellar keypair signatures using @stellar/stellar-sdk
- Nonces stored in-memory with 5-minute TTL and replay protection
- JWT signed with JWT_SECRET env var, 24h expiry
- JwtAuthGuard applied to POST/PATCH/DELETE /bounties routes
- 7 unit tests covering challenge generation and verify flow
Copy link
Copy Markdown
Contributor

@Xuccessor Xuccessor left a comment

Choose a reason for hiding this comment

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

LGTM

@Xuccessor Xuccessor merged commit 920a9b2 into BountyOnChain:main May 20, 2026
3 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

Development

Successfully merging this pull request may close these issues.

feat(backend): implement JWT authentication with Stellar wallet signature

2 participants