fix
This commit is contained in:
@@ -165,10 +165,10 @@ class TelemetryManager:
|
||||
if not properties:
|
||||
return {}
|
||||
|
||||
# TODO: Keep this up to date with any config schema changes
|
||||
# NOTE: Keep this up to date with any config schema changes
|
||||
path_indicators = {"path", "dir"}
|
||||
|
||||
def redact_value(value: str, key: Any = None) -> Any:
|
||||
def redact_value(value: Any, key: str = "") -> Any:
|
||||
"""Recursively sanitize values, redacting those with path-like keys"""
|
||||
# Special case: base_model should be redacted if org is not whitelisted
|
||||
if key == "base_model":
|
||||
@@ -181,11 +181,11 @@ class TelemetryManager:
|
||||
if any(indicator in key.lower() for indicator in path_indicators):
|
||||
return "[REDACTED]"
|
||||
|
||||
# Handle nested structures
|
||||
if isinstance(value, dict):
|
||||
return {k: redact_value(v, k) for k, v in value.items()}
|
||||
if isinstance(value, list):
|
||||
return [redact_value(item) for item in value]
|
||||
# Handle nested structures
|
||||
if isinstance(value, dict):
|
||||
return {k: redact_value(v, k) for k, v in value.items()}
|
||||
if isinstance(value, list):
|
||||
return [redact_value(item) for item in value]
|
||||
|
||||
return value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user