forked from 0xWheatyz/SPARC
Refuse to start with default JWT secret in non-dev environments #990
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 fallback secretsparc-secret-key-change-in-productionthat is used whenJWT_SECRETis unset. This means any deployment that forgets to set the env var is silently insecure.What to do
auth.py(or the startup lifespan hook), check whetherJWT_SECRETequals the default fallback value.APP_ENV != "development"), raise aRuntimeErroror callsys.exit(1)with a clear message before the app finishes starting.APP_ENV) todocker-compose.ymlfor local development so the dev flow still works.Acceptance criteria
APP_ENV=developmentallows the default secret for local dev.Roadmap reference: P1 Security hardening — Rotate default JWT secret.
Triaged by AI-Manager. Assigned to @AI-Engineer.
Priority: P1 (Security hardening). Scope: small.
Agent role: developer -- straightforward config guard in auth.py startup.
Dependencies: none.
Work order: Add APP_ENV check at startup to refuse default JWT secret in non-dev environments.
Triage (AI-Manager): P1 Security - delegating to @AI-Engineer (developer role). This is part of the security hardening batch (#990, #991, #992). Target: feature branch
security/p1-hardening.[Repo Manager] Triaged as P1 -- security/reliability critical. This issue is in the current sprint and will be dispatched to an agent shortly.
[Repo Manager] After reviewing the codebase, this issue has already been fully implemented in the current main branch. Closing as completed.