chore: release v1.0.0 — каркас FastAPI, ingress Grafana, интеграции, документация

Made-with: Cursor
This commit is contained in:
Alexandr
2026-04-03 08:30:56 +03:00
commit 4da9b13a86
34 changed files with 1049 additions and 0 deletions

18
onguard24/vaultcheck.py Normal file
View File

@ -0,0 +1,18 @@
import httpx
async def ping(addr: str, token: str) -> tuple[bool, str | None]:
if not addr or not token:
return False, "vault addr or token empty"
base = addr.rstrip("/")
try:
async with httpx.AsyncClient(timeout=5.0, verify=True) as client:
r = await client.get(
f"{base}/v1/sys/health",
headers={"X-Vault-Token": token},
)
except Exception as e:
return False, str(e)
if r.status_code in (200, 429, 503, 501):
return True, None
return False, f"http {r.status_code}"