- Labels:
backend, security, auth, stellar
Description
We must protect backend mutations (like updating expert profiles or withdrawing/refunding) by ensuring requests are signed by the private key of the Stellar account claiming ownership.
Technical Scope & Steps
- Create an Express middleware that validates signed payloads.
- Expect headers containing:
X-Stellar-Public-Key, X-Signature, and X-Auth-Nonce (or timestamp).
- Verify that the signature is valid for the public key using
@stellar/stellar-sdk (specifically using Keypair.fromPublicKey().verify(data, signature)).
- Reject requests older than 5 minutes to prevent replay attacks.
Acceptance Criteria
- Properly signed requests are authorized and pass through the middleware.
- Modifying the payload, public key, or signature triggers a strict `401 Unauthorized "response."
- Replaying a signature past the expiration window results in rejection.
backend,security,auth,stellarDescription
We must protect backend mutations (like updating expert profiles or withdrawing/refunding) by ensuring requests are signed by the private key of the Stellar account claiming ownership.
Technical Scope & Steps
X-Stellar-Public-Key,X-Signature, andX-Auth-Nonce(or timestamp).@stellar/stellar-sdk(specifically usingKeypair.fromPublicKey().verify(data, signature)).Acceptance Criteria