forked from 0xWheatyz/SPARC
Add startup check to refuse default JWT secret in non-dev environments #67
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
auth.pyships with a fallback secretsparc-secret-key-change-in-productionthat will be used ifJWT_SECRETis unset. This is a critical security gap for production deployments.Work
main.pyorauth.py) that detects whenJWT_SECRETmatches the default value and the environment is not development.ENVIRONMENTenv var (e.g.,development/production)..env.exampleto documentJWT_SECRETandENVIRONMENT.Acceptance Criteria
JWT_SECRETset in a non-dev environment raises a startup error and exits non-zero.ENVIRONMENT=developmentwith the default secret emits a warning but proceeds.References
Roadmap: Security hardening — rotate default JWT secret.
Resolved. JWT startup guard implemented in PR #27 (merged). The application refuses to start with the default JWT secret in non-dev environments. Code is in
SPARC/auth.py.