lab7: OpenBao 2.7.3 (не dev, raft на volume, TLS, audit), AppRole и scoped policy для api/relay/worker, секреты только из OpenBao, скрипт оператора и проверка allow/deny

This commit is contained in:
Alexey Bodanyuk
2026-11-27 16:41:57 +03:00
parent 93f4ed1013
commit 876f610847
16 changed files with 623 additions and 45 deletions
+8
View File
@@ -7,6 +7,7 @@ from __future__ import annotations
import datetime as dt
import json
import logging
import os
import sys
from . import telemetry
@@ -42,3 +43,10 @@ def configure(level: str) -> None:
for name in ("uvicorn", "uvicorn.error"):
logging.getLogger(name).handlers[:] = []
logging.getLogger(name).propagate = True
def configure_early() -> None:
"""Before Settings exist (lab 7: secrets are fetched from OpenBao while the settings load, and
those log lines must not be lost). Settings.from_env() validates LOG_LEVEL properly later."""
raw = os.environ.get("LOG_LEVEL", "info").strip().lower()
configure(raw if raw in {"debug", "info", "warning", "error"} else "info")