Repository navigation
feat(dashboard): mask peer address and account in bridge connection cards - #2168
Merged
jubaoliang merged 2 commits intoOct 23, 2026
Merged
Conversation
Cloud bridge connection cards are the usual screen-share surface, so the peer address and account now render masked by default: - address: keep the scheme/port plus the first and last two characters of the host; IPv4 keeps the first and last octet (middle two masked) - account: keep the first and last two characters; accounts shorter than six characters keep only the first character - fixed-width dots, so the masked length does not leak the real length A master switch in the panel toolbar (on by default, persisted in localStorage) controls the whole page, and each card/table row can be revealed temporarily. Reveals are session-only and reset on reload or when the master switch flips. The edit drawer keeps plaintext values, since that is where connection data is edited. Display only: no API, storage or tooltip changes.
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.
Summary
云端协同的连接卡片和表格会直接显示对端地址与对端账号。开会截图、共享屏幕或投屏时,这两项会连带暴露内网拓扑(host/IP)和账号名。
这个 PR 把两者在展示层打码,并且只改展示层:
交互上分两级:
localStorage(octop:bridge:hide-peer-info),跨会话保持;关闭后整页明文,单条揭示按钮自动隐藏编辑抽屉保持明文 —— 那里是真正要改地址账号的地方。tooltip(
title)和接口返回都没有改动。Target branch
develop(feature / fix — default)main(release/*orhotfix/*only)Type of change
Changes
dashboard/src/pages/Settings/AdvancedSettings/bridgePeerLabel.tsmaskPeerAddress/maskPeerAccount,与已有peerHostLabel放在同一模块dashboard/src/pages/Settings/AdvancedSettings/bridgePeerLabel.test.tsdashboard/src/pages/Settings/AdvancedSettings/BridgeSettings.tsxInboundPeerFacts增加privacy参数,编辑抽屉传明文dashboard/src/pages/Settings/AdvancedSettings/BridgeSettings.module.lessdashboard/src/pages/Settings/AdvancedSettings/BridgeSettings.test.tsxdashboard/src/locales/{zh,en}.jsonCHANGELOG.md[Unreleased]→变更被动接入(对端主动拨入)的连接原本就展示观测到的 IP,属于同一类泄露,因此并入同一套开关。
Test plan
在
dashboard/下执行:npx tsc --noEmit -p tsconfig.app.json→ 通过npx eslint src/pages/Settings/AdvancedSettings/→ 通过npx prettier --check→ 通过npx vitest run src/pages/Settings/AdvancedSettings/→ 12 个打码单测 + 4 个组件测试全部通过npm run build→ 通过(产物写入src/octop/dashboard/,已 gitignore)make allpasses locally(前端部分已按上面的命令跑过;make all全量未在容器内跑,见下)Added/updated tests
npm test全量结果:266 个文件、1398 个用例,7 个文件失败(knowledgeBases/publishedExperts/AuthGuard/DocumentPreviewCore.docxSanitize/SkillDrawer/skillMarkdown/ChatInput.prefill)。这 7 个在干净的develop上以同样方式失败,与本次改动无关(本地 stash 后复现确认)。Checklist
CHANGELOG.md(if user-facing)说明
打码输出与开关行为由上面的单测和组件测试覆盖,实际渲染字符串例如:
https://cloud.corp.example.comhttps://cl••••••omhttp://sandbox-a156c721:8088http://sa••••••21:8088203.0.113.8203.•••.•••.8administratorad••••••oralice(5 位)a••