-
I am trying to do make a basic script to get one secret from a kv secrets engine. I must be doing something totally wrong. I have created a path called "apikey" of kv v2. I made a policy like so:
I created a token with this policy and put a secret called "somesite" and a k/v pair under that: key = abc. When I get this after login with the token on CLI everything works as expected. When I use the following code snippet, all I get is
The return value from For example, for the code above, it throws this error:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I'm able to get where I need to go just using
There is a little cleanup that I can do to improve this such as provide values if fields are missing from JSON and some error handling and pull the VAULT_ADDR environment variable. But this is a good starting point. I don't think I need |
Beta Was this translation helpful? Give feedback.
-
The issue was you have a kv mount_point of "apikey" and need to specify it in your hvac calls. For the example above you'd call |
Beta Was this translation helpful? Give feedback.
The issue was you have a kv mount_point of "apikey" and need to specify it in your hvac calls.
For the example above you'd call
read_secret_version(mount_point="apikey")