feat: 敏感配置 + JSONC 支持#241
Open
animacaeli wants to merge 1 commit into
Open
Conversation
- Add sensitive configuration: new Sensitive field on Config/PublishDetail entities, Config_ViewSensitive permission for controlling access to sensitive values, and mask logic (******) in admin API when user lacks the permission. - Add JSONC (JSON with Comments) support: DictionaryConvertToJsonC serializer outputs descriptions as inline // comments, JsonCConfigurationFileParser extracts comments back to descriptions using Newtonsoft.Json JsonTextReader. - Fix SaveFromDictAsync to set Description for newly created configs from JSONC. - EnvSync now propagates Sensitive and Description changes across environments. - Frontend: sensitive switch in add/edit forms, lock icon column, jsonc language in Monaco editor, i18n for zh-CN and en-US. - Unit tests for JSONC serializer, parser, and round-trip conversion. Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
|
Cool. |
Author
数据库和客户端都是原始值,在前端受到权限控制显示掩码 |
Author
|
@kklldog 这个 PR 需要你那边注意看下,我只是针对我们架构的痛点进行补充,不会 C#,全部是都是Claude Code 写的。麻烦您审核一下,如果有其他问题,辛苦反馈。 |
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 新增两个功能:敏感配置和 JSONC 编辑支持。
一、敏感配置
功能描述
CONFIG_VIEW_SENSITIVE权限才能查看明文******后端变更
安全设计
前端变更
二、JSONC(JSON with Comments)支持
功能描述
新增文件
修改文件
双向转换示例
// 保存的 JSONC:
{
"oss": {
"custom_domain": "xxx.com" // 自定义域名
}
}
// 转为表数据:
// group="oss", key="custom_domain", value="xxx.com", description="自定义域名"
附带修复
SaveFromDictAsync 之前新建配置从不设置 Description,现通过 descriptions 可选参数修复,标准 JSON 路径向后兼容。
三、测试
新增 2 个测试文件,共 17 个用例:
四、文件统计
Co-Authored-By: Claude noreply@anthropic.com
🤖 Generated with Claude Code