feat: API key rotation, input sanitization, DB pooling config, CORS env docs - #429
Merged
nonsobethel0-dev merged 1 commit intoAug 26, 2026
Conversation
|
@hardcordev 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a zero-downtime API key rotation mechanism with a grace period, global input sanitization for user-provided strings, explicit Prisma connection pool configuration for production, and full CORS configuration documentation with env-var configurability.
Changes
OperatorAuthGuardnow accepts rotated-out keys viaORACLE_OPERATOR_API_KEY_PREVIOUS/ADMIN_API_KEY_PREVIOUSduring a configurable grace window (API_KEY_ROTATION_GRACE_MINUTES, default 24h measured from process start), so compromised keys can be replaced without downtime or manual intervention.InputSanitizationMiddleware(src/common/middleware/input-sanitization.middleware.ts), registered globally on the Express adapter inmain.tsright after the body parsers, trims and escapes angle brackets in every string of JSON/urlencoded request bodies before validation/persistence.PrismaServiceapplies explicit pool parameters to the datasource URL at runtime (connection_limit=10,pool_timeout=10,connect_timeout=5), overridable viaDATABASE_CONNECTION_LIMIT,DATABASE_POOL_TIMEOUT,DATABASE_CONNECT_TIMEOUT, or params already present inDATABASE_URL.CORS_METHODS,CORS_ALLOWED_HEADERS, andCORS_CREDENTIALS(defaults unchanged from the previously hardcoded values); documented in code,.env.example, and a new README "CORS configuration" section.Issues
Resolves #379
Resolves #380
Resolves #381
Resolves #382
Verification
Manual code review only: full diff inspected against all four issues; existing architecture, naming, and conventions kept; no unrelated changes, snapshots, or generated files touched.
cargo buildandcargo testwere not run (not applicable — TypeScript repo); npm build/jest were also not run per job policy.