Description
Several backend routes accept a Stellar public key as a path or query param but do not validate its format, leading to confusing on-chain errors. Add format validation and return HTTP 400 early when the address is invalid.
Requirements
- Validate Stellar address format (starts with
G, 56 chars) in affected routes
- Return 400 with a descriptive message on invalid input
- Add tests for valid and invalid address inputs
Acceptance Criteria
Expected files to change
backend/src/stellar/stellar.controller.ts
backend/src/vault/vault.controller.ts
backend/src/auth/auth.controller.ts
Commit: fix: return 400 on invalid Stellar address in backend routes
Branch: fix/backend-stellar-address-validation | Priority: MEDIUM | Difficulty: one-coffee
Description
Several backend routes accept a Stellar public key as a path or query param but do not validate its format, leading to confusing on-chain errors. Add format validation and return HTTP 400 early when the address is invalid.
Requirements
G, 56 chars) in affected routesAcceptance Criteria
Expected files to change
backend/src/stellar/stellar.controller.tsbackend/src/vault/vault.controller.tsbackend/src/auth/auth.controller.ts