Skip to content

feat(apis): enforce CORS allowlist from env on /api/apis [b#055] - #1127

Merged
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
Ahbiz:feat/cors-allowlist-apis-b055
Jul 30, 2026
Merged

feat(apis): enforce CORS allowlist from env on /api/apis [b#055]#1127
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
Ahbiz:feat/cors-allowlist-apis-b055

Conversation

@Ahbiz

@Ahbiz Ahbiz commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Description

Enforces environment-driven CORS allowlist validation on the /api/apis endpoints (deny by default, preflight cached for 600s).

Changes Made

  • Implement createApisCorsMiddleware in src/middleware/cors.ts lazily parsing APIS_CORS_ALLOWED_ORIGINS
  • Wire corsMiddleware into createApisRouter in src/routes/apis.ts
  • Restore recordApisLatency helper and apisLatencyDuration histogram in src/metrics/registry.ts
  • Add focused unit tests covering deny-by-default, allowlist, credentials, and preflight caching in src/middleware/cors.test.ts

Closes #1117

- Implement createApisCorsMiddleware in src/middleware/cors.ts lazily reading APIS_CORS_ALLOWED_ORIGINS
- Wire CORS middleware into createApisRouter in src/routes/apis.ts
- Restore recordApisLatency helper in src/metrics/registry.ts
- Add unit tests for createApisCorsMiddleware in src/middleware/cors.test.ts

Closes CalloraOrg#1117
@greatest0fallt1me
greatest0fallt1me merged commit 5f52bf7 into CalloraOrg:main Jul 30, 2026
1 check 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.

Add CORS allowlist enforcement on /api/apis [b#055]

2 participants