Magenta2 change manifest url discovery

This commit is contained in:
Nirvana
2026-05-11 12:12:35 +02:00
parent 6a0cc73c9b
commit 6588c2d2ef
2 changed files with 12 additions and 4 deletions
@@ -14,6 +14,7 @@ class BootstrapConfig:
sam3_client_id: Optional[str] = None
taa_url: Optional[str] = None
device_tokens_url: Optional[str] = None
manifest_base_url: Optional[str] = None
line_auth_url: Optional[str] = None
remote_login_url: Optional[str] = None
openid_config_url: Optional[str] = None
@@ -32,6 +33,7 @@ class BootstrapConfig:
from .constants import SUBSCRIBER_TYPES
base_settings = bootstrap_data.get("baseSettings", {})
dcm_settings = bootstrap_data.get("dcm", {})
return cls(
client_model=base_settings.get("clientModel", f"ftv-{platform}"),
@@ -40,6 +42,7 @@ class BootstrapConfig:
sam3_client_id=base_settings.get("sam3ClientId"),
taa_url=base_settings.get("taaUrl"),
device_tokens_url=base_settings.get("deviceTokensUrl"),
manifest_base_url=dcm_settings.get("manifestBaseUrl"),
line_auth_url=base_settings.get("lineAuthUrl"),
remote_login_url=base_settings.get("remoteLoginUrl"),
openid_config_url=base_settings.get("sam3Url"),
@@ -183,10 +183,15 @@ class DiscoveryService:
try:
logger.info("Discovering manifest configuration")
# Determine manifest URL - prefer device_tokens_url from bootstrap
if self._bootstrap_config and self._bootstrap_config.device_tokens_url:
manifest_url = self._bootstrap_config.device_tokens_url
logger.debug(f"Using bootstrap device_tokens_url for manifest: {manifest_url}")
# Priority 1: Use dcm.manifestBaseUrl from bootstrap
if self._bootstrap_config and self._bootstrap_config.manifest_base_url:
terminal_type = self.terminal_type.lower().replace("_", "-")
manifest_url = self._bootstrap_config.manifest_base_url.replace(
"{configGroupId}", terminal_type
)
logger.debug(f"Using bootstrap manifestBaseUrl: {manifest_url}")
# Priority 2: Fallback to hardcoded manifest URL
else:
terminal_type = self.terminal_type.lower().replace("_", "-")
manifest_url = MAGENTA2_MANIFEST_URL.format(terminal_type=terminal_type)