-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add an unwrap plugin/module #460
Comments
Hi @chrisdola thanks for opening this feature request. A PR for a lookup and/or module for unwrapping would be welcome if anyone would like to submit it. In the meantime, you should be able to achieve this by using There is both a module and lookup version of In the documentation for the lookup you can see an example of wrapping a secret, but unwrapping should work just as well. You would want to use I would highly recommend using the module version of |
More than happy to take a look at it. Just didn't want to put in a rando PR without an issue first. :) |
Are there any guidelines or requirements when it comes to module functionality that you all are trying to follow? Modules must support the ability to pass in multiple tokens as a dict, etc? I didn't see anything on the devel contribution page that stood out, but figured I'd at least make sure. :) |
For this use case we would not want to support taking in multiple tokens. That would be covered by Ansible's There are two ways that the unwrap endpoint can be called:
The module should support both use cases. Since the docs say that using the wrapping token in both the client token and
That's all that stands out to me at the moment, other than the general advice of ensuring you have a good local dev environment set up and can run the tests locally so that you aren't always waiting for CI. As a new contributor I will have to approve CI runs for every push. There's some info in the contributor guide on getting set up for local development: I generally look for both unit and integration tests on new content and I target 100% coverage. The existing tests should be very helpful for seeing how that's done and I can usually help figure out any small gaps in coverage. Thank you for your interest! |
Also here are the docs on |
Perfect. Thanks! |
SUMMARY
The existing plugins/modules for the HashiVault collection do not provide a method to unwrap a token.
ISSUE TYPE
In some cases, the playbook will be given a wrapped token at execution time that needs to first be unwrapped before calling vault login. There is no ability to call the unwrap endpoint via the hashivault plugins.
COMPONENT NAME
vault_unwrap
ADDITIONAL INFORMATION
It would be much more streamlined if the unwrap endpoint was exposed via a lookup plugin or module so that we don't need to use a basic uri module first to call vault unwrap before using the hashivault plugins.
"{{ lookup('community.hashi_vault.vault_unwrap', url='https://vault', token='wrapped_token') }}"
The text was updated successfully, but these errors were encountered: