(data: Dict[str, Any])
| 257 | |
| 258 | |
| 259 | def _sanitize_diagnostics(data: Dict[str, Any]) -> Dict[str, Any]: |
| 260 | sanitized: Dict[str, Any] = {} |
| 261 | for key, value in data.items(): |
| 262 | if value is None: |
| 263 | continue |
| 264 | if "api_key" in key.lower() or "authorization" in key.lower(): |
| 265 | sanitized[key] = "***" |
| 266 | elif isinstance(value, (str, int, float, bool)): |
| 267 | sanitized[key] = _truncate(str(value), 500) if isinstance(value, str) else value |
| 268 | else: |
| 269 | sanitized[key] = _truncate(str(value), 500) |
| 270 | return sanitized |
| 271 | |
| 272 | |
| 273 | def _extract_status_and_message(raw: str) -> Tuple[Optional[int], Optional[str]]: |
no test coverage detected