Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier unencrypted keys access. #41

Merged
merged 7 commits into from
Jul 17, 2024
Merged

Conversation

svanhesteren
Copy link
Contributor

@svanhesteren svanhesteren commented Jul 10, 2024

Added a with_deep_deundescored_keys util method that iterates over all keys in a secrets hash and duplicates the underscored ones as de-underscored. This so we can more eassily access the unencrypted secrets without having to call it with an underscore in our rails application.

@svanhesteren svanhesteren changed the title add with_deep_deundescored_keys Easier unencrypted keys access. Jul 10, 2024
@svanhesteren svanhesteren force-pushed the easier-access-unencrypted-keys branch from 8be3338 to de3eb54 Compare July 10, 2024 16:41
end
end

describe ".with_deep_deundescored_keys" do
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: I'm wondering what would happen if we define _underscored_secret and underscored_secret in YAML?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously it would raise

Copy link
Contributor

@skatkov skatkov Jul 15, 2024

Choose a reason for hiding this comment

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

It seems reasonable to raise? Why are we changing it? We are likely to replace one value with another - and if we forgot to remove encrypted or non-encrypted value - would be great to know about it.

Maybe at least log this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed it because else you can never have an encrypted and unencrypted key with the same name, which is something you could want. It's up to the user to decide what value they need.

and don't raise on duplicate key
@svanhesteren svanhesteren requested a review from julik July 15, 2024 14:30
@svanhesteren svanhesteren marked this pull request as ready for review July 15, 2024 14:30
lib/eyaml/util.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@skatkov skatkov left a comment

Choose a reason for hiding this comment

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

LGTM 🚢

@svanhesteren svanhesteren merged commit 6698013 into main Jul 17, 2024
1 check passed
@svanhesteren svanhesteren deleted the easier-access-unencrypted-keys branch July 17, 2024 11:16
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.

3 participants