Files
mtusi2026lab7-safronov/src/infra/s3/instance.py
T
ricoromaandClaude Opus 5.5 64210dace0 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>
2026-11-26 13:55:09 +03:00

21 lines
1002 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Хранилище объектов процесса API (S3).
Создаётся при импорте по секции `s3` с ключами пользователя API из OpenBao
(change `openbao-secrets`, design, решение 9); клиент aiobotocore создаёт
lifespan (`start()`), соединения — первый вызов. Импортируют модуль только
`src/main.py` (старт и закрытие в lifespan) и `src/api/dependencies.py`, как
`src/infra/cache/instance.py`. Ключи объектов — по имени базы из
`settings.database`: `make test_isolated` с базой `test_<db>` пишет под своим
префиксом.
"""
from src.config import settings
from src.infra.s3.client import create_object_storage
from src.infra.secrets import process_secrets
object_storage = create_object_storage(
process_secrets("api").s3,
namespace=settings.database.name,
ca_file=settings.client_tls.ca_file,
)