Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cmdb-api/api/lib/secrets/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from base64 import b64encode

import hvac
import os


class VaultClient:
Expand Down Expand Up @@ -128,7 +129,9 @@ def decode_base64(cls, encoded_string):

if __name__ == "__main__":
_base_url = "http://localhost:8200"
_token = "your token"
_token = os.environ.get("VAULT_TOKEN", "")
if not _token:
raise RuntimeError("VAULT_TOKEN is required")

_path = "test001"
# Example
Expand Down