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

added support for the ansible vault v1.2 payload format #10

Merged
merged 1 commit into from
Dec 21, 2021

Conversation

DictumMortuum
Copy link

Hello,

Thanks for the update to the original code. We're using the ansible vault payload format v1.2, which supports labels: https://docs.ansible.com/ansible/latest/user_guide/vault.html#ansible-vault-payload-format-1-1-1-2

Could you please check this PR?

Regards,
Dimitris

@clok
Copy link
Owner

clok commented Dec 20, 2021

Sorry for the delay in looking at this! Will take a look.

@clok
Copy link
Owner

clok commented Dec 20, 2021

@DictumMortuum Opened up this PR #12

Thank you for the submission. I really appreciate it. I wanted to add some more details to the update and prepare for integration with the Go port of ansible vault that I maintain as well (gwvault). Let me know your thoughts. There are some nuances that I will need to work out in gwvault that may result in some interface changes, but at the surface level, the Encrypt method will now support labels (vaultIDs) with that PR.

@clok clok self-requested a review December 20, 2021 05:40
@DictumMortuum
Copy link
Author

@clok The only reason that I created another Encrypt function was because I didn't want to break the API. I think that you can use variadic functions https://gobyexample.com/variadic-functions to avoid that as well, didn't thought of this before :)

@clok
Copy link
Owner

clok commented Dec 20, 2021

@DictumMortuum For sure. I was considering a major version bump to coincide with an interface change. Personally, I am not a fan of ordered parameters and rather structured interfaces. That would be a part of the version bump.

Variadic functions are useful, but in this case would rely on ordering to ensure they are used correctly. Good suggestion, but in this case I don't think it will be a good option.

I think the middle ground here is to create a new exported function (like you have done) and do a minor version bump. Then I will follow up with a major version update that uses an interface for structured parameters to the methods. I can then use that major version release in the gwvault tool to support these new features.

@clok clok merged commit 25f9ee0 into clok:main Dec 21, 2021
@clok
Copy link
Owner

clok commented Dec 21, 2021

@DictumMortuum Thank you for the contribution. Merged and published in v2.2.0

I will be following up with an interface changed as noted above.

@clok
Copy link
Owner

clok commented Dec 21, 2021

In case you are curious, here is a WIP PR for the v3 bump #13

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.

2 participants