-
Notifications
You must be signed in to change notification settings - Fork 65
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: VAULT_SKIP_VERIFY inverted behavior #94
base: master
Are you sure you want to change the base?
fix: VAULT_SKIP_VERIFY inverted behavior #94
Conversation
VAULT_SKIP_VERIFY=1 was actually ENABLING verify while VAULT_SKIP_VERIFY=0 was SKIPPING verify. We want the opposite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the MR we should use it like the vault CLI uses it.
Only one suggestion to use assert!
instate of assert_eq!
but I leave it up to you if you want to apply them
env::remove_var(VAULT_SKIP_VERIFY); | ||
let client = build_client(); | ||
assert!(client.settings.verify); | ||
assert_eq!(client.settings.verify, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert_eq!(client.settings.verify, true); | |
assert!(client.settings.verify); |
env::set_var(VAULT_SKIP_VERIFY, value); | ||
let client = build_client(); | ||
assert!(!client.settings.verify); | ||
assert_eq!(client.settings.verify, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert_eq!(client.settings.verify, true); | |
assert!(client.settings.verify); |
@@ -63,24 +63,27 @@ fn test_should_verify_tls() { | |||
for value in ["", "1", "t", "T", "true", "True", "TRUE"] { | |||
env::set_var(VAULT_SKIP_VERIFY, value); | |||
let client = build_client(); | |||
assert!(client.settings.verify); | |||
// Setting truthy value for SKIP_VERIFY should disable verify | |||
assert_eq!(client.settings.verify, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert_eq!(client.settings.verify, false); | |
assert!(!client.settings.verify); |
VAULT_SKIP_VERIFY=1 was actually ENABLING verify while VAULT_SKIP_VERIFY=0 was SKIPPING verify. We want the opposite.
I was able to
cargo build
but notcargo test
in anix develop
shell, I had failure:This does not seem related to my local changes, maybe Nix dev shell is broken?
But I hope change is simple enough, if a reviewer or owner can test it on its own :)