fix: accept nullable message publishers and scoped dev SPB trust
Some checks failed
Mostovik Backend CI/CD / Tests and lint (push) Successful in 3m3s
Mostovik Backend CI/CD / Deploy dev (push) Has been cancelled
Mostovik Backend CI/CD / Deploy and verify internal main (push) Has been cancelled
Mostovik Backend CI/CD / Build linux/amd64 release images (push) Has been cancelled

This commit is contained in:
Aleksandr Meshchryakov
2026-10-05 19:23:03 +02:00
parent 0dd763109b
commit 1a82345ab3
13 changed files with 131 additions and 15 deletions

View File

@@ -10,6 +10,7 @@ from io import BytesIO, TextIOWrapper
from typing import BinaryIO
from urllib.parse import urljoin, urlparse
from apps.parsers.clients.common.structured import EIS_CA_BUNDLE_PATH
from apps.parsers.models import ParserSourceArtifact
from apps.parsers.registry_http import (
limited_bytes,
@@ -170,7 +171,9 @@ def download_spb_artifact(
)
try:
with registry_session() as session:
# Existing EIS trust is deliberately NOT reused: approval was probe-only.
# This session serves only allowlisted SPB requests; MOEX has its own.
if getattr(settings, "EXCHANGE_SPB_RUSSIAN_TRUST_ENABLED", False):
session.verify = str(EIS_CA_BUNDLE_PATH)
with registry_response(session, SPB_INDEX, hosts=SPB_HOSTS) as response:
before = discover_spb_date(
limited_bytes(response, 4 * 1024**2).decode("utf-8")