test(obs): retain legacy SigNoz topology redaction
This commit is contained in:
@@ -21,6 +21,7 @@ _ENDPOINT_ALIASES = {
|
||||
"192.168.0.188:11434": "host:observability-a/ollama",
|
||||
"192.168.0.188:8088": "host:observability-a/openclaw-legacy",
|
||||
"192.168.0.188:8089": "host:observability-a/openclaw",
|
||||
"192.168.0.188:3301": "host:observability-a/signoz",
|
||||
"192.168.0.188:5432": "host:observability-a/postgres",
|
||||
"192.168.0.188:6380": "host:observability-a/redis",
|
||||
}
|
||||
|
||||
@@ -31,13 +31,17 @@ def test_redact_public_lan_text_replaces_internal_endpoints_with_aliases() -> No
|
||||
def test_redact_public_lan_topology_recurses_json_values() -> None:
|
||||
payload = {
|
||||
"safe_key": "unchanged",
|
||||
"nested": [{"endpoint": "192.168.0.110:8080"}],
|
||||
"nested": [
|
||||
{"endpoint": "192.168.0.110:8080"},
|
||||
{"endpoint": "192.168.0.188:3301"},
|
||||
],
|
||||
}
|
||||
|
||||
redacted = redact_public_lan_topology(payload)
|
||||
|
||||
assert redacted["safe_key"] == "unchanged"
|
||||
assert redacted["nested"][0]["endpoint"] == "host:public-gateway/signoz"
|
||||
assert redacted["nested"][1]["endpoint"] == "host:observability-a/signoz"
|
||||
|
||||
|
||||
def test_redact_public_lan_text_replaces_internal_work_context_terms() -> None:
|
||||
|
||||
@@ -158,7 +158,8 @@ def test_active_api_source_has_no_legacy_signoz_ui_route() -> None:
|
||||
offenders = [
|
||||
str(path.relative_to(REPO_ROOT))
|
||||
for path in source_root.rglob("*.py")
|
||||
if LEGACY_URL in path.read_text(encoding="utf-8")
|
||||
if path.name != "public_redaction.py"
|
||||
and LEGACY_URL in path.read_text(encoding="utf-8")
|
||||
]
|
||||
|
||||
assert offenders == []
|
||||
|
||||
Reference in New Issue
Block a user