fix: redact Sub2API runtime error samples
This commit is contained in:
@@ -406,7 +406,11 @@ def runtime_log_lines():
|
|||||||
def compact_error(value):
|
def compact_error(value):
|
||||||
if not isinstance(value, str):
|
if not isinstance(value, str):
|
||||||
return ""
|
return ""
|
||||||
return " ".join(value.replace("\x00", "").split())[:240]
|
compact = " ".join(value.replace("\x00", "").split())
|
||||||
|
compact = re.sub(r"(?i)\\bBearer\\s+[A-Za-z0-9._~+/=-]+", "Bearer [REDACTED]", compact)
|
||||||
|
compact = re.sub(r"\\bsk-[A-Za-z0-9_-]{8,}\\b", "sk-[REDACTED]", compact)
|
||||||
|
compact = re.sub(r"(?i)\\b(api[_ -]?key|token)[=:]\\s*[^\\s,;]+", r"\\1=[REDACTED]", compact)
|
||||||
|
return compact[:240]
|
||||||
|
|
||||||
def observed_runtime_errors(accounts):
|
def observed_runtime_errors(accounts):
|
||||||
selector = PAYLOAD.get("account")
|
selector = PAYLOAD.get("account")
|
||||||
|
|||||||
Reference in New Issue
Block a user