feat: separate PostgreSQL roles and Valkey ACL per service

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 14:10:09 +03:00
co-authored by Claude Opus 5.5
parent c5b03e6efa
commit d5eaeb3183
44 changed files with 4013 additions and 129 deletions
+7 -1
View File
@@ -232,13 +232,19 @@ def create_cache(
# соединение, а обычный пул сразу бросал бы MaxConnectionsError, и
# здоровый Valkey пропускался бы как отказавший.
# Retry — из redis.asyncio: синхронный класс асинхронное соединение
# вызывает через await, и повтор молча не выполняется
# вызывает через await, и повтор молча не выполняется.
# Пользователь ACL — [cache] username (change storage-roles, design,
# решение 9); driver_info=None — без CLIENT SETINFO при соединении: у
# пользователя api этой команды нет, и каждое соединение оставляло бы
# отказ в ACL LOG (проба apply, задача 1.2)
pool = BlockingConnectionPool(
connection_class=TlsConnection,
client_context=build_client_context(ca_file),
host=cache.host,
port=cache.port,
username=cache.username or None,
password=cache.password.get_secret_value() or None,
driver_info=None,
max_connections=cache.max_connections,
timeout=cache.timeout_seconds,
socket_timeout=cache.timeout_seconds,