Files
Genarrative/server-rs/crates
lhk229 cf7f75cb6f 脱敏 VIAPI 临时桶上传错误体,避免泄漏 STS 临时凭证
OSS 签名类错误(如 SignatureDoesNotMatch)会在错误体里回显 StringToSign
(含 x-oss-security-token 明文)、StringToSignBytes(十六进制)和 SignatureProvided。
原实现把该错误体裸拼进 MattingError 消息,随后经 aliyun_matting 进入
external_api_call_failure 审计的 errorMessage/rawExcerpt 与 OTLP 日志,
泄漏 STS 临时凭证。

- 上传非 2xx 分支改用 sanitize_oss_upload_error_body:剥掉 StringToSign /
  StringToSignBytes / SignatureProvided 三个元素,并把已知 security_token
  在正文任何位置的出现替换为 ***,保留 <Code> 供诊断后再记录。
- 新增 redact_xml_element(无正则依赖)与单测覆盖脱敏效果。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 02:49:30 +00:00
..
2026-06-11 23:06:41 +08:00
1
2026-05-10 13:18:46 +08:00