docs: add --encryption-key to server config examples - #744
Merged
Conversation
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
force-pushed
the
docs/encryption-key-examples
branch
from
August 6, 2026 16:02
44eb071 to
de69bd1
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documentation follow-up to the at-rest key change in #742. No code.
perf/README.mdstarts the server withRS256and no--encryption-key— that combination now exits at startup:Verified against a binary built from this branch:
RS256without the key exits,RS256with it boots,HS256without it boots via the--jwt-secretfallback.perf/README.md— adds the flag to the RS256 invocation and to the prose flag listREADME.md,MIGRATION.md— HMAC examples set a distinct key; rotating--jwt-secretotherwise re-keys TOTP secrets and locks out enrolled usersMIGRATION.md— env→flag table gains an--encryption-keyrow marked new in 2.4.0, plus the RS*/ES* requirement in the JWT proseReview fixes (2nd commit)
CHANGELOG.md— the 2.4.0--encryption-keyentry 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.goPersistentPreRunEreturnsConfig.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 persistentauthorizer_perfDB 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.