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

Fix "Unsafe" token values that originate from lookups #291

Merged
merged 7 commits into from
Aug 5, 2022

Conversation

briantist
Copy link
Collaborator

@briantist briantist commented Aug 5, 2022

SUMMARY

Fixes #289

Right now this is only applies to the token but the groundwork is in place to apply this to other options as needed.
The current issue affects things that will end up in headers, like the token.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

_hashi_vault_common

ADDITIONAL INFORMATION

@briantist briantist added the bug Something isn't working label Aug 5, 2022
@briantist briantist added this to the v3.2.0 milestone Aug 5, 2022
@briantist briantist self-assigned this Aug 5, 2022
@codecov
Copy link

codecov bot commented Aug 5, 2022

Codecov Report

Merging #291 (ab47eaf) into main (b053a08) will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
+ Coverage   98.41%   98.46%   +0.05%     
==========================================
  Files          68       71       +3     
  Lines        3343     3458     +115     
  Branches      290      301      +11     
==========================================
+ Hits         3290     3405     +115     
  Misses         44       44              
  Partials        9        9              
Flag Coverage Δ
env_docker-default 98.46% <100.00%> (+0.05%) ⬆️
integration 81.62% <64.70%> (-0.25%) ⬇️
sanity 39.28% <41.17%> (+<0.01%) ⬆️
target_ansible-doc 100.00% <ø> (ø)
target_auth_approle 89.47% <ø> (ø)
target_auth_aws_iam 50.00% <ø> (ø)
target_auth_cert 86.36% <ø> (ø)
target_auth_jwt 91.30% <ø> (ø)
target_auth_ldap 89.47% <ø> (ø)
target_auth_none 100.00% <ø> (ø)
target_auth_token 73.07% <100.00%> (ø)
target_auth_userpass 85.71% <ø> (ø)
target_connection_options 74.76% <ø> (ø)
target_controller 83.67% <100.00%> (+1.19%) ⬆️
target_filter_vault_login_token 77.77% <ø> (ø)
target_import 39.28% <41.17%> (+<0.01%) ⬆️
target_lookup_hashi_vault 81.33% <ø> (ø)
target_lookup_vault_ansible_settings 57.16% <64.70%> (+0.05%) ⬆️
target_lookup_vault_kv1_get 91.30% <ø> (ø)
target_lookup_vault_kv2_get 91.66% <ø> (ø)
target_lookup_vault_login 88.57% <ø> (ø)
target_lookup_vault_read 90.00% <ø> (ø)
target_lookup_vault_token_create 78.18% <ø> (ø)
target_lookup_vault_write 59.26% <64.70%> (+0.01%) ⬆️
target_module_utils 96.71% <84.37%> (-0.31%) ⬇️
target_module_vault_kv1_get 87.23% <ø> (ø)
target_module_vault_kv2_get 86.95% <ø> (ø)
target_module_vault_login 83.33% <ø> (ø)
target_module_vault_pki_generate_certificate 78.26% <ø> (ø)
target_module_vault_read 85.36% <ø> (ø)
target_module_vault_token_create 90.00% <ø> (ø)
target_module_vault_write 58.24% <64.70%> (+0.04%) ⬆️
target_modules 78.66% <41.17%> (-0.41%) ⬇️
units 95.60% <100.00%> (+0.15%) ⬆️

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

Impacted Files Coverage Δ
plugins/module_utils/_auth_method_token.py 98.07% <100.00%> (ø)
plugins/module_utils/_hashi_vault_common.py 100.00% <100.00%> (ø)
...uthentication/test_hashi_vault_auth_method_base.py 100.00% <100.00%> (ø)
...it/plugins/module_utils/test_hashi_vault_helper.py 100.00% <100.00%> (ø)
...ins/plugin_utils/authentication/test_auth_token.py 100.00% <100.00%> (ø)
.../plugin_utils/test_hashi_vault_common_stringify.py 100.00% <100.00%> (ø)
...it/plugins/plugin_utils/test_hashi_vault_helper.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@briantist
Copy link
Collaborator Author

@felixfontein thanks for reviewing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

token must be of type str or bytes, not <class 'ansible.utils.unsafe_proxy.AnsibleUnsafeText'>
2 participants