feat: 适配interface协议中的加密字段 - #328
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
您好——我发现了 2 个问题
AI 代理提示词
请处理本次代码审查中的评论:
## 个别评论
### 评论 1
<location path="src/services/maaService.ts" line_range="20" />
<code_context>
InstanceRuntimeInfo,
} from '@/types/maa';
import { loggers } from '@/utils/logger';
+import { redactSecretsInText } from '@/utils/passwordOptionValues';
+import { redactSecretsInText } from '@/utils/passwordOptionValues';
import { isTauri } from '@/utils/paths';
</code_context>
<issue_to_address>
**issue (bug_risk):** 该模块从同一路径两次导入 `redactSecretsInText`,因此 TypeScript 会报告重复导入/声明错误,前端构建无法通过编译。
**建议修复:** 删除其中一个重复的导入。
</issue_to_address>
### 评论 2
<location path="src/utils/tabExportImport.ts" line_range="264-267" />
<code_context>
projectName: string,
hint?: string,
footer?: string,
+ allOptions?: Record<string, OptionDefinition>,
): Promise<string> {
const payload: TabExportPayload = {
</code_context>
<issue_to_address>
**🚨 issue (security):** 新的加密参数是可选的,而现有的 `TabBar` 导出调用点没有传入该参数。因此,这些导出会采用 `: t.optionValues` 回退值,并将运行时的明文密码值写入导出的配置中。
**触发条件:** 通过 TabBar 剪贴板或文件导出菜单导出密码选项时。
**建议修复:** 在 TabBar 的 `exportWithToast` 和 `exportFileWithToast` 调用中传入 `projectInterface?.option`,或者让导出 API 强制要求传入选项定义。
</issue_to_address>帮助我变得更有用!请在每条评论上点击 👍 或 👎,我会利用反馈来改进审查结果。
Original comment in English
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/services/maaService.ts" line_range="20" />
<code_context>
InstanceRuntimeInfo,
} from '@/types/maa';
import { loggers } from '@/utils/logger';
+import { redactSecretsInText } from '@/utils/passwordOptionValues';
+import { redactSecretsInText } from '@/utils/passwordOptionValues';
import { isTauri } from '@/utils/paths';
</code_context>
<issue_to_address>
**issue (bug_risk):** The module imports `redactSecretsInText` twice from the same path, so TypeScript reports a duplicate import/declaration error and the frontend build does not compile.
**Suggested fix:** Remove one of the duplicate imports.
</issue_to_address>
### Comment 2
<location path="src/utils/tabExportImport.ts" line_range="264-267" />
<code_context>
projectName: string,
hint?: string,
footer?: string,
+ allOptions?: Record<string, OptionDefinition>,
): Promise<string> {
const payload: TabExportPayload = {
</code_context>
<issue_to_address>
**🚨 issue (security):** The new encryption parameter is optional, and the existing `TabBar` export call sites do not pass it. Those exports therefore take the `: t.optionValues` fallback and place the runtime plaintext password values into the exported configuration.
**Triggers:** When a password option is exported through the TabBar clipboard or file-export menu.
**Suggested fix:** Pass `projectInterface?.option` to the TabBar `exportWithToast` and `exportFileWithToast` calls, or make the export APIs require the option definitions.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Owner
|
冲突了康康 |
overflow65537
force-pushed
the
feat/input-password-field
branch
from
August 26, 2026 13:31
3e04fea to
1d47abe
Compare
30 tasks
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.
Sourcery 摘要
新增对加密接口密码字段的端到端处理,同时防止其通过 UI、日志、遥测数据和配置导出被泄露。
新功能:
错误修复:
增强功能:
Original summary in English
Sourcery 摘要
保护接口协议中的密码字段,使其在存储和配置交换过程中加密,并在所有用户可见输出中脱敏。
新功能:
错误修复:
增强功能:
Original summary in English
Sourcery 总结
保护接口协议中的密码字段,使其在存储、配置交换和用户可见输出中保持安全。
新功能:
错误修复:
改进:
Original summary in English
Summary by Sourcery
保护接口协议中的密码字段,使其在存储、配置交换和用户可见输出中保持安全。
New Features:
Bug Fixes:
Enhancements: