Feat/be cors csp#493
Open
NnamdiCyber wants to merge 7 commits into
Open
Conversation
- Add backend-ci.yml: lint, type-check, unit + integration tests - Add backend-release.yml: build Docker image, run migrations, deploy staging, deploy production (with manual approval gate), rollback job - Add composite actions: run-migrations and deploy-app - Add multi-stage Dockerfile and .dockerignore for backend - Deprecate old backend.yml stub Closes Pulsefy#416
- Extract CORS logic into cors.config.ts with buildCorsOptions() - Support static origin allowlist via CORS_ALLOWED_ORIGINS env var - Support Vercel preview URLs via CORS_VERCEL_PROJECT slug pattern - No wildcard in production; open in dev/test - Add CORS_ALLOWED_ORIGINS + CORS_VERCEL_PROJECT to env schema and AppConfigService - Replace hardcoded origin list in main.ts with buildCorsOptions() - 14 unit tests covering all CORS flows (allowed, blocked, preview, spoofing) Closes Pulsefy#420
|
@NnamdiCyber 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! 🚀 |
Contributor
|
Fix workflow |
Contributor
|
Fix workflow |
Contributor
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.
Closes #420
Summary
Replaces the hardcoded CORS block in main.ts with a tested, environment-driven config (#420 BE-34).
Changes
cors.config.ts—buildCorsOptions(): static allowlist, Vercel preview URL pattern, no wildcard in productionenv.schema.ts+app-config.service.ts—CORS_ALLOWED_ORIGINS,CORS_VERCEL_PROJECTenv varsmain.ts— replaced inline CORS block withbuildCorsOptions()cors.config.unit.spec.ts— 14 passing tests covering all CORS flowsAcceptance Criteria
Config required in production
CORS_ALLOWED_ORIGINS=https://quickex.to,https://app.quickex.to
CORS_VERCEL_PROJECT=quickex-frontend