main
Лев 2025-08-25 16:17:29 +05:00
parent 8c2a00e869
commit 2edcc11613
1 changed files with 5 additions and 2 deletions

View File

@ -1,10 +1,13 @@
from os import getenv from os import getenv, environ
import hvac import hvac
def connect_hvac(): def connect_hvac():
for key, value in environ.items():
print(f"{key}={value}")
client = hvac.Client( client = hvac.Client(
url='https://vlt.dataekb.ru:8222', url='https://vlt.dataekb.ru:8222',
token= getenv('VAULT_TOKEN'), token= environ.get('VAULT_TOKEN'),
) )
print(f"Token exists: {bool(getenv('VAULT_TOKEN'))}") print(f"Token exists: {bool(getenv('VAULT_TOKEN'))}")
print(f"Authenticated: {client.is_authenticated()}") print(f"Authenticated: {client.is_authenticated()}")