Commit Graph

4257 Commits (170cf4e4121178a940a22a55683153c8559d8435)

Author SHA1 Message Date
Ryan Wang 8cd7091d04 fix: package import name of lodash.isequal
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-19 15:41:39 +08:00
Ryan Wang e7dcdd46f1 chore: update github actions
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-19 15:36:44 +08:00
Ryan Wang 3744d2b731 chore: fix @halo-dev/api-client dependency location
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-19 15:08:20 +08:00
Ryan Wang 64b8619bca fix: the issue of redirection after login
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-19 14:56:30 +08:00
Ryan Wang 99ad35e97f docs: update readme
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-19 14:11:45 +08:00
Ryan Wang ca4e4bbeae feat: ui permission binding
see https://github.com/halo-dev/halo/pull/2260
2022-07-19 14:07:28 +08:00
Ryan Wang 1cded7a581 feat: refine roles management
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-19 11:41:05 +08:00
Ryan Wang 84e4cae994 feat: refine roles management
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-19 11:18:47 +08:00
guqing 275df33d75
refactor: scanning of the jsBundleRule for plugins (#2249)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0
<!--
添加其中一个类别:
Add one of the following kinds:

/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement

适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:

/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:
重构 JsBundle 获取方式,增加对 js entry 的文件校验如果不存在,则启用插件时不生成反向代理 APIs
#### Which issue(s) this PR fixes:

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
None
```
2022-07-18 14:42:04 +00:00
Ryan Wang 82d966cba6 perf: add type support to usePluginStore
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-18 16:12:54 +08:00
Ryan Wang c15330f1e8 chore: bump dependencies
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-18 12:35:34 +08:00
Ryan Wang 0f3b17baa9 chore: cleanup type definition
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-18 12:23:14 +08:00
John Niang 1571b9bcf8
Add an API to change password of user (#2250)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.0

#### What this PR does / why we need it:

This PR provides an API to change password of user. If the username is equal to `-`, we will change the password of current login user. Otherwise, we update the password according the request URI.

Here is an example:

- Request

```bash
curl -X 'PUT' \
  'http://localhost:8090/apis/api.halo.run/v1alpha1/users/-/password' \
  -H 'accept: */*' \
  -H 'Content-Type: */*' \
  -d '{
  "password": "openhalo"
}'
```

- Response

```json
{
  "spec": {
    "displayName": "Administrator",
    "email": "admin@halo.run",
    "password": "{bcrypt}$2a$10$/v8/nbxoUFGBDoWfOF2NHOHk.2RS0OFfS5AtN2g/mCGjScX19KvSG",
    "registeredAt": "2022-07-15T07:50:25.151513387Z",
    "twoFactorAuthEnabled": false,
    "disabled": false
  },
  "apiVersion": "v1alpha1",
  "kind": "User",
  "metadata": {
    "name": "admin",
    "annotations": {
      "rbac.authorization.halo.run/role-names": "[\"super-role\"]"
    },
    "version": 5,
    "creationTimestamp": "2022-07-15T07:50:25.255909669Z"
  }
}
```
#### Which issue(s) this PR fixes:

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-07-18 04:18:11 +00:00
Ryan Wang faa7fa9141 feat: add change user password support 2022-07-18 11:52:13 +08:00
guqing 49ea6fbdec
feat: plugin class is registered as a bean at startup (#2255)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind feature
/milestone 2.0
/area core
<!--
添加其中一个类别:
Add one of the following kinds:

/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement

适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:

/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:
插件 plugin.yaml 中不用在写 pluginClass 属性,插件的生命周期类通过标注 `@Component` 注解在启动时通过 PluginApplicationContext 依赖注入并创建实例,这得益于每个插件都有一个单独的 PluginApplicationContext 插件启动时可以将PluginWrapper 放到 Context 以支撑 pluginClass 实例的创建
```yaml
apiVersion: plugin.halo.run/v1alpha1
kind: Plugin
metadata:
  # The name defines how the plugin is invoked,A unique name
  name: PluginTemplate
spec:
  pluginClass: run.halo.template.TemplatePlugin
```
现在只需要如下方式即可无需配置 pluginClass
```java
@Component
public class TemplatePlugin extends BasePlugin {}
```
#### Which issue(s) this PR fixes:

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
None
```
2022-07-18 02:56:10 +00:00
Ryan Wang 24e1a3c4f7 fix: permission logic of super administrator
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-16 12:04:58 +08:00
Ryan Wang d5c1e3e428 feat: support permission judgment of interface elements and routes 2022-07-15 16:26:27 +08:00
John Niang ca3cff277a
Create super admin initializer and run extension controllers conditionally (#2248)
#### What type of PR is this?

/kind improvement
/kind failing-test
/area core
/milestone 2.0

#### What this PR does / why we need it:

Before this PR, our unit tests were flaky to run. After my inspection, I found that extension controllers will run asynchronously at every unit test that is annotated `@SpringBootTest` annotation. Please see the log of failing test:

```java
ExtensionConfigurationTest > shouldReturnNotFoundWhenSchemeNotRegistered() FAILED
    java.lang.AssertionError at ExtensionConfigurationTest.java:72
```

So this PR makes Halo create super admin initializer and run extension controllers conditionally, especially in tests.

You can configure the following property to disable super admin initialization and extension controllers running:

```yaml
halo:
  security:
    initializer:
      disabled: true
  extension:
    controller:
      disabled: true
```

BTW, we can configure the initial username and password for super administrator:

```yaml
halo:
  security:
    initializer:
      super-admin-username: admin
      super-admin-password: P@88w0rd
```

#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
None
```
2022-07-15 06:43:09 +00:00
guqing 7000885133
refactor: super administrator role has all UI permissions (#2247)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0
<!--
添加其中一个类别:
Add one of the following kinds:

/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement

适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:

/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:
- 超级管理员具有所有 ui-permissions
- 根据用户名获取权限的接口标记非空文档注解
#### Which issue(s) this PR fixes:

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
None
```
2022-07-15 04:23:09 +00:00
guqing 90da5a13a1
refactor: the way of plugin initialize load (#2242)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0
<!--
添加其中一个类别:
Add one of the following kinds:

/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement

适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:

/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:
1. 优化插件初始化加载方式及 Plugin 自定义模型资源的更新
2. 插件 plugin.yaml 中 license 配置不再支持只配置字符串,而使用如下替代
```yaml
license:
  - name: "MIT"
```
3. 可以在 application.yaml 中配置
```yaml
halo:
  initial-extension-locations:
    - "path/to/extensions/yaml"
```
用于在系统启动时创建或更新自定义模型数据
#### Which issue(s) this PR fixes:

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
None
```
2022-07-14 14:55:09 +00:00
Ryan Wang 1f0ea9d168 refactor: change role annotations name
change `plugin.halo.run/dependencies` to `rbac.authorization.halo.run/dependencies`
2022-07-14 18:39:19 +08:00
John Niang 1cbd3c74e3
Refactor the response structure of Extension list API (#2244)
#### What type of PR is this?

/kind improvement
/kind api-change
/area core
/milestone 2.0

#### What this PR does / why we need it:

This PR is refactoring the response structure of Extension list API as follows:

```json
{
  "page": 0,
  "size": 0,
  "total": 1,
  "items": [
    {
      "spec": {
        "displayName": "Administrator",
        "email": "admin@halo.run",
        "password": "{bcrypt}$2a$10$/YveWyuf9vyYrHE3fiToI.bGBy5Hgs1eViRvKzU7Kl982la5NSwWO",
        "registeredAt": "2022-06-17T09:35:47.237625514Z",
        "twoFactorAuthEnabled": false,
        "disabled": false
      },
      "apiVersion": "v1alpha1",
      "kind": "User",
      "metadata": {
        "name": "admin",
        "annotations": {
          "user.halo.run/roles": "[\"super-role\"]",
          "rbac.authorization.halo.run/role-names": "[\"second-super-role\",\"super-role\"]"
        },
        "version": 3077,
        "creationTimestamp": "2022-06-17T09:35:47.367919552Z"
      }
    }
  ],
  "first": true,
  "last": true,
  "hasNext": false,
  "hasPrevious": false
}
```

Instead of items only.

#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:

Steps to test:

1. Start Halo server
2. Request <http://localhost:8090/swagger-ui.html> from browser and you might be redirected to login page
3. Login with your username and password
4. Try to request the list endpoints and see the result.

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-07-14 08:53:09 +00:00
Ryan Wang 16cf4d70a1 refactor: response structure of Extension list API
see halo-dev/halo#2244
2022-07-14 16:48:54 +08:00
guqing a8db2e5e4b
refactor: the value structure of ConfigMap for Setting custom extension (#2243)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0
<!--
添加其中一个类别:
Add one of the following kinds:

/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement

适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:

/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:
由于 Setting 自定义模型关联表单值的存储结构改变,对应修改 SettingFetcher 的取值方式
https://github.com/halo-dev/rfcs/pull/18
#### Which issue(s) this PR fixes:

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
None
```
2022-07-14 08:19:09 +00:00
Ryan Wang 878129d072 fix: admin ui theme system not working in production env
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-14 11:54:23 +08:00
Ryan Wang 03bb8d6bc6 refactor: admin ui theme system
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-14 11:38:13 +08:00
guqing 55040d6918
feat: add an API to fetch user permissions (#2240)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind feature
/area core
/milestone 2.0
<!--
添加其中一个类别:
Add one of the following kinds:

/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement

适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:

/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:
新增 `/apis/api.halo.run/v1alpha1/users/{name}/permissions` endpoint 用于根据用户名查询所具有的角色和 ui 权限
1. 当 Role 变更时在 Role reconciler 中查询该 Role 的依赖 Role 聚合其 metadata.annotations 中的 `rbac.authorization.halo.run/ui-permissions` 到当前 Role 的 metadata.annotations 中 key 为`rbac.authorization.halo.run/ui-permissions-aggregated`避免覆盖修改当前 Role 的 `rbac.authorization.halo.run/ui-permissions`
2. 根据用户名查询 ui 权限时,先根据用户名获取 RoleBinding 再获取 Role 然后合并 metadata.annotation 中的两个 key:`rbac.authorization.halo.run/ui-permissions` 和 `rbac.authorization.halo.run/ui-permissions-aggregated` 得到权限作为 API 返回值
#### Which issue(s) this PR fixes:

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
None
```
2022-07-14 03:17:09 +00:00
John Niang fe816e6843
Add checkout-from parameter for composite action (#2241)
#### What type of PR is this?

/kind bug

#### What this PR does / why we need it:

Add checkout-from parameter for composite action. Please see <a801af5be5/README.md>.

If we don't set the parameter for the action, it will checkout from `default branch` to build docker image. You can see <https://github.com/halo-dev/halo/runs/7316162265?check_suite_focus=true#step:2:478>.

#### Which issue(s) this PR fixes:

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-07-13 09:41:09 +00:00
Ryan Wang 75b76ec919 refactor: removal of plugin batch operation
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-13 17:39:31 +08:00
Ryan Wang 728dab4b74 refactor: api client
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-13 15:36:21 +08:00
John Niang faae645e88
Add an endpoint to grant permissions to user (#2239)
#### What type of PR is this?

/kind feature
/kind api-change
/area core
/milestone 2.0

#### What this PR does / why we need it:

Add an endpoint to grant permissions to user.

#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:

Test steps:

1. Start Halo
2. Check the initial password in the console log
3. Request <http://localhost:8090/webjars/swagger-ui/index.html> from browser and you will be redirected to login page
4. Input the username(admin) and the password you got just now
5. Grant permission as you wish

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-07-13 07:17:08 +00:00
Ryan Wang a023974db8 typo: configmapName -> configMapName
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-13 10:13:52 +08:00
Ryan Wang 4bd201d399 chore: bump dependencies
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-13 10:11:43 +08:00
guqing de493ccb2c
feat: add plugin setting support (#2238)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind feature
/area core
/milestone 2.0
<!--
添加其中一个类别:
Add one of the following kinds:

/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement

适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:

/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:
新增插件设置,允许通过 Setting 自定义模型生成表单并收集其值为 ConfigMap
插件可以通过注入 SettingFetcher 来获取值并使用它,例如:
```java
Sns sns = settingFetcher.getGroupForObject("sns", Sns.class);
```
#### Which issue(s) this PR fixes:

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
None
```
2022-07-12 14:57:08 +00:00
Ryan Wang 3fceca7efa feat: add granting roles for user support
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-12 21:10:17 +08:00
Ryan Wang 13c4267a84 feat: add settings support to the plugin
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-12 20:32:32 +08:00
guqing abe29c12bf
feat: add configmap extension (#2232)
* feat: add configmap extension
2022-07-12 15:31:29 +08:00
Ryan Wang e721fadf86 fix: role creation
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-12 15:06:46 +08:00
Ryan Wang 37cf54bcd6 refactor: pagination component usage
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-12 11:11:05 +08:00
John Niang 5953d2201d
Refactor CICD for Halo next (#2236) 2022-07-12 11:01:00 +08:00
Ryan Wang 9e16e1f26c feat: add pagination component
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-11 18:16:45 +08:00
Ryan Wang 4b84ee053e perf: refine dialog component
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-11 16:27:46 +08:00
Ryan Wang c9e3536040 perf: open confirm dialog when changing plugin status
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-11 16:07:21 +08:00
Ryan Wang 0e853e2e8b perf: refine tailwindcss config
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-11 12:25:24 +08:00
Ryan Wang ecef9d90b7 chore: add Dockerfile
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-11 11:02:48 +08:00
Ryan Wang 83d8216fc2 feat: add url base config
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-11 10:21:38 +08:00
Ryan Wang c97804780b
refactor: configure the api request to allow credentials and X-XSRF-TOKEN,COOKIE headers (#2227)
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-08 09:44:13 +00:00
Ryan Wang a80c5298ef chore: bump @halo-dev/admin-shared version
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-08 15:27:46 +08:00
Ryan Wang edc505a648 chore: add changeset
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-07-08 15:14:59 +08:00
guqing 3e8f8b8789
feat: add plugin reconciler (#2221)
* feat: add plugin reconciler

* feat: add unit test case
2022-07-08 07:08:13 +00:00