Enforce required env vars at startup — eliminate insecure defaults #7
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Critical env vars have insecure or misleading defaults that silently allow the app to start in an unsafe state:
CORS_ORIGINSdefaults to"*"(main.py:70) — any website can make credentialed requestsJWT_SECRETdefault is the literal stringyour-super-secret-jwt-key-change-in-productionCOMPLIANCE_DATABASE_URLmissing → falls back to a localhost connection that silently fails in prodRequired Actions
compliance/config.pyusing PydanticBaseSettingswith explicit required fields (no defaults for secrets)RuntimeErrorat startup if absentCORS_ORIGINSdefault to""(empty); log a WARNING if no origins are configured.env.orca.examplewith type, required/optional, and example valuesJWT_SECRETAcceptance Criteria
CORS_ORIGINS=*is not a valid value in production config.env.orca.exampleis complete and accurate