Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes are a WIP 😄
Summary
This proposal is to add different Vault authentication mechanisms to this plugin, as an alternative to using the Token directly
There are a number built into Vault that would be feasible: https://www.vaultproject.io/docs/auth
Implementation
The authentication portion is completed in the
special_auth.rb
file. Currently, configuration for IAM is only specified, however this is setup in a way that adding new authentication methods should be plug-and-playFor example, adding GitHub authentication would look like: (pseudocode)
The
client
returned from these functions would be authenticated and ready to useConfiguration Changes
To implement this, the configuration would need to be altered. The
token
section can be omitted, with a newauthentication
section added:For example, a current config may look like:
Here is a similar config, using IAM authentication:
The main difference is this snippet here:
This would allow any different form of authentication to be supported, even though they may require different configurations
The hiarchy of authentication methods are as follows:
token
specified in the configurationauthentication
specified in the configurationEach type will need to be specified in the
special_auth.rb
functionNext Steps
I'm opening this PR in WIP status to get the conversation going 😄
The following would still need to be worked on:
Are any maintainers able to provide some input into a possible testing strategy for this? I have Terraform code available to create a full end-to-end test in AWS, but not sure how well that'd fit into the current testing patterns 😅
Thanks!!
Related to #66