Skip to content
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

[优化] 审计页面搜索疑惑 #528

Open
wklken opened this issue Jul 4, 2022 · 1 comment
Open

[优化] 审计页面搜索疑惑 #528

wklken opened this issue Jul 4, 2022 · 1 comment
Assignees
Labels
Layer: api Api module related Priority: High Sign: help wanted Extra attention is needed Type: enhancement Enhancement for existing feature

Comments

@wklken
Copy link
Collaborator

wklken commented Jul 4, 2022

image

- 操作人员, 有数据: `admin`
- 操作类型: 更新用户字段 没有数据
    - 删除  有数据
    - 删除用户  没有数据
- 操作对象: 
    - 测试设置用 有数据 
    - 测试设置用t<testuse> 没数据(应该是不支持特殊字符)
@wklken wklken added Type: enhancement Enhancement for existing feature Sign: help wanted Extra attention is needed Layer: api Api module related Priority: High labels Jul 4, 2022
@wklken
Copy link
Collaborator Author

wklken commented Jul 5, 2022

目前的实现:

  • a3<a3.com> 需要仅搜索 a3 或仅搜索a3.com, 因为<>是额外拼装上去展示的, 放在一起 100%搜索不到
  • 操作类型的逻辑是: 只能识别 创建/更新/删除(即前半段), 因为这个字段也是 操作+对象拼接的; 所以连在一起搜索不到

所以这里应该做的是, 拆分成多个字段

  • 操作类型: 拆成 操作 + 类型
  • 操作对象: 拆成 对象 + 对象类型id

def to_representation(self, instance):
extra_value = instance["extra_value"]
categories = self.context.get("categories")
instance["target_obj"] = f"{extra_value['display_name']}<{extra_value['key']}>"
instance["operation"] = (
f"{OPERATION_NAME_MAP[extra_value['operation']]}"
if extra_value['operation'] in OPERATION_ABOUT_PASSWORD
else (
f"{OPERATION_NAME_MAP[extra_value['operation']]}"
f"{OPERATION_OBJ_NAME_MAP[extra_value.get('obj_type')]}"
)
)

@wklken wklken changed the title [bug] 审计页面搜索问题 [优化] 审计页面搜索疑惑 Jul 5, 2022
@nannan00 nannan00 mentioned this issue Nov 10, 2022
34 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layer: api Api module related Priority: High Sign: help wanted Extra attention is needed Type: enhancement Enhancement for existing feature
Projects
None yet
Development

No branches or pull requests

2 participants