fix(config): match per-service cdm keys case-insensitively

cdm lookups used the raw service key while decryption upper-cases its keys, so a case-mismatched cdm entry silently used the default. Add a shared ci_get helper, route cdm/decryption through resolvers, drop a redundant decryption mutation and dead downloader writes, and add a regression bench.
This commit is contained in:
imSp4rky
2026-06-22 16:50:59 -06:00
parent ce69e8a028
commit 6294566823
7 changed files with 114 additions and 29 deletions
+13
View File
@@ -38,6 +38,19 @@ def flatten(items: Any, ignore_types: Union[Type, Tuple[Type, ...]] = str) -> It
yield items
def ci_get(mapping: dict, key: str, default: Any = None) -> Any:
"""Case-insensitive top-level lookup, for per-service config maps."""
if not mapping:
return default
if key in mapping:
return mapping[key]
kl = key.lower()
for k, v in mapping.items():
if isinstance(k, str) and k.lower() == kl:
return v
return default
def merge_dict(source: dict, destination: dict) -> None:
"""Recursively merge Source into Destination in-place."""
if not source: