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

client.Secrets.KvV1Read fails because of SDK-added parameter #186

Closed
erwinvaneyk opened this issue Jun 24, 2023 · 1 comment · Fixed by #197
Closed

client.Secrets.KvV1Read fails because of SDK-added parameter #186

erwinvaneyk opened this issue Jun 24, 2023 · 1 comment · Fixed by #197
Labels
bug Something isn't working

Comments

@erwinvaneyk
Copy link

erwinvaneyk commented Jun 24, 2023

When trying to retrieve a key-value from the secrets engine, I get back a not found for a key that does exist:

vaultClient.Secrets.KvV1Read(ctx, key)

(I am using the v1 API for legacy reasons)

Expected Behavior

I expect to be able to read the secret stored with the given key.

Current Behavior

I get back a 404.

Failure Information

Please include the version of Vault binary and the version of vault-client-go you're using.
vault-client-go: 0.3.3
vault: 1.13.4

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. store a KV-pair in secret engine
  2. retrieve the secret using the client.Secrets.KvV1Read call
    ...

Additional Information

As a workaround that I used a custom request callback function:

func fixVaultKvV1ReadRequest(request *http.Request) {
	query := request.URL.Query()
	query.Del("list")
	request.URL.RawQuery = query.Encode()
}

With this set as a request callback the request goes through.

@averche
Copy link
Collaborator

averche commented Jun 25, 2023

Thanks for reporting this, @erwinvaneyk!

This seems to be very similar to the #174 issue with List/Read being mapped to the same method in the OpenAPI spec. The full solution will need to be implemented in hashicorp/vault and/or hashicorp/vault-plugin-secrets-kv but in the meantime your workaround should work. Alternatively, substituting the call with client.Read(ctx, ...) should work as well.

@averche averche added the bug Something isn't working label Jun 25, 2023
averche pushed a commit that referenced this issue Jul 13, 2023
Closes #174

Closes #186

apidiff:
```
Incompatible changes:
- (*Auth).GithubReadTeams: removed
- (*Auth).GithubReadUsers: removed
- (*System).PoliciesList: removed
Compatible changes:
- (*Auth).GithubListTeams: added
- (*Auth).GithubListUsers: added
- (*Secrets).CubbyholeList: added
- (*Secrets).KvV1List: added
- (*Secrets).KvV2ListMetadata: added
- (*System).RawList: added
- (*System).RawListPath: added
```
(and related changes in schema package)
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 a pull request may close this issue.

2 participants