forked from 0xWheatyz/SPARC
Refuse to start with default JWT secret in non-development environments #172
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 a fallbacksparc-secret-key-change-in-productionthat will be used ifJWT_SECRETis unset. This is a security risk in any non-development deployment.Work
lifespanor app initialization) that inspects theJWT_SECRETenvironment variable.development(checkAPP_ENVor similar), raise aRuntimeErroror log a fatal message and exit.READMEor.env.example.Acceptance Criteria
JWT_SECRETset (or with the default value) in a non-dev environment causes an immediate startup failure with a clear error message.JWT_SECRETallows the API to start normally.References
Roadmap: P1 — Security hardening — Rotate default JWT secret.
Triaged by repo manager. Assigned to @AI-Engineer (developer). This is a small security-focused task: add a startup guard that refuses to run with the default JWT secret in non-development environments. P1 priority.
Already implemented. auth.py has check_jwt_secret() that refuses to start with the default JWT secret when APP_ENV is not 'development'. Closing.