Skip to content

Use fixed order when loading Age identities - #2307

Open
k3a wants to merge 1 commit into
getsops:mainfrom
k3a:main
Open

k3a wants to merge 1 commit into
getsops:mainfrom
k3a:main

Conversation

@k3a

@k3a k3a commented Sep 28, 2026

Copy link
Copy Markdown

Documentation for Age says:

You can override the default lookup by:
    setting the environment variable SOPS_AGE_KEY_FILE;
    setting the SOPS_AGE_KEY environment variable;
    providing a command to output the age keys by setting the SOPS_AGE_KEY_CMD environment variable. This command can read the age recipient for which to return the private key from the SOPS_AGE_RECIPIENT environment variable.

But the original loadIdentities() code used a map which caused the order of identities to be random so sometimes SOPS_AGE_KEY_FILE would not take precedence over keys in the home directory, for example.

This fixes it by using a slice instead.

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