-
Notifications
You must be signed in to change notification settings - Fork 60
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
hashi_vault - refactor tests with mount_point capabilities. fix jwt mount_point options #31
Merged
briantist
merged 4 commits into
ansible-collections:main
from
briantist:jwt/mount_point
Dec 21, 2020
Merged
hashi_vault - refactor tests with mount_point capabilities. fix jwt mount_point options #31
briantist
merged 4 commits into
ansible-collections:main
from
briantist:jwt/mount_point
Dec 21, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
briantist
added a commit
to briantist/community.hashi_vault
that referenced
this pull request
Dec 20, 2020
Codecov Report
@@ Coverage Diff @@
## main #31 +/- ##
==========================================
+ Coverage 63.67% 63.98% +0.30%
==========================================
Files 1 1
Lines 234 236 +2
Branches 41 42 +1
==========================================
+ Hits 149 151 +2
Misses 71 71
Partials 14 14
Continue to review full report at Codecov.
|
@erikgb might you have a chance to review and/or test this? |
briantist
force-pushed
the
jwt/mount_point
branch
from
December 21, 2020 16:16
0ce09fa
to
2b97ade
Compare
Co-authored-by: Felix Fontein <felix@fontein.de>
felixfontein
approved these changes
Dec 21, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
SUMMARY
Fixes #29
mount_point
in a few ways:mount_point
parameter is specifically left out of the calls to the lookup; this will catch a situation where the default path that's set via thevault
CLI (when we set up the method) and the default path used byhvac
(when we use it in the plugin), differ. It's an unlikely event, and one that isn't quite our place to fix but something we should be aware of.mount_point
parameter. This ensures that the parameter is being sent intohvac
when supplied. This catches the situation in Parameter 'mount_point' does not work with JWT auth #29 where we thought we were passing the parameter in but had the wrong name (in this case due to JWT doing something different JWT auth uses a non-standard parameter name for mount_point hvac/hvac#655)mount_point
parameter #7 : in that case, themount_point
parameter in the plugin was completely ignored. This results in the request being sent to vault with nomount_point
, so using the default path. Since we just duplicate the policy in our test environment though, that would result in "alternate" mount point tests all being successful in this scenario, because under the hood they are using the default auth method mount which has all the permissions needed.secret5
. The main test policy is denied access to that secret while the alternate policy has all the same access as the main one except that it can also readsecret5
. A new test was added to each auth method trying to accesssecret5
and expecting failure on the default mount while expecting success otherwise.mount_point
parameter #7 is a little bit special since we don't test the AWS auth method at all, but I'll introduce a new PR after this one that attempts to do some basic tests on the auth method (without actually interacting with AWS) to see what we can put in place, including trying to catch something like that.ISSUE TYPE
COMPONENT NAME
hashi_vault.py
ADDITIONAL INFORMATION