forked from 0xWheatyz/SPARC
Refuse startup with default JWT secret in non-development environments #683
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. If deployed to production without setting this env var, tokens are signed with a publicly known key.Work to do
JWT_SECRETequals the default valueENV != "development"or equivalent), raise a clear error and refuse to start.env.example/ READMEAcceptance criteria
ENV=production(or no ENV set) exits with a descriptive error messageENV=developmentsucceeds but logs a warningClosing as already implemented. JWT startup guard was added in PR #27 (feature/p1-security-hardening). The application now refuses to start with a default JWT secret in non-development environments. See SPARC/auth.py.