8000 Add init password hints. by KomachiSion · Pull Request #13348 · alibaba/nacos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add init password hints. #13348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

KomachiSion
Copy link
Collaborator

Please do not create a Pull Request without creating an issue first.

What is the purpose of the change

XXXXX

Brief changelog

XX

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.

@KomachiSion KomachiSion added this to the 3.0.1 milestone May 8, 2025
@KomachiSion KomachiSion added kind/enhancement Category issues or prs related to enhancement. area/Nacos console Related to Nacos consle labels May 8, 2025
Copy link
github-actions bot commented May 8, 2025

Thanks for your this PR. 🙏
Please check again for your PR changes whether contains any usage/api/configuration change such as Add new API , Add new configuration, Change default value of configuration.
If so, please add or update documents(markdown type) in docs/next/ for repository nacos-group/nacos-group.github.io


感谢您提交的PR。 🙏
请再次查看您的PR内容,确认是否包含任何使用方式/API/配置参数的变更,如:新增API新增配置参数修改默认配置等操作。
如果是,请确保在提交之前,在仓库nacos-group/nacos-group.github.io中的docs/next/目录下添加或更新文档(markdown格式)。

Copy link
lingma-agents bot commented May 8, 2025

增强密码初始化提示及UI布局调整

变更文件

文件路径 变更说明
console-ui/src/locales/en-US.js 新增`internalSysTip3`、`internalSysTip4`和`hintSavePassword`三个国际化键值,用于提示用户初始化管理员密码时需使用强密码并妥善保管。
console-ui/src/locales/zh-CN.js 增加`internalSysTip3`(初始化nacos用户密码)、`internalSysTip4`(强密码建议)及`hintSavePassword`(密码保存提示),并调整`pleaseInputPasswordTips`输入提示语。
console-ui/​src/​pages/​Register/​Register.jsx 在密码初始化成功弹窗中动态显示生成的密码值及保存提示,新增`.internal-sys-tip2`容器展示安全建议文本,移除冗余提示内容。
console-ui/​src/​pages/​Register/​index.scss 定义`.internal-sys-tip2`样式类,设置字体大小15px、红色高亮、居中对齐等样式,用于区分不同层级的安全提示信息。
console/​src/​main/​resources/​static/​index.html 修改`main.css`和`main.js`的查询参数(如`52d7f4f...`),强制浏览器加载最新版本的样式与脚本资源。

💡 小贴士

与 lingma-agents 交流的方式

📜 直接回复评论
直接回复本条评论,lingma-agents 将自动处理您的请求。例如:

  • 在当前代码中添加详细的注释说明。

  • 请详细介绍一下你说的 LRU 改造方案,并使用伪代码加以说明。

📜 在代码行处标记
在文件的特定位置创建评论并 @lingma-agents。例如:

  • @Lingma-Agent 分析这个方法的性能瓶颈并提供优化建议。

  • @Lingma-Agent 对这个方法生成优化代码。

📜 在讨论中提问
在任何讨论中 @lingma-agents 来获取帮助。例如:

  • @Lingma-Agent 请总结上述讨论并提出解决方案。

  • @Lingma-Agent 请根据讨论内容生成优化代码。

@KomachiSion KomachiSion merged commit 8ecdd5d into alibaba:develop May 8, 2025
4 of 5 checks passed
Copy link
@lingma-agents lingma-agents bot left a comment

Choose a reason for hiding this comment

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

🔍 代码评审报告

🎯 评审意见概览

严重度 数量 说明
🔴 Blocker 1 阻断性问题,需立即修复。例如:系统崩溃、关键功能不可用或严重安全漏洞。
🟠 Critical 0 严重问题,高优先级修复。例如:核心功能异常或性能瓶颈影响用户体验。
🟡 Major 0 主要问题,建议修复。例如:非核心功能缺陷或代码维护性较差。
🟢 Minor 1 次要问题,酌情优化。例如:代码格式不规范或注释缺失。

总计: 2 个问题

⚠️ **需要立即关注的阻断性问题**

console-ui/src/pages/Register/Register.jsx


📋 评审意见详情

💡 单文件建议

以下是文件级别的代码建议,聚焦于代码的可读性、可维护性和潜在问题。
⚛️ console-ui/src/pages/Register/Register.jsx (1 💬)
🎨 console-ui/src/pages/Register/index.scss (1 💬)

🚀 跨文件建议

以下是对代码架构和设计的综合分析,聚焦于跨文件交互、系统一致性和潜在优化空间。
🔍 1. 新增密码相关功能缺乏测试覆盖

新增的初始化密码提示功能(如密码明文展示、保存提示等)未在单元测试或E2E测试中体现。当前PR中未包含任何测试文件的更新,可能导致未来维护时功能可靠性无法保障。建议为密码提示展示、用户交互流程等核心场景补充测试用例。

⚠️ 潜在风险: 未覆盖的测试可能导致后续代码变更时出现不可预见的UI异常或逻辑漏洞,增加维护成本

🔍 2. CSS样式定义存在冗余风险

在src/locales/zh-CN.js和en-US.js中新增的internalSysTip3/4提示信息,其对应样式在src/pages/Register/index.scss和console/src/main/resources/static/css/main.css中均存在同名类定义(.internal-sys-tip2)。需确认两个样式文件的加载顺序是否会导致样式覆盖或冲突,建议统一CSS维护规范。

📌 关键代码:

.internal-sys-tip2 { width: 100%; line-height: 15px; font-size: 15px; margin-top: 15px; text-align: center; font-weight: 800; }
.home-page .top-section .login-panel .internal-sys-tip2{width:100%;line-height:15px;font-size:15px;margin-top:15px;text-align:center;font-weight:800}

⚠️ 潜在风险: 样式定义分散可能导致不同环境下的渲染差异,增加跨浏览器/版本的兼容性风险

🔍 3. 国际化字符串管理分散

新增的初始化密码相关提示(如internalSysTip3、internalSysTip4、hintSavePassword)分散在多个locales文件中,未形成独立的密码管理模块。建议将密码相关提示集中到独立的password.i18n模块,提升国际化字符串的可维护性

⚠️ 潜在风险: 分散管理可能导致后续维护时出现重复定义或遗漏翻译,增加本地化工作的复杂度

🔍 4. 静态资源版本控制风险

console/src/main/resources/static/index.html中main.css和main.js的版本参数(52d7f4f6947bc2e25f20)与旧版本(fafb9812f71694525187)存在差异,但未提供版本更新说明。需确认该改动是否影响静态资源缓存策略,是否存在版本回滚风险

📌 关键代码:

<link href="./css/main.css?52d7f4f6947bc2e25f20" rel="stylesheet">

⚠️ 潜在风险: 版本控制不明确可能导致生产环境资源加载异常,或浏览器缓存策略失效引发兼容性问题


💡 小贴士

与 lingma-agents 交流的方式

📜 直接回复评论
直接回复本条评论,lingma-agents 将自动处理您的请求。例如:

  • 在当前代码中添加详细的注释说明。

  • 请详细介绍一下你说的 LRU 改造方案,并使用伪代码加以说明。

📜 在代码行处标记
在文件的特定位置创建评论并 @lingma-agents。例如:

  • @Lingma-Agent 分析这个方法的性能瓶颈并提供优化建议。

  • @Lingma-Agent 对这个方法生成优化代码。

📜 在讨论中提问
在任何讨论中 @lingma-agents 来获取帮助。例如:

  • @Lingma-Agent 请总结上述讨论并提出解决方案。

  • @Lingma-Agent 请根据讨论内容生成优化代码。

@@ -72,7 +72,7 @@ class Register extends React.Component {
localStorage.setItem('token', JSON.stringify(res));
Dialog.alert({
title: locale.Login.initPassword + locale.ListeningToQuery.success,
content: locale.Password.newPassword + ':' + res.password,
content: (<div><div>{locale.Password.newPassword}:{res.password}</div><div>{locale.Password.hintSavePassword}</div></div>),
Copy link

Choose a reason for hiding this comment

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

直接展示明文密码存在安全风险

🔴 Blocker | 🔓 Vulnerabilities

📋 问题详情

在初始化密码成功后,直接在页面上以明文形式展示用户密码(res.password),可能导致密码泄露风险。攻击者可通过截图、网络监控等手段获取用户密码,严重违反安全规范。

💡 解决方案

应将密码值替换为星号或其他安全占位符,并通过其他安全方式通知用户(如邮件/短信)。修改示例:

- content: (<div><div>{locale.Password.newPassword}:{res.password}</div><div>{locale.Password.hintSavePassword}</div></div>),
+ content: (<div><div>{locale.Password.newPassword}:••••••••</div><div>{locale.Password.hintSavePassword}</div></div>),

您的反馈对我们很重要!(建议右键在新标签页中打开以下链接)

有用意见👍无用意见👎错误意见❌

Comment on lines +66 to +72
.internal-sys-tip2 {
width: 100%;
line-height: 15px;
font-size: 15px;
margin-top: 15px;
text-align: center;
font-weight: 800;
Copy link

Choose a reason for hiding this comment

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

CSS类命名不符合BEM规范

🟢 Minor | 🧹 Code Smells

📋 问题详情

新增的.internal-sys-tip2类名未遵循BEM命名规范,与.internal-sys-tip形成不一致的命名结构,导致样式管理混乱。

💡 解决方案

建议改为:

- .internal-sys-tip2 {
+ .internal-sys-tip__second {

您的反馈对我们很重要!(建议右键在新标签页中打开以下链接)

有用意见👍无用意见👎错误意见❌

@KomachiSion KomachiSion deleted the upstream-develop-ui-enhance branch May 8, 2025 02:51
@wuyfee
Copy link
wuyfee commented May 8, 2025

$\color{red}{FAILURE}$
DETAILS
✅ - docker: success
❌ - deploy (standalone & cluster & standalone_auth): failure
❌ - e2e-java-test (standalone & cluster & standalone_auth): skipped
❌ - e2e-go-test (standalone & cluster): skipped
❌ - e2e-cpp-test (standalone & cluster): skipped
❌ - e2e-csharp-test (standalone & cluster): skipped
❌ - e2e-nodejs-test (standalone & cluster): skipped
❌ - e2e-python-test (standalone & cluster): skipped
✅ - clean (standalone & cluster & standalone_auth): success

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/Nacos console Related to Nacos consle kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0