Go to file
zerosaturation 293c7b14ae fix(security): JWT key governance — MustInit fail-fast + atomic.Value
- pkg/jwt: 删 public SetSecret; 加 MustInit(secret string) 启动时强制注入,
  缺/为空/等于弱默认值时返回 error(运行期不可再改); 密钥用 atomic.Value
  存 []byte,所有读走 mustSecret() 原子 Load,消除 SetSecret/ParseToken 并发
  data race(go test -race 零告警)。
- gateway main + auth_provider: 启动时 MustInit 读 JWT_SECRET env,失败 fatal。
- scripts/loadgen/seed/tokens: 同步 MustInit。
- .env.example: JWT_SECRET 改为 ≥32 字节 base64 示例(原为空,被 MustInit
  立即拒);注释提示生产 MUST replace。
- 测试: 4 个 MustInit 行为 + 1 个 50-goroutine race 覆盖。
- 行为变更: 任何 .env 缺 JWT_SECRET 或用占位 secret 的服务,启动会 panic
  (这是 fail-fast 期望行为);其余 4 个 .env 文件占位由 ops 单独轮换。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-23 18:50:12 +08:00
.agents/skills
.tmp feat:增加二维码验证真伪的功能 2026-07-13 11:22:56 +08:00
backend fix(security): JWT key governance — MustInit fail-fast + atomic.Value 2026-07-23 18:50:12 +08:00
docker fix:notification/moderation service healthcheck 配置错误 2026-07-21 12:12:46 +08:00
docs docs: backend audit report 2026-07-21 (findings + corrections) 2026-07-23 01:11:13 +08:00
frontend fix:补齐appBUG 2026-07-22 16:29:39 +08:00
k8s
mock
scripts
.gitignore
AGENTS.md
CLAUDE.md docs:新增后端bug修改文档 2026-07-21 21:14:22 +08:00
README.md

TopFans