Skip to content

Fix predictable gateway API keys - #411

Merged
akordavid373 merged 1 commit into
connect-boiz:mainfrom
telemarkdigital-publisher:fix-gateway-api-key-security-384
Aug 25, 2026
Merged

Fix predictable gateway API keys#411
akordavid373 merged 1 commit into
connect-boiz:mainfrom
telemarkdigital-publisher:fix-gateway-api-key-security-384

Conversation

@telemarkdigital-publisher

Copy link
Copy Markdown
Contributor

Closes #384. Summary: replaces Math.random-based gateway API key creation with APIKeyManager-backed crypto keys, redacts stored key hashes from API responses, wires list/revoke endpoints to the real manager, passes request context into gateway key validation, and adds per-key rate-limit/revocation coverage. Verification: npm test -- --runTestsByPath src/gateway/tests/APIKeyManager.test.ts --runInBand; npx eslint src/gateway/APIKeyManager.ts src/gateway/PrivacyApiGateway.ts src/routes/gateway.ts src/gateway/tests/APIKeyManager.test.ts; npx prettier --check src/gateway/APIKeyManager.ts src/gateway/PrivacyApiGateway.ts src/routes/gateway.ts src/gateway/tests/APIKeyManager.test.ts. Also ran npm run type-check; it exits via the repo's non-blocking script but still reports pre-existing unrelated repo-wide errors such as missing @stellar/shared and existing worker/service type issues.

@akordavid373
akordavid373 merged commit f802099 into connect-boiz:main Aug 25, 2026
8 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.

Gateway API keys generated with Math.random() — predictable keys forge gateway authentication

2 participants