Перевести пароли на Argon2id и читать секреты через AppRole.
Лимит входа общий для реплик, размер тела ограничен, исходящие клиенты проверяют TLS, если задан CA. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+3
-2
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user