forked from 0xWheatyz/SPARC
Add startup check to reject default JWT secret in non-dev environments #1068
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 reference: P1 / Security hardening
auth.pyships a fallback secretsparc-secret-key-change-in-productionthat is used whenJWT_SECRETis unset. This means the app can silently start in production with a well-known, guessable secret.What to do
auth.py(or application startup), readJWT_SECRETfrom the environment.APP_ENV != "development"orDEBUG != "true").Acceptance criteria
JWT_SECRETis unset or equals the default value.READMEor.env.exampledocuments theJWT_SECRETrequirement.This issue was resolved by PR #27 (commit
47cddcb) which added a JWT startup guard that rejects the default secret in non-dev environments. Closing as complete.