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

aws_iam auth - rename auth method, add tests #193

Merged
merged 12 commits into from
Nov 26, 2021

Conversation

briantist
Copy link
Collaborator

@briantist briantist commented Nov 21, 2021

SUMMARY

Fixes: #118

This PR contains several changes to AWS auth support:

  • the name of the auth method is changing from aws_iam_login to aws_iam. This corrects an error that I made when introducing it, including the hvac "login" convention as part of the auth method name. That is corrected in this PR, in doc fragments, choices, class and file names, etc. The old name will work until 3.0.0 when it will be removed, and warning is displayed if the old name is used.
  • Fill out the unit tests for this method.
  • Adds mmock to the integration test dependencies and the docker localenv setup. This allows for mocking API calls and acting as a proxy. That lets us do some level of integration testing against stuff we can't easily integrate Vault with, like in this case: AWS
  • Add the integration tests for aws_iam auth!
  • Update the localenv docs for MMock
ISSUE TYPE
  • Tests/Enhancement Pull Request
COMPONENT NAME

aws_iam auth

ADDITIONAL INFORMATION

N/A

@briantist briantist added enhancement New feature or request tests Adds or modifies tests labels Nov 21, 2021
@briantist briantist added this to the v2.1.0 milestone Nov 21, 2021
@briantist briantist self-assigned this Nov 21, 2021
@briantist briantist temporarily deployed to docs-build November 21, 2021 23:45 Inactive
@briantist briantist added this to In progress in CI and Testing Improvements Nov 21, 2021
@briantist briantist temporarily deployed to docs-build November 22, 2021 01:26 Inactive
@codecov
Copy link

codecov bot commented Nov 22, 2021

Codecov Report

Merging #193 (2fc510a) into main (8852550) will increase coverage by 1.52%.
The diff coverage is 98.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #193      +/-   ##
==========================================
+ Coverage   92.43%   93.96%   +1.52%     
==========================================
  Files          41       41              
  Lines        1639     1739     +100     
  Branches      125      135      +10     
==========================================
+ Hits         1515     1634     +119     
+ Misses        111       91      -20     
- Partials       13       14       +1     
Flag Coverage Δ
env_docker-default 93.96% <98.62%> (+1.52%) ⬆️
integration 78.36% <62.50%> (+1.79%) ⬆️
sanity 37.44% <37.50%> (-0.21%) ⬇️
target_ansible-doc 100.00% <ø> (ø)
target_auth_approle 89.47% <ø> (ø)
target_auth_aws_iam 50.00% <100.00%> (?)
target_auth_cert 86.36% <ø> (ø)
target_auth_jwt 91.30% <ø> (ø)
target_auth_none 100.00% <ø> (ø)
target_auth_token 71.42% <ø> (ø)
target_auth_userpass 85.71% <ø> (ø)
target_connection_options 74.76% <ø> (ø)
target_controller 66.44% <62.50%> (-0.19%) ⬇️
target_import 37.44% <37.50%> (-0.21%) ⬇️
target_lookup_hashi_vault 81.33% <ø> (ø)
target_lookup_vault_read 90.00% <ø> (ø)
target_module_utils 93.03% <98.62%> (+1.93%) ⬆️
target_module_vault_read 92.10% <ø> (ø)
units 91.36% <98.62%> (+1.73%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
plugins/doc_fragments/auth.py 100.00% <ø> (ø)
plugins/lookup/hashi_vault.py 84.00% <ø> (ø)
...s/module_utils/authentication/test_auth_aws_iam.py 98.29% <98.29%> (ø)
plugins/module_utils/_auth_method_aws_iam.py 94.23% <100.00%> (ø)
plugins/module_utils/_authenticator.py 100.00% <100.00%> (ø)
...s/authentication/test_hashi_vault_authenticator.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8852550...2fc510a. Read the comment docs.

briantist added a commit to briantist/community.hashi_vault that referenced this pull request Nov 22, 2021
@briantist briantist temporarily deployed to docs-build November 22, 2021 20:00 Inactive
@briantist briantist temporarily deployed to docs-build November 24, 2021 20:24 Inactive
@github-actions
Copy link

github-actions bot commented Nov 24, 2021

##Docs Build 📝

Thank you for contribution!✨

This PR has been merged and the docs are now incorporated into main:
https://community-hashi-vault-main.surge.sh

@briantist briantist temporarily deployed to docs-build November 26, 2021 02:17 Inactive
@briantist briantist temporarily deployed to docs-build November 26, 2021 02:51 Inactive
@briantist briantist merged commit fc1ba25 into ansible-collections:main Nov 26, 2021
@briantist briantist moved this from In progress to Done in CI and Testing Improvements Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tests Adds or modifies tests
Development

Successfully merging this pull request may close these issues.

aws_iam_login method needs tests
2 participants