Skip to content

fix(drivers/139): sanitize and normalize login logs - #3037

Draft
UcnacDx2 wants to merge 2 commits into
OpenListTeam:mainfrom
UcnacDx2:fix/139-redact-credential-logs
Draft

fix(drivers/139): sanitize and normalize login logs#3037
UcnacDx2 wants to merge 2 commits into
OpenListTeam:mainfrom
UcnacDx2:fix/139-redact-credential-logs

Conversation

@UcnacDx2

@UcnacDx2 UcnacDx2 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

PR title: fix(drivers/139): sanitize and normalize login logs

Summary / 摘要

Use a consistent [139yun] prefix for driver diagnostics, keep status-only login messages in English, and avoid logging credential-bearing values, headers, decrypted payloads, or response bodies from the encrypted login flow.

统一 139Yun 驱动诊断日志的 [139yun] 前缀,将仅表示状态的登录日志统一为英文,并避免记录可能包含凭据的值、请求头、解密后的负载以及加密登录流程中的响应正文。

Key changes / 主要变更:

  • Standardize 139Yun driver diagnostic prefixes from mixed forms such as [139], 139yun:, and ad-hoc DEBUG: messages to [139yun].

  • Replace credential-bearing login debug output with status-only messages.

  • Stop logging sensitive login artifacts such as request headers, response bodies, decrypted payloads, and extracted token values.

  • Remove response-body content from encrypted-request error messages where it could expose sensitive data.

  • Keep the login flow and request behavior unchanged; this is a logging-only hardening and cleanup change.

  • 将 139Yun 驱动中混用的 [139]139yun:、临时 DEBUG: 等日志前缀统一为 [139yun]

  • 将可能携带凭据内容的登录调试日志改为仅记录状态信息。

  • 不再输出请求头、响应正文、解密后的负载以及提取出的令牌值等敏感登录信息。

  • 对加密请求的错误信息进行收敛,避免在错误文本中包含可能敏感的响应正文。

  • 不改变登录流程和请求行为,本次变更仅涉及日志清理与安全加固。

  • This PR has breaking changes.
    / 此 PR 包含破坏性变更。

  • This PR changes public API, config, storage format, or migration behavior.
    / 此 PR 修改了公开 API、配置、存储格式或迁移行为。

  • This PR requires corresponding changes in related repositories.
    / 此 PR 需要关联仓库同步修改。

Related repository PRs / 关联仓库 PR:

  • OpenList-Frontend: N/A
  • OpenList-Docs: N/A

Testing / 测试

  • go test ./...
  • go test ./drivers/139 -count=1
  • Manual test / 手动测试:
    • Verified the final branch diff only changes drivers/139/util.go.
    • Verified the temporary workflow/trigger files are not present in the final PR diff.
    • Verified the 139Yun package tests pass after the log-prefix normalization and sensitive-log cleanup.

Checklist / 检查清单

  • I have read CONTRIBUTING.
    / 我已阅读 CONTRIBUTING
  • I confirm this contribution follows the repository license, contribution policy, and code of conduct.
    / 我确认此贡献符合仓库许可证、贡献规范和行为准则。
  • I have formatted the changed code with gofmt, go fmt, or prettier where applicable.
    / 我已按适用情况使用 gofmtgo fmtprettier 格式化变更代码。
  • I have requested review from relevant maintainers or code owners where applicable.
    / 我已在适用情况下请求相关维护者或代码所有者审查。

AI Disclosure / AI 使用声明

  • This PR includes AI-assisted content.
    / 此 PR 包含 AI 辅助内容。

Tools used / 使用工具:

  • ChatGPT
  • Codex
  • GitHub Copilot
  • Claude
  • Gemini
  • Other (please specify) / 其他(请注明):

Usage scope / 使用范围:

  • Code generation / 代码生成

  • Refactoring / 重构

  • Documentation / 文档

  • Tests / 测试

  • Translation / 翻译

  • Review assistance / 审查辅助

  • I have reviewed and validated all AI-assisted content included in this PR.
    / 我已审核并验证此 PR 中的所有 AI 辅助内容。

  • I have ensured that all AI-assisted commits include Co-Authored-By attribution.
    / 我已确保所有 AI 辅助提交都包含 Co-Authored-By 归属信息。

  • I can reproduce all AI-assisted content included in this PR without any AI tools.
    / 我可以在没有任何 AI 工具的情况下重现此 PR 中包含的所有 AI 辅助内容。

Copilot AI lite review requested due to automatic review settings September 5, 2026 05:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The driver still logs full request/response bodies in shared request helpers, which can leak sensitive data and conflicts with the PR’s stated logging-hardening goals.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR hardens and normalizes diagnostic logging in the 139Yun driver, aiming to standardize log prefixes and reduce exposure of sensitive login-related data while keeping request/login behavior unchanged.

Changes:

  • Standardizes driver log prefixes to [139yun] and normalizes several login-flow messages into consistent English status logs.
  • Removes/avoids logging of sensitive artifacts in the encrypted login flow (e.g., plaintext/decrypted payload logs and response-body inclusion in some error paths).
  • Cleans up noisy debug logs around mail login step transitions and token extraction.
File summaries
File Description
drivers/139/util.go Normalizes 139Yun log prefixes/messages and reduces sensitive output in parts of the login/encrypted-request flow.
Review details

Suppressed comments (2)

drivers/139/util.go:226

  • Avoid logging the full response body; API responses can contain tokens or other sensitive data. Log status (and optionally size) instead to keep diagnostics without leaking secrets.
	log.Debugf("[139yun] response body: %s", res.String())

drivers/139/util.go:915

  • Avoid logging the full personal-response body; it may include sensitive data. Log status instead.
	log.Debugf("[139yun] personal response body: %s", res.String())
  • Files reviewed: 1/1 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread drivers/139/util.go
Comment thread drivers/139/util.go
Comment thread drivers/139/util.go Outdated
Use a consistent [139yun] prefix for driver diagnostics, keep status-only login messages in English, and avoid logging credential-bearing values, headers, decrypted payloads, or response bodies from the encrypted login flow.
@UcnacDx2
UcnacDx2 force-pushed the fix/139-redact-credential-logs branch from 274447c to dfcc770 Compare September 5, 2026 05:35
@github-actions
github-actions Bot force-pushed the fix/139-redact-credential-logs branch from 3e2a814 to d3a172e Compare September 5, 2026 08:14
@UcnacDx2
UcnacDx2 marked this pull request as draft September 5, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants