forked from mtusi2026/mtusi2026lab7
feat: require mTLS with certificate login for RabbitMQ and split relay and worker rights
Broker accepts only TLS 1.3 with a client certificate checked against the stand CRL; login is EXTERNAL by certificate DNS SAN, broker passwords are gone. Relay may declare its queue and publish, worker may only consume. Definitions and TLS material checks come from infra/rabbitmq/start.sh; temporary stands, CI, bench and the fault hook use the same mTLS identities. Adds make broker_mtls_check [REPORT=1] and drops the rollback broker compose. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import asyncio
|
||||
import io
|
||||
import json
|
||||
import logging
|
||||
import ssl
|
||||
import threading
|
||||
import time
|
||||
from collections.abc import Iterator
|
||||
@@ -979,7 +980,11 @@ class _Channel:
|
||||
async def test_publisher_puts_context_in_headers(signals: Signals) -> None:
|
||||
"""`JobPublisher._publish_one`: span на каждое сообщение, его контекст —
|
||||
заголовки; без контекста — сообщение без заголовков, тело прежнее."""
|
||||
publisher = JobPublisher(settings.broker, namespace="testdb")
|
||||
publisher = JobPublisher(
|
||||
settings.broker,
|
||||
namespace="testdb",
|
||||
context=ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT),
|
||||
)
|
||||
channel = _Channel()
|
||||
traced = _publication()
|
||||
plain = _publication(None)
|
||||
|
||||
Reference in New Issue
Block a user