Skip to content

docs: add --encryption-key to server config examples - #744

Merged
lakhansamani merged 2 commits into
mainfrom
docs/encryption-key-examples
Aug 7, 2026
Merged

docs: add --encryption-key to server config examples#744
lakhansamani merged 2 commits into
mainfrom
docs/encryption-key-examples

Conversation

@lakhansamani

@lakhansamani lakhansamani commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Documentation follow-up to the at-rest key change in #742. No code.

perf/README.md starts the server with RS256 and no --encryption-key — that combination now exits at startup:

Error: --encryption-key is required: no encryption key is set and --jwt-secret is
empty (normal for RSA/ECDSA JWT types), so there is nothing to fall back to.

Verified against a binary built from this branch: RS256 without the key exits, RS256 with it boots, HS256 without it boots via the --jwt-secret fallback.

  • perf/README.md — adds the flag to the RS256 invocation and to the prose flag list
  • README.md, MIGRATION.md — HMAC examples set a distinct key; rotating --jwt-secret otherwise re-keys TOTP secrets and locks out enrolled users
  • MIGRATION.md — env→flag table gains an --encryption-key row marked new in 2.4.0, plus the RS*/ES* requirement in the JWT prose

Review fixes (2nd commit)

  • CHANGELOG.md — the 2.4.0 --encryption-key entry contradicted itself: it said the server refuses to start without the key, then said TOTP is disabled with a warning "rather than the server failing closed". It fails closed — cmd/root.go PersistentPreRunE returns Config.ValidateEncryptionKey's error. Stale clause dropped.
  • CHANGELOG.md — recovery codes were listed among the secrets encrypted at rest. They are unkeyed SHA-256 digests (crypto.HashRecoveryCode) and are unaffected by key rotation; replaced with the OTP digests the key actually protects. Also documents the HMAC startup warning, which is the reason the HS256 examples above set a distinct key.
  • perf/README.md — fixed key instead of $(openssl rand -hex 32), so restarting against the persistent authorizer_perf DB keeps at-rest data readable.
  • MIGRATION.md — v1 column reads _(none — new in 2.4.0)_ so the italic doesn't look like a v1 env var name.

Docs site counterpart: authorizerdev/docs#81.

2.4.0 stops deriving the at-rest key from --jwt-secret. The perf guide
starts the server with RS256 and no --encryption-key, which now refuses
to boot. README and MIGRATION examples are HMAC and still fall back, but
a distinct key keeps --jwt-secret rotation from re-keying TOTP secrets.
@lakhansamani
lakhansamani force-pushed the docs/encryption-key-examples branch from 44eb071 to de69bd1 Compare August 6, 2026 16:02
Entry contradicted itself: claimed the server refuses to start without
--encryption-key, then said TOTP is disabled with a warning "rather than
failing closed". Code fails closed — cmd/root.go PersistentPreRunE returns
Config.ValidateEncryptionKey's error. Dropped the stale clause.

Recovery codes were listed as encrypted at rest; they are unkeyed SHA-256
digests (crypto.HashRecoveryCode) and survive key rotation. Replaced with
the OTP digests the key actually protects (config.go ValidateEncryptionKey).

Added the HMAC startup warning (cmd/root.go) — the jwt-secret fallback makes
--jwt-secret rotation lock out enrolled TOTP users, which is why the HS256
examples in this PR set a distinct key.

perf: fixed encryption key instead of `openssl rand`, so restarts against
the persistent authorizer_perf DB keep at-rest data readable.
@lakhansamani
lakhansamani merged commit 213177c into main Aug 7, 2026
3 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