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

It's possible for Client.Logical()'s methods to return nil, nil #2424

Closed
F21 opened this issue Mar 2, 2017 · 1 comment
Closed

It's possible for Client.Logical()'s methods to return nil, nil #2424

F21 opened this issue Mar 2, 2017 · 1 comment

Comments

@F21
Copy link
Contributor

F21 commented Mar 2, 2017

I was debugging an app where Vault was using a self signed certificate and the app did not have the root certificate used to sign the Vault certificate set into tls.Config for the http client.

This resulted in Client.Logical().Unwrap() returning nil, nil, which was a bit unexpected. There are numerous paths in client.Logical()'s methods that return nil, nil. For example, one of them for Unwrap() is here: https://github.com/hashicorp/vault/blob/master/api/logical.go#L147.

If there is no response body from the Vault server, would it make sense to return an error instead? It seems counter-intuitive to have to check the result of secret and err in secret, err := client.Logical().Unwrap() and other similar methods.

@jefferai
Copy link
Member

jefferai commented Mar 2, 2017

If the original response is nil, which is a valid response from Vault (a 204 in HTTP-ese), tbe unwrapped response will reflect that. Working as designed!

@jefferai jefferai closed this as completed Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants