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

Add support for passing Vault namespace #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rayokota
Copy link

This is useful when working with Vault Enterprise

This is useful when working with Vault Enterprise
@juergw
Copy link
Contributor

juergw commented Apr 9, 2024

Do you need to use the registry.KMSClient interface? If not and you only need an AEAD, then you can already do that if you use hcvault.NewAEAD:

like this:

client, err := api.NewClient(cfg)
if err != nil {
...
}
client.SetNamespace(namespace)
client.SetToken(token)
...
a, err := hcvault.NewAEAD("/transit/keys/key-1", client.Logical())
if err != nil {
...
}

This also has the advantage that it doesn't use the "context" request parameter to set the associated data, but uses the "associated_data". If you want to use "context" to be compatible with the previous behavior, then you may need to pass the hcvault.WithLegacyContextParamater() option.

@rayokota
Copy link
Author

rayokota commented Apr 9, 2024

Yes, I need the registry.KMSClient interface

@tholenst tholenst requested a review from juergw April 17, 2024 12:33
@juergw
Copy link
Contributor

juergw commented May 24, 2024

I've added the function hcvault.NewClientWithAEADOptions here:
57c4fd3

I think that should cover your use-case, is that correct?

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

Successfully merging this pull request may close these issues.

None yet

2 participants