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

Urlencoding problem #1117

Open
rforberger opened this issue Dec 20, 2023 · 2 comments
Open

Urlencoding problem #1117

rforberger opened this issue Dec 20, 2023 · 2 comments
Assignees
Labels
waiting-reply waiting for more information (probably for a while)

Comments

@rforberger
Copy link

I have the problem to call vault with hvac for a certain secret.

The secret is called Hosting/description='servercontrolpanel.de/

I run script with the following content:


import hvac
import json

mountpoint = "security"

client = hvac.Client(
  url='http://localhost:8200',
  token="",
  namespace=mountpoint
)

# list
paths = client.list(mountpoint)
pathlist = paths['data']['keys']

for path in pathlist:
  list_of_secrets = client.secrets.kv.v1.list_secrets(mount_point=mountpoint, path=path)
  for secret in list_of_secrets['data']['keys']:
    secrets = client.secrets.kv.v1.read_secret(
      path=path+secret,
      mount_point=mountpoint
    )

I get the error message:

Traceback (most recent call last):
  File "/Users/ronnyforberger/IdeaProjects/bitwarden/./migration.py", line 21, in <module>
    secrets = client.secrets.kv.v1.read_secret(
  File "/Users/ronnyforberger/Library/Python/3.9/lib/python/site-packages/hvac/api/secrets_engines/kv_v1.py", line 32, in read_secret
    return self._adapter.get(
  File "/Users/ronnyforberger/Library/Python/3.9/lib/python/site-packages/hvac/adapters.py", line 146, in get
    return self.request("get", url, **kwargs)
  File "/Users/ronnyforberger/Library/Python/3.9/lib/python/site-packages/hvac/adapters.py", line 408, in request
    response = super().request(*args, **kwargs)
  File "/Users/ronnyforberger/Library/Python/3.9/lib/python/site-packages/hvac/adapters.py", line 376, in request
    self._raise_for_error(method, url, response)
  File "/Users/ronnyforberger/Library/Python/3.9/lib/python/site-packages/hvac/adapters.py", line 294, in _raise_for_error
    utils.raise_for_error(
  File "/Users/ronnyforberger/Library/Python/3.9/lib/python/site-packages/hvac/utils.py", line 41, in raise_for_error
    raise exceptions.VaultError.from_status(
hvac.exceptions.InvalidPath: None, on get http://localhost:8200/v1/security/Hosting/description%3D%27servercontrolpanel.de

Hvac Version 2.0.0.

Can you help me?

@briantist briantist self-assigned this Dec 20, 2023
@rforberger
Copy link
Author

rforberger commented Dec 21, 2023

Possible vault issue: hashicorp/vault#24618

@briantist
Copy link
Contributor

Thanks for opening this @rforberger . Since it seems like the issue might actually be in Vault itself, I'll wait and see what HashiCorp's response is so we can determine what changes if any we need in hvac. If you're an enterprise customer, it might be worth reaching out to them via your support agreement to see if you can get some eyes on it more quickly.

@briantist briantist added the waiting-reply waiting for more information (probably for a while) label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-reply waiting for more information (probably for a while)
Projects
None yet
Development

No branches or pull requests

2 participants