Skip to content

updatekeys: detect key ordering changes - #2296

Open
ECD5A wants to merge 1 commit into
getsops:mainfrom
ECD5A:fix/updatekeys-key-order
Open

updatekeys: detect key ordering changes#2296
ECD5A wants to merge 1 commit into
getsops:mainfrom
ECD5A:fix/updatekeys-key-order

Conversation

@ECD5A

@ECD5A ECD5A commented Sep 7, 2026

Copy link
Copy Markdown

updatekeys reports "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/updatekeys

The separate config/TestLoadConfigFileWithAmbiguousPath test fails on Windows on both the baseline and this branch. Full Linux CI has not been run locally.

Fixes #2269.

Signed-off-by: ECD5A <111098024+ECD5A@users.noreply.github.com>
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.

updatekeys doesn't trigger when key ordering change

1 participant