You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: tighten CORS configuration and enhance validation checks
- Updated CORS settings in the environment configuration to prevent wildcard origins in production and staging environments, allowing only explicit origins or an empty value for mobile-only APIs.
- Added validation logic to ensure that CORS_ORIGINS is not set to '*' in production or staging, raising an error if this condition is met.
- Introduced a new property to manage CORS credentials based on the origins list.
- Enhanced deployment scripts to check for CORS configuration compliance, ensuring safer API deployment practices.
**Test snapshot:** Backend 157/157 pytest pass · Mobile tests pass
6
+
**Test snapshot:** Backend 161/161 pytest pass · Mobile tests pass
7
7
8
8
This is the **single audit document** for the repo. Use it to see what is wrong, what was already fixed, and what to tackle next. Older notes (e.g. root `debt_payment_flow_audit.md`) are folded in here; prefer **this file** for planning work.
9
9
@@ -107,12 +107,11 @@ When you fix an item, change its status here and tick the checklist box.
107
107
108
108
| Field | Value |
109
109
|-------|--------|
110
-
|**Status**|`open`|
111
-
|**Severity**| Medium (when web clients exist) |
112
-
|**What's happening**|`cors_origins` defaults to `*` with `allow_credentials=True`. |
113
-
|**Why it matters**| Fine for mobile-only MVP; risky if you add a browser admin or web app. |
|**Fix**| Set explicit origins per environment in Render/env. |
110
+
|**Status**|`done`|
111
+
|**Severity**| — |
112
+
|**What's happening**| Boot check rejects `CORS_ORIGINS=*` in **production** and **staging**; empty list allowed for mobile-only. Local dev keeps `*`. |
0 commit comments