forked from 0xWheatyz/SPARC
Refuse to start with default JWT secret in non-development environments #849
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.Work to do
auth.py(or startup logic), add a check that reads theJWT_SECRETenvironment variable.JWT_SECRETequals the default fallback value AND the environment is not development (e.g.,APP_ENV != "development"), raise a fatal error and refuse to start.Acceptance criteria
JWT_SECRETunset or set to the default value in a non-development environment raises a startup error.APP_ENV=developmentwith the default secret logs a warning but does not block startup.Resolved in codebase. check_jwt_secret() in SPARC/auth.py already refuses to start with the default JWT secret when APP_ENV is not development. Closing as implemented.