Skip to content

feat: add CORS allowlist enforcement on /api/audit - #715

Open
Muneerat wants to merge 1 commit into
Predictify-org:mainfrom
Muneerat:feature/audit-cors-allowlist
Open

feat: add CORS allowlist enforcement on /api/audit#715
Muneerat wants to merge 1 commit into
Predictify-org:mainfrom
Muneerat:feature/audit-cors-allowlist

Conversation

@Muneerat

Copy link
Copy Markdown

Enforce AUDIT_CORS_ALLOWED_ORIGINS env var on /api/audit (deny by default; preflight cached 600s). Follows same pattern as marketsCors/webhookCors.

  • Add AUDIT_CORS_ALLOWED_ORIGINS to env schema
  • Add auditCors() factory to src/middleware/cors.ts
  • Apply auditCors() early in auditRouter
  • 16 new focused tests in tests/auditCors.test.ts
  • Updated colocated audit tests with Origin headers
  • Documented in .env.example

Closes #589

Enforce AUDIT_CORS_ALLOWED_ORIGINS env var on /api/audit (deny by default;
preflight cached 600s). Follows same pattern as marketsCors/webhookCors.

- Add AUDIT_CORS_ALLOWED_ORIGINS to env schema
- Add auditCors() factory to src/middleware/cors.ts
- Apply auditCors() early in auditRouter
- 16 new focused tests in tests/auditCors.test.ts
- Updated colocated audit tests with Origin headers
- Documented in .env.example

Closes Predictify-org#589
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Muneerat 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

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.

Add CORS allowlist enforcement on /api/audit [b#015]

1 participant