fix(drivers/139): sanitize and normalize login logs - #3037
Draft
UcnacDx2 wants to merge 2 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
🟡 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.
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
force-pushed
the
fix/139-redact-credential-logs
branch
from
September 5, 2026 05:35
274447c to
dfcc770
Compare
github-actions
Bot
force-pushed
the
fix/139-redact-credential-logs
branch
from
September 5, 2026 08:14
3e2a814 to
d3a172e
Compare
UcnacDx2
marked this pull request as draft
September 5, 2026 10:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR title:
fix(drivers/139): sanitize and normalize login logsSummary / 摘要
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-hocDEBUG: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:
Testing / 测试
go test ./...go test ./drivers/139 -count=1drivers/139/util.go.Checklist / 检查清单
/ 我已阅读 CONTRIBUTING。
/ 我确认此贡献符合仓库许可证、贡献规范和行为准则。
gofmt,go fmt, orprettierwhere applicable./ 我已按适用情况使用
gofmt、go fmt或prettier格式化变更代码。/ 我已在适用情况下请求相关维护者或代码所有者审查。
AI Disclosure / AI 使用声明
/ 此 PR 包含 AI 辅助内容。
Tools used / 使用工具:
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-Byattribution./ 我已确保所有 AI 辅助提交都包含
Co-Authored-By归属信息。I can reproduce all AI-assisted content included in this PR without any AI tools.
/ 我可以在没有任何 AI 工具的情况下重现此 PR 中包含的所有 AI 辅助内容。