feat(channels): 微信入站媒体脱敏取证日志(形状行记 ref 来源+host、结局行记 err_kind;不记 URL/query/密钥)
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

This commit is contained in:
AskaEth committed 2026-10-05 12:07:18 +08:00
1 parent 5139945bfe
commit f44114301e
4 files changed
+623

No files matched your search

+10
View File
@@ -138,6 +138,16 @@ type ilinkFetcher struct {
// `mediafetch.DefaultTimeout`(**不是** `MaxMediaSize`:那是媒体通道自己的历史上限,
// 与本切片的内联上限刻意解耦)。
func (f ilinkFetcher) Fetch(ctx context.Context, m adapter.Media) ([]byte, error) {
data, err := f.fetch(ctx, m)
// 结局取证(DEBUG,见 inbound_debug.go):取道一个出口,成功与每一种失败(含密钥
// 缺失)都不可能漏记;它只记类型/host/字节数/错误类别,绝不记 URL 与错误原文。
f.a.logInboundMediaFetch(m, data, err)
return data, err
}
// fetch 是 Fetch 的实现体:按条密钥 → 白名单取回 → 剥 AES-ECB 层。它从 Fetch 拆出,
// 只为让上面那条结局取证恰好打一次。
func (f ilinkFetcher) fetch(ctx context.Context, m adapter.Media) ([]byte, error) {
key, err := f.inboundKey(m)
if err != nil {
return nil, err