Derive generated signing key IDs from public key content#19971
Draft
gamesguru wants to merge 19 commits into
Draft
Derive generated signing key IDs from public key content#19971gamesguru wants to merge 19 commits into
gamesguru wants to merge 19 commits into
Conversation
This reverts commit d6deda7.
The deprecated one-column format was previously auto-migrated in place; a recent commit replaced that with a hard ConfigError, which would break startup for any deployment still on that old format. Restore the auto-migration, now writing the migrated key with the new content-derived key id instead of a random suffix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
generate_signing_key.py was importing a private, underscore-prefixed helper from synapse.config.key, which drags in jsonschema and the rest of the config module just to generate a key. Move the content-derived key id logic into a small standalone module with no heavy dependencies, and have both the config loader and the CLI script import from there. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Fix accidental reuse of numeric signing key IDs, i.e.,
ed25519:1, which can break federation, by phasing in content-derived key IDs.The generated IDs are normalized to stay compatible with homeservers that require spec-compliant key IDs (Dendrite, Conduit, and potentially more).
Synapse now logs a
WARNwhen it loads existing purely numeric ID signing keys. It logs anERROR(non-panicking) if the key ID is invalid per spec regex. It logs anINFOmessage if those keys appear non-content-derived.Partially (see caveats below) closes issue: #8307
NOTE: Synapse admins who configured illegal key IDs and have not upgraded will need to troubleshoot the cause of their rejections. That means if an admin already has a non-compliant key ID, they still need to replace or regenerate that key manually. This PR does not clean it up for them.
TODO: phase out/reject newly introduced non-content-derived key IDs (loaded via
signing_keyorsigning_key_path). So this PR only addresses cause 1 and there are still causes 2 and 3 left.