Skip to content

feat(account): make passwordEncryptionAlgorithm config writable#1140

Merged
fly602 merged 1 commit into
linuxdeepin:masterfrom
qxp930712:master
Jun 10, 2026
Merged

feat(account): make passwordEncryptionAlgorithm config writable#1140
fly602 merged 1 commit into
linuxdeepin:masterfrom
qxp930712:master

Conversation

@qxp930712

Copy link
Copy Markdown

This commit changes the passwordEncryptionAlgorithm configuration permission from readonly to readwrite, allowing applications to modify the password encryption algorithm setting directly. Key changes include:

  1. Updated permissions field from 'readonly' to 'readwrite' in account DSG config
  2. Enabled write access for password encryption algorithm settings (sha512, sha256, yescrypt, sm3)

The change allows authorized applications to configure the password encryption algorithm, providing more flexible account management capabilities.

Log: 将密码加密算法配置项权限改为可读写
Influence:

  1. 验证授权应用程序能否正常修改密码加密算法设置
  2. 确认各加密算法(sha512/sha256/yescrypt/sm3)切换正常
  3. 检查配置修改后用户创建/修改密码功能正常
  4. 确认未授权应用无法修改该配置项

PMS: TASK-390539

This commit changes the passwordEncryptionAlgorithm configuration
permission from readonly to readwrite, allowing applications to
modify the password encryption algorithm setting directly.
Key changes include:
1. Updated permissions field from 'readonly' to 'readwrite' in
   account DSG config
2. Enabled write access for password encryption algorithm settings
   (sha512, sha256, yescrypt, sm3)

The change allows authorized applications to configure the password
encryption algorithm, providing more flexible account management
capabilities.

Log: 将密码加密算法配置项权限改为可读写
Influence:
1. 验证授权应用程序能否正常修改密码加密算法设置
2. 确认各加密算法(sha512/sha256/yescrypt/sm3)切换正常
3. 检查配置修改后用户创建/修改密码功能正常
4. 确认未授权应用无法修改该配置项

PMS: TASK-390539

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @qxp930712, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602, qxp930712

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602, qxp930712

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

我对这个git diff的修改进行审查:

修改内容:

  • passwordEncryptionAlgorithm的权限从readonly更改为readwrite

审查意见:

  1. 语法逻辑:

    • JSON格式正确,修改符合JSON语法规范
    • 权限值从"readonly"改为"readwrite"是有效的值变更
  2. 代码质量:

    • 这个修改将原本只读的配置项改为可读写,可能会影响系统的安全性
    • 密码加密算法是系统安全的关键配置,允许动态修改可能导致安全问题
  3. 代码性能:

    • 此修改对性能影响不大,因为这是一个配置项的变更
  4. 代码安全:

    • 安全风险较高:密码加密算法是安全相关的核心配置
    • 允许运行时修改加密算法可能导致:
      • 使用不安全的加密算法
      • 加密算法不一致导致密码验证失败
      • 可能被恶意软件利用修改为弱加密算法
    • 建议保持readonly权限,或者至少需要管理员权限才能修改

改进建议:

  1. 如果确实需要修改此配置,建议:

    • 保持readonly权限,通过系统更新或重启时应用新配置
    • 或者添加额外的权限检查,要求管理员权限才能修改
    • 可以添加配置变更的审计日志记录
  2. 如果必须支持运行时修改,建议:

    • 添加算法有效性验证,只允许预定义的安全算法
    • 添加修改确认机制,防止误操作
    • 在修改后强制要求重新登录或密码重置
  3. 考虑添加配置变更的说明文档,解释何时以及为什么需要修改此配置

总结:这个修改虽然从语法上是正确的,但从安全角度来看存在较大风险,不建议将密码加密算法的配置设为可读写。

@fly602 fly602 merged commit 2f15f14 into linuxdeepin:master Jun 10, 2026
15 of 16 checks passed
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.

4 participants