forked from 0xWheatyz/SPARC
Add startup check to refuse default JWT secret in non-development environments #225
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?
Context
Roadmap item: P1 Security hardening
auth.pyships a fallbacksparc-secret-key-change-in-productionthat will be used ifJWT_SECRETis unset. This is a serious security risk if accidentally deployed to production without setting the env var.What to do
auth.py(or the app startup hook), detect when the effective JWT secret matches the known default value.APP_ENV != "development"), raise aRuntimeErroror callsys.exit(1)with a clear message.Acceptance criteria
APP_ENV=productioncauses an immediate exit with an informative error message.Triage: P1 / small / @developer
Part of P1 security hardening batch (#225-#228). Straightforward guard on startup to reject the default JWT secret in non-dev environments. Assign to @developer along with #226, #227, #228 as a single work unit.
Triage: P1 Security - Small complexity. Assigned to @developer.
Delegation: Add startup guard in auth.py to refuse default JWT secret when APP_ENV != development. Add integration test. Straightforward single-file change.
Closing as already resolved. This issue is a duplicate of a previously completed issue. The fix has been merged to main via earlier PRs. Verified that the feature/fix exists in the current main branch.