halo icon indicating copy to clipboard operation
halo copied to clipboard

feat: add some APIs to separate theme-related Setting and ConfigMap permissions

Open guqing opened this issue 3 years ago • 1 comments

What type of PR is this?

/kind feature /milestone 2.2.x /area core /kind api-change

What this PR does / why we need it:

添加自定义 APIs 以分离主题对 Setting 和 ConfigMap 权限的依赖

⚠️ 此 PR 新增了 APIs,需要 Console 对其进行适配,主题菜单下获取激活主题的 API 以及查询主题 Setting、ConfigMap 的 APIs 需要更改。

Which issue(s) this PR fixes:

A part of #3069

Special notes for your reviewer:

how to test it?

  • 测试 GET /themes/-/activation 此 endpoint 是否能正确获取到激活主题信息
  • 测试 GET /themes/{name}/setting 是否能正确获取到主题名称对应的主题的 Setting,如果 name 为 - 表示查询当前激活主题的 Setting
  • 测试 GET /themes/{name}/config 是否能正确获取到主题名称对应的主题的 ConfigMap, 如果 name 为 - 表示查询当前激活主题的 ConfigMap。
  • 测试 PUT themes/{name}/config 是否能更新主题的 ConfigMap,如果名称不匹配则抛出异常。 切换用户为其分配主题的查看权限可以有权限调用以上描述的 GET 请求的 endpoints,管理权限可以调用 PUT themes/{name}/config
  • 测试 PUT /themes/{name}/activation 是否能设置激活主题。

/cc @halo-dev/sig-halo

Does this PR introduce a user-facing change?

添加自定义 APIs 以分离主题对 Setting 和 ConfigMap 权限的依赖

guqing avatar Jan 11 '23 10:01 guqing

ping @halo-dev/sig-halo

ruibaby avatar Jan 17 '23 06:01 ruibaby

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang, ruibaby

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • ~~OWNERS~~ [JohnNiang,ruibaby]

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

f2c-ci-robot[bot] avatar Jan 30 '23 06:01 f2c-ci-robot[bot]