Skip to content

V17: Drop the hardcoded fallback JWT secret from the auth docs - #678

Merged
LinuxDevil merged 1 commit into
mainfrom
v17-auth-docs-secret
Oct 19, 2026
Merged

LinuxDevil merged 1 commit into
mainfrom
v17-auth-docs-secret

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Fixes audit finding SEC-10 (Vercel competitor audit, 2026-10-19).

What was wrong

docs/auth.md showed jwt({ secret: process.env.JWT_SECRET ?? 'a-development-secret-of-32-bytes!!' }) (plus ?? 'ci-token', ?? 'change-me'). Copy-pasted to production, an unset env var silently used a public secret.

What changed

  • The auth.md examples read secrets through a small requireEnv() that throws at startup when unset; basic() examples use process.env.X! / no fallback. The top snippet is marked no-run (it now needs env vars).
  • Regenerated llms.txt / llms-full.txt.
  • No helper change: jwt() already throws LOUSHO_AUTH_CONFIG_INVALID for an undefined or short secret and apiToken('') throws too; added test cases for secret: undefined and secret: ''.
  • Other docs' ?? '' placeholders (channels, triggers) are empty strings, not usable secrets, and were left alone.

Tests

jwt.test.ts invalid-config table gains undefined and '' secrets (pass). Ran: tsc --noEmit, typecheck:tests, lint, docs:llms:check, verify-docs-snippets --source-only (333 snippets OK). grep for development-secret / ?? 'ci-token' / ?? 'change-me' in docs, README, examples, llms files is empty.

Changelog: Docs: auth examples no longer fall back to a hardcoded JWT secret when the env var is unset.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LinuxDevil
LinuxDevil force-pushed the v17-auth-docs-secret branch from 9460a82 to 31abf03 Compare October 19, 2026 21:12
@LinuxDevil
LinuxDevil merged commit d95e236 into main Oct 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant