forked from mtusi2026/mtusi2026lab7
feat: load process secrets from OpenBao via cert auth
OpenBao 2.7.3 (raft, TLS 1.3 with client certificates) holds the PostgreSQL role passwords, the Valkey password and the S3 keys; each process logs in with its own mTLS identity, reads only its paths and renews its token in the background. Operator init, unseal, configure and seed go through infra/openbao/bao.py and make bao_*; checks are make bao_check and driver.py openbao-outage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,8 +15,20 @@ from fakes import (
|
||||
FakeUnitOfWork,
|
||||
)
|
||||
from src.config import settings
|
||||
from src.infra.secrets import substitute_for_tests
|
||||
from src.schemas.enums import MetricBucketsEnum
|
||||
|
||||
# глобалы клиентов процесса API (src/api/dependencies.py → db/session.py,
|
||||
# cache/instance.py, s3/instance.py) берут секции с секретами из OpenBao
|
||||
# (change openbao-secrets): быстрые тесты подставляют их кодом до импорта
|
||||
# клиентов, OpenBao и сети нет
|
||||
substitute_for_tests(
|
||||
"api",
|
||||
database=settings.database,
|
||||
cache=settings.cache,
|
||||
s3=settings.s3,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def anyio_backend() -> str:
|
||||
|
||||
Reference in New Issue
Block a user