Skip to content

Conversation

@felixfontein
Copy link
Contributor

Depending on the output store, the keys used for storing SOPS metadata vary. For YAML, JSON, and INI files, the sops top-level key is used. For DotEnv files, keys starting with sops_ are used.

Fixes #1384.

Copy link
Contributor

@devstein devstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

// HasSopsTopLevelKey returns true if the given branch has a top-level key called "sops".
func HasSopsTopLevelKey(branch sops.TreeBranch) bool {
for _, b := range branch {
if b.Key == "sops" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not worth it for this PR, but thoughts on adding a constant for "sops"?

https://github.com/search?q=repo:getsops/sops+sops%22+language:Go&type=code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that would be a very good idea!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…t on output store.

Signed-off-by: Felix Fontein <felix@fontein.de>
@felixfontein felixfontein merged commit 3ada89e into getsops:main Dec 29, 2023
@felixfontein felixfontein deleted the encrypted-check branch December 29, 2023 21:45
@felixfontein
Copy link
Contributor Author

@devstein thanks for reviewing this!

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.

Encrypt dotenv file inplace more than once should be failsafe.

2 participants