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 the VAULT_NAMESPACE environment variable #772

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 0 additions & 10 deletions docs/overview.rst
Expand Up @@ -30,16 +30,6 @@ Using TLS with client-side certificate authentication:
True


Using `Vault Enterprise namespace <https://www.vaultproject.io/docs/enterprise/namespaces/index.html>`_\ :

.. doctest:: init

>>> client = hvac.Client(
... url='https://localhost:8200',
... namespace=os.getenv('VAULT_NAMESPACE'),
... )


Using plaintext / HTTP (not recommended for anything other than development work):

.. doctest:: init
Expand Down
1 change: 1 addition & 0 deletions hvac/v1/__init__.py
Expand Up @@ -67,6 +67,7 @@ def __init__(

token = token if token is not None else utils.get_token_from_env()
url = url if url else os.getenv("VAULT_ADDR", DEFAULT_URL)
namespace = namespace if namespace else os.getenv("VAULT_NAMESPACE")

if cert is None and VAULT_CLIENT_CERT:
cert = (
Expand Down