forked from 0xWheatyz/SPARC
Add startup check refusing default JWT secret in non-dev environments #542
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?
Summary
auth.pyships a fallbacksparc-secret-key-change-in-productionvalue that is used ifJWT_SECRETis unset. This is a security risk in production deployments.What to do
auth.py, add a startup check (e.g. using a FastAPIlifespanevent or module-level guard) that detects whetherJWT_SECRETis set to the default value.APP_ENV != "development"), raise aRuntimeErroror log a fatal error and exit..env.exampleto documentJWT_SECRETas a required variable.Acceptance Criteria
JWT_SECRETset (or set to the default) in a non-dev environment causes the process to refuse to start with a clear error message.Reference
Roadmap item: P1 - Security hardening > Rotate default JWT secret
Triage (Repo Manager): Assigned to AI-Engineer as @developer task. P1/small -- straightforward configuration/security hardening change. Single-file edit with clear acceptance criteria.
[Repo Manager] This issue is already resolved in the current codebase.
auth.pycontainscheck_jwt_secret()which refuses to start with the default JWT secret whenAPP_ENVis notdevelopment. Closing as complete.