Skip to content

fix: validate Stellar addresses on whitelist update - #322

Merged
11 commits merged into
Goldii-locks:mainfrom
ademolacomfort:main
Aug 30, 2026
Merged

fix: validate Stellar addresses on whitelist update#322
11 commits merged into
Goldii-locks:mainfrom
ademolacomfort:main

Conversation

@ademolacomfort

Copy link
Copy Markdown
Contributor

Summary

Fixes #240 by adding Stellar address format validation (account G... or contract C...) to the POST /api/jobs/:contractId/whitelist/update payload.

Invalid Stellar addresses now return HTTP 400 Bad Request with clear validation errors before any whitelist updates are processed.

Uses the project's existing Stellar SDK validation utilities and includes comprehensive tests covering valid addresses, invalid addresses, malformed checksums, mixed address arrays, and empty inputs.

All whitelist tests pass (102/102).

closes #240

google-labs-jules Bot and others added 2 commits August 27, 2026 07:53
…endpoint

Validate Stellar address formats (G... and C...) on POST /api/jobs/:contractId/whitelist/update payload using Zod schema validation and StrKey methods from @stellar/stellar-sdk. Rejects invalid or malformed addresses with HTTP 400 Bad Request before processing any whitelist updates. Add comprehensive test suite in __tests__/whitelist-update.test.ts.

Co-authored-by: ademolacomfort <227568225+ademolacomfort@users.noreply.github.com>
…dresses

fix: validate Stellar addresses on whitelist update
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@ademolacomfort Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

google-labs-jules Bot and others added 9 commits August 27, 2026 08:25
…locks#241)

- Validate contract/job existence via RPC simulation in POST /api/jobs/:contractId/whitelist/update handler
- Return 404 Not Found when contract is not found on network
- Enforce process.env.API_KEY authentication returning 401 Unauthorized when configured
- Standardize unexpected server error handling to return safe 500 responses without stack trace leaks
- Add automated unit tests covering 200, 400, 401, 404, and 500 status codes

Co-authored-by: ademolacomfort <227568225+ademolacomfort@users.noreply.github.com>
…locks#241)

- Validate contract/job existence via RPC simulation in POST /api/jobs/:contractId/whitelist/update handler
- Return 404 Not Found when contract is not found on network
- Enforce process.env.API_KEY authentication returning 401 Unauthorized when configured
- Standardize unexpected server error handling to return safe 500 responses without stack trace leaks
- Add automated unit tests covering 200, 400, 401, 404, and 500 status codes

Co-authored-by: ademolacomfort <227568225+ademolacomfort@users.noreply.github.com>
…list-response

Standardize response formats and status codes for whitelist update endpoint
…ate endpoint

Configure updateWhitelistCors and updateWhitelistSecurityHeaders middleware on POST and OPTIONS /api/jobs/:contractId/whitelist/update. Added unit tests for CORS allowed/unauthorized origins, preflight requests, and security headers.

Co-authored-by: ademolacomfort <227568225+ademolacomfort@users.noreply.github.com>
Co-authored-by: ademolacomfort <227568225+ademolacomfort@users.noreply.github.com>
Fix Goldii-locks#242: Configure CORS and Security Headers for POST /api/jobs/:contractId/whitelist/update
fix: add custom rate limit to whitelist update endpoint
@godamongstmen897 godamongstmen897 closed this pull request by merging all changes into Goldii-locks:main in 9e42e6f Aug 30, 2026
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.

Validate Stellar address formats on POST /api/jobs/:contractId/whitelist/update

2 participants