forked from 0xWheatyz/SPARC
Refuse to start with default JWT secret in non-development environments #1350
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 fallback secretsparc-secret-key-change-in-productionthat is used whenJWT_SECRETis unset. This is a serious security risk in production deployments.What to do
auth.py(or the application entrypoint) that detects when the default secret is in use.development(check viaAPP_ENVor similar env var), raise a fatal error and refuse to start.JWT_SECRET.Acceptance criteria
JWT_SECRETset in a non-dev environment exits with a non-zero code and a descriptive error message.developmentmode withoutJWT_SECRETset logs a warning but proceeds.[Repo Manager] This issue has already been resolved on the main branch. Verified by code inspection during triage. Closing.