Перевести пароли на Argon2id и читать секреты через AppRole.

Лимит входа общий для реплик, размер тела ограничен, исходящие клиенты проверяют TLS, если задан CA.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-26 19:40:28 +03:00
co-authored by Cursor
parent 54b4b9e509
commit fb566d874c
19 changed files with 445 additions and 20 deletions
+3 -2
View File
@@ -8,7 +8,7 @@ import logging
import aio_pika
from app import config, telemetry
from app import config, telemetry, tlsutil
logger = logging.getLogger("messenger.broker")
@@ -32,7 +32,8 @@ async def _ensure() -> tuple[aio_pika.RobustChannel, aio_pika.Exchange]:
return _channel, _exchange
if not config.BROKER_URL:
raise RuntimeError("BROKER_URL is not set")
_connection = await aio_pika.connect_robust(config.BROKER_URL)
ssl_context = tlsutil.server_context() if config.BROKER_URL.startswith("amqps://") else None
_connection = await aio_pika.connect_robust(config.BROKER_URL, ssl_context=ssl_context)
_channel = await _connection.channel(publisher_confirms=True)
_exchange = await _channel.declare_exchange(EXCHANGE, aio_pika.ExchangeType.DIRECT, durable=True)
await _channel.declare_queue(