You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Will need to do a little more testing/evaluation, but it appears that there are two issues:
When token auth validation happens, and it looks for the token from disk (via token_path and token_file), if the token_file exists and is a directory, that condition is not properly handled and it raises an exception.
The above seems to occur even when auth_method != token; which shouldn't be the case.
Will confirm both cases and post a PR to fix.
ISSUE TYPE
Bug Report
COMPONENT NAME
module_utils/auth_methods
ANSIBLE VERSION
N/A
COLLECTION VERSION
1.3.2
CONFIGURATION
N/A
OS / ENVIRONMENT
N/A
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered:
I was not able to confirm the second point; that the issue occurs when auth_method != token. For me, that didn't seem to happen. That also matches the expectations of the code as written; can't find a way where that could have been the case.
I think something in my local environment where this popped up was obfuscating the fact that token auth was selected for.
However the main issue, which ultimately is an unhandled exception, is confirmed. If that code path is reached, it's already the last resort, and would have raised an exception anyway, it's just the wrong one.
briantist
changed the title
vault_path is evaluated on non-token auth, and does not handle a case of vault_file being a directory
token auth does not handle a case of vault_file being a directory
Oct 11, 2021
* add unit test that catches #152
* token_file must be a file
* add changelog fragment for #154
* Give a better error message
* Update plugins/module_utils/_auth_method_token.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
SUMMARY
Will need to do a little more testing/evaluation, but it appears that there are two issues:
token
auth validation happens, and it looks for the token from disk (viatoken_path
andtoken_file
), if thetoken_file
exists and is a directory, that condition is not properly handled and it raises an exception.The above seems to occur even whenauth_method != token
; which shouldn't be the case.Will confirm both cases and post a PR to fix.
ISSUE TYPE
COMPONENT NAME
module_utils/auth_methods
ANSIBLE VERSION
N/A
COLLECTION VERSION
1.3.2
CONFIGURATION
N/A
OS / ENVIRONMENT
N/A
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: