lab7: OpenBao 2.7.3 (не dev, raft на volume, TLS, audit), AppRole и scoped policy для api/relay/worker, секреты только из OpenBao, скрипт оператора и проверка allow/deny
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user