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 VAULT_NAMESPACE environment variable for automatic namespace selection #1167

Open
dereckson opened this issue May 2, 2024 · 1 comment

Comments

@dereckson
Copy link
Contributor

hvac library uses environment to configure Vault connection properties.

Currently, hvac.Client() will detect Vault URL from the VAULT_ADDR environment variable, but doesn't detect namespace from the VAULT_NAMESPACE variable.

In an automation workflow, if we want to customize namespace according environment, that creates this code:

vault_client = hvac.Client(namespace=os.environ["VAULT_NAMESPACE"])

At worst, if namespace is optional:

try:
    vault_client = hvac.Client(namespace=os.environ["VAULT_NAMESPACE"])
except KeyError:
    vault_client = hvac.Client()
@dereckson
Copy link
Contributor Author

Is that something acceptable for the software?

If so, I could prepare a pull request for this feature.

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

1 participant