updatekeys: detect key ordering changes - #2296
Open
ECD5A wants to merge 1 commit into
Open
Conversation
Signed-off-by: ECD5A <111098024+ECD5A@users.noreply.github.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.
updatekeysreports "File already up to date" when recipients are only reordered in.sops.yaml. Detect ordering changes within each key type so the requested order is written to the encrypted file. Differences in ordering between key types are ignored because serialization does not preserve them.Tests cover a real age recipient reorder with successful decryption, unchanged ciphertext/MAC, repeat-update idempotence, and unchanged mixed PGP/age groups.
Validation on Windows with Go 1.25.8:
go test ./cmd/sops/subcommand/updatekeys ./cmd/sops/common ./stores/...go vet ./cmd/sops/subcommand/updatekeysThe separate
config/TestLoadConfigFileWithAmbiguousPathtest fails on Windows on both the baseline and this branch. Full Linux CI has not been run locally.Fixes #2269.