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:
2026-11-26 13:55:09 +03:00
co-authored by Claude Opus 5.5
parent 4dd4a957be
commit 64210dace0
64 changed files with 6709 additions and 321 deletions
+4 -1
View File
@@ -31,6 +31,7 @@ from src.infra.db.session import engine, session_factory
from src.infra.db.uow import SqlAlchemyUnitOfWork
from src.infra.login_limit import create_login_limiter
from src.infra.password import KdfBudget, PasswordCheck, password_kdf
from src.infra.secrets import process_secrets
from src.main import app
from src.schemas.dataclasses import ChatFullDTO
from src.schemas.enums import AttachmentStatus
@@ -381,7 +382,9 @@ async def test_deadline_in_second_block_single_record(
pool_logger.addHandler(records)
async with TcpProxy(*proxy_target) as proxy:
proxied = create_engine(
dependencies.settings.database.model_copy(
# секция роли api с паролем — подстановка conftest (change
# openbao-secrets): в settings пароля процесса нет
process_secrets("api").database.model_copy(
update={"host": "localhost", "port": proxy.port},
),
ca_file=dependencies.settings.client_tls.ca_file,