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

Support for GetAllSecrets in Vault kv1? #3518

Closed
nick-knowlson-alayacare opened this issue May 22, 2024 · 5 comments · Fixed by #3790
Closed

Support for GetAllSecrets in Vault kv1? #3518

nick-knowlson-alayacare opened this issue May 22, 2024 · 5 comments · Fixed by #3790
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@nick-knowlson-alayacare
Copy link
Contributor

nick-knowlson-alayacare commented May 22, 2024

Problem

The documentation describes the ability to fetch multiple secrets:

But when I try to use this with Vault kv version v1, I get the following error:

cannot perform find operations with kv version v1

Question

Is this because of a fundamental limitation with Vault kv1 that makes it unsuitable for this? Or was it more of a cost/benefit analysis - where it is possible but would take time and not enough people want it?

Possible Solutions

Implement support for GetAllSecrets for Vault kv version v1?

or

Update Vault-specific documentation to say this functionality is limited to kv2 and why?

Additional Context

Thank you! Any time is appreciated.

@nick-knowlson-alayacare nick-knowlson-alayacare added the kind/feature Categorizes issue or PR as related to a new feature. label May 22, 2024
@moolen
Copy link
Member

moolen commented May 24, 2024

hey @nick-knowlson-alayacare, GetAllSecrets supports two types:

  1. list by name
  2. list by tags

The latter isn't supported due to a limitation in Vault kv v1 because it doesn't support metadata.
The Vault kv v1 API supports listing secrets, this should be fairly easy to implement. I guess it was more of a cost/benefit thing, as we didn't expect that many users still using v1

@nick-knowlson-alayacare
Copy link
Contributor Author

Ah excellent, that's good to hear! Fortunately I have no need to list by tags, just by name!

I can take a look at the implementation and see about contributing for that use case. I am not very familiar with Go but as long as there's nothing inherently limiting it from the Vault side it seems like it shouldn't be too bad.

Unless you think someone else would be available and willing to make those changes? Am leaning on you for knowledge of process, contributors, other ongoing work etc. to know if this is likely. If not it is no problem, I can take a look.

@moolen
Copy link
Member

moolen commented May 25, 2024

I don't think someone else is available, we'd be happy to review a PR :)
The error is returned here. Looking at the code it could be enough to just remove it 🤔

if c.store.Version == esv1beta1.VaultKVStoreV1 {
return nil, errors.New(errUnsupportedKvVersion)
}

@nick-knowlson-alayacare
Copy link
Contributor Author

I don't think someone else is available, we'd be happy to review a PR :)

No worries I'll take a look then!

The error is returned here. Looking at the code it could be enough to just remove it

Thanks! I was kind of hoping it would be something along those lines. I'll try out some changes and test it.

@nick-knowlson-alayacare
Copy link
Contributor Author

Hello! Other work tasks took priority, but I am coming back to this now.

I've created a PR with a first pass at getting this working: #3790

It probably needs a few more things before merging, but I think it is pretty close?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants