diff --git a/.github/workflows/arm32.yml b/.github/workflows/arm32.yml
index ef5a465e..1fd51760 100644
--- a/.github/workflows/arm32.yml
+++ b/.github/workflows/arm32.yml
@@ -44,6 +44,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
+ 10.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
diff --git a/.github/workflows/arm64.yml b/.github/workflows/arm64.yml
index 809d5bab..b6a4654e 100644
--- a/.github/workflows/arm64.yml
+++ b/.github/workflows/arm64.yml
@@ -44,6 +44,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
+ 10.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
diff --git a/.github/workflows/master-ci.yml b/.github/workflows/master-ci.yml
index 7c5036ba..ba62b4ae 100644
--- a/.github/workflows/master-ci.yml
+++ b/.github/workflows/master-ci.yml
@@ -35,6 +35,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
+ 10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
diff --git a/.github/workflows/master-pr-ci.yml b/.github/workflows/master-pr-ci.yml
index bef13642..69950c74 100644
--- a/.github/workflows/master-pr-ci.yml
+++ b/.github/workflows/master-pr-ci.yml
@@ -35,6 +35,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
+ 10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
diff --git a/.github/workflows/mysqlconnector.yml b/.github/workflows/mysqlconnector.yml
index 4aeeb255..bf8bc011 100644
--- a/.github/workflows/mysqlconnector.yml
+++ b/.github/workflows/mysqlconnector.yml
@@ -44,6 +44,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
+ 10.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 30cd44dc..fcd31dc2 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -43,6 +43,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
+ 10.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
diff --git a/.github/workflows/release-xxx.yml b/.github/workflows/release-xxx.yml
index 24f242f2..e4f82a2c 100644
--- a/.github/workflows/release-xxx.yml
+++ b/.github/workflows/release-xxx.yml
@@ -43,6 +43,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
+ 10.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
diff --git a/.github/workflows/test-cd.yml b/.github/workflows/test-cd.yml
index 8bf340a3..3339ca46 100644
--- a/.github/workflows/test-cd.yml
+++ b/.github/workflows/test-cd.yml
@@ -45,6 +45,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
+ 10.0.x
- name: Install dependencies
run: dotnet restore
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c84dc19a..66ddc98d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
# Change log
------------------------------
+[Unreleased]
+* Introduced dynamic role management with CRUD APIs and UI allowing custom permission assignments.
+
[1.10.0]
* Use publish timeline virtual id to compare the version between client. To enable this feature the client should use version >=1.8.0 .
diff --git a/Dockerfile b/Dockerfile
index 16b9da49..a1403e19 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
+FROM mcr.microsoft.com/dotnet/aspnet:10.0.0 AS base
RUN sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf
RUN sed -i 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /etc/ssl/openssl.cnf
RUN sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /usr/lib/ssl/openssl.cnf
@@ -6,7 +6,7 @@ RUN sed -i 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /usr/lib/ssl/openssl.
WORKDIR /app
EXPOSE 5000
-FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
+FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY ["src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.csproj", "AgileConfig.Server.Apisite/"]
COPY ["src/AgileConfig.Server.Data.Entity/AgileConfig.Server.Data.Entity.csproj", "AgileConfig.Server.Data.Entity/"]
diff --git a/src/Agile.Config.Protocol/Agile.Config.Protocol.csproj b/src/Agile.Config.Protocol/Agile.Config.Protocol.csproj
index 58990cd5..4340f623 100644
--- a/src/Agile.Config.Protocol/Agile.Config.Protocol.csproj
+++ b/src/Agile.Config.Protocol/Agile.Config.Protocol.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net10.0
diff --git a/src/Agile.Config.Protocol/VMS.cs b/src/Agile.Config.Protocol/VMS.cs
index 929bbcbe..9b2da05f 100644
--- a/src/Agile.Config.Protocol/VMS.cs
+++ b/src/Agile.Config.Protocol/VMS.cs
@@ -1,28 +1,22 @@
-using System;
+namespace Agile.Config.Protocol;
-namespace Agile.Config.Protocol
+public class ActionConst
{
- public class ActionConst
- {
- public const string Offline = "offline";
- public const string Reload = "reload";
- public const string Ping = "ping";
- }
+ public const string Offline = "offline";
+ public const string Reload = "reload";
+ public const string Ping = "ping";
+}
- public class ActionModule
- {
- public const string RegisterCenter = "r";
- public const string ConfigCenter = "c";
- }
+public class ActionModule
+{
+ public const string RegisterCenter = "r";
+ public const string ConfigCenter = "c";
+}
- public class WebsocketAction
- {
- public WebsocketAction()
- {
- }
- public string Module { get; set; }
- public string Action { get; set; }
+public class WebsocketAction
+{
+ public string Module { get; set; }
+ public string Action { get; set; }
- public string Data { get; set; }
- }
-}
+ public string Data { get; set; }
+}
\ No newline at end of file
diff --git a/src/AgileConfig.Server.Apisite/ASCII_FONT.cs b/src/AgileConfig.Server.Apisite/ASCII_FONT.cs
index 84acf3d9..82bf3066 100644
--- a/src/AgileConfig.Server.Apisite/ASCII_FONT.cs
+++ b/src/AgileConfig.Server.Apisite/ASCII_FONT.cs
@@ -1,9 +1,8 @@
using Figgle;
-namespace AgileConfig.Server.Apisite
+namespace AgileConfig.Server.Apisite;
+
+[EmbedFiggleFont("Font", "ogre")]
+internal static partial class ASCII_FONT
{
- [EmbedFiggleFont(memberName: "Font", fontName: "ogre")]
- internal static partial class ASCII_FONT
- {
- }
-}
+}
\ No newline at end of file
diff --git a/src/AgileConfig.Server.Apisite/AgileConfig - Backup.Server.Apisite.csproj b/src/AgileConfig.Server.Apisite/AgileConfig - Backup.Server.Apisite.csproj
deleted file mode 100644
index 8c424cc6..00000000
--- a/src/AgileConfig.Server.Apisite/AgileConfig - Backup.Server.Apisite.csproj
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
- net8.0
- InProcess
- 1.8
- 1.8
- 1.6.20
- Linux
- 1.7.3
- kklldog
- kklldog
-
-
-
- bin\Debug\AgileConfig.Server.Apisite.xml
- 1701;1702;1591;1573
-
-
-
- bin\Release\AgileConfig.Server.Apisite.xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.csproj b/src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.csproj
index 3d9585a5..37141201 100644
--- a/src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.csproj
+++ b/src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.csproj
@@ -1,13 +1,13 @@
- net8.0
+ net10.0
InProcess
- 1.10.0
- 1.10.0
- 1.10.0
+ 1.11.0
+ 1.11.0
+ 1.11.0
Linux
- 1.10.0
+ 1.11.0
kklldog
kklldog
@@ -26,34 +26,37 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
@@ -80,4 +83,4 @@
-
+
\ No newline at end of file
diff --git a/src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.xml b/src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.xml
index f204ec7e..ddcb9e66 100644
--- a/src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.xml
+++ b/src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.xml
@@ -1,499 +1,516 @@
+
-
- AgileConfig.Server.Apisite
-
-
-
-
- 是否演示模式
-
-
-
-
- 是否控制台模式
-
-
-
-
- is password inited ?
-
-
-
-
-
- 初始化密码
-
-
-
-
-
- 应用操作接口
-
-
-
-
- 获取所有应用
-
-
-
-
-
- 根据id获取应用
-
- 应用id
-
-
-
-
- 添加应用
-
- 应用模型
-
-
-
-
- 编辑应用
-
- 应用id
- 编辑后的应用模型
-
-
-
-
- 删除应用
-
- 应用id
-
-
-
-
- 发布某个应用的待发布配置项
-
- 应用id
- 环境
-
-
-
-
- 查询某个应用的发布历史
-
- 应用id
- 环境
-
-
-
-
- 回滚某个应用的发布版本,回滚到 historyId 指定的时刻
-
- 发布历史
- 环境
-
-
-
-
- 根据appid查所有发布的配置项 , 包括继承过来的配置项.
- 注意: 这个接口用的不是用户名密码的认证,用的是appid + secret的认证
-
- 应用id
- 环境
-
-
-
-
- 根据应用id查找配置,这些配置有可能是未发布的配置 。请跟 config/app/{appId} 接口加以区分。
-
- 应用id
- 环境
-
-
-
-
- 根据编号获取配置项的详情
-
- 配置id
- 环境
-
-
-
-
- 添加一个配置项
-
- 配置模型
- 环境
-
-
-
-
- 编辑一个配置
-
- 编号
- 模型
- 环境
-
-
-
-
- 删除一个配置
-
- 配置id
- 环境
-
-
-
-
- restful api 返回的 app 模型
-
-
-
-
- 是否可继承
-
-
-
-
- id
-
-
-
-
- name
-
-
-
-
- 密钥
-
-
-
-
- 是否启用
-
-
-
-
- 关联的app
-
-
-
-
- 管理员
-
-
-
-
- id
-
-
-
-
- 应用
-
-
-
-
- 组
-
-
-
-
- 键
-
-
-
-
- 值
-
-
-
-
- 状态
-
-
-
-
- 在线状态
-
-
-
-
- 编辑状态
-
-
-
-
- 描述
-
-
-
-
- 节点地址
-
-
-
-
- 备注
-
-
-
-
- 状态
-
-
-
-
- 最后响应时间
-
-
-
-
- 编号
-
-
-
-
- 应用id
-
-
-
-
- 发布时间
-
-
-
-
- 发布者
-
-
-
-
- 发布版本序号
-
-
-
-
- 发布日志
-
-
-
-
- 环境
-
-
-
-
- 节点操作接口
-
-
-
-
- 获取所有节点
-
-
-
-
-
- 添加节点
-
- 节点模型
-
-
-
-
- 删除节点
-
- 节点地址
-
-
-
-
- 在启动跟禁用之间进行切换
-
- 应用标识。
-
-
-
-
- 获取所有可以继承的app
-
-
-
-
-
- 保存app的授权信息
-
- 授权视图模型。
-
-
-
-
- 是否只是修改了描述信息
-
- 新的配置。
- 旧的配置。
-
-
-
-
- 按多条件进行搜索
-
- 应用id
- 分组
- 键
- 在线状态
- 分页大小
- 当前页
-
-
-
-
- 发布所有待发布的配置项
-
-
-
-
-
- 预览上传的json文件
-
-
-
-
-
- 导出json文件
-
- 应用id
-
-
-
-
- 获取待发布的明细
-
- 应用id
-
-
-
-
- 获取发布详情的历史
-
- 应用标识。
-
-
-
-
- 获取json格式的配置
-
- 应用id
-
-
-
-
- 这个Controller用来接受控制台节点发送过来的命令
-
-
-
-
- 这个Controller是控制台网页跟后台的接口,不要跟RemoteOp那个Controller混淆
-
-
-
-
- 通知一个节点的某个客户端离线
-
- 节点地址。
- 客户端标识。
-
-
-
-
- 通知某个节点让所有的客户端刷新配置项
-
- 节点地址。
-
-
-
-
- 通知某个节点个某个客户端刷新配置项
-
- 节点地址。
- 客户端标识。
-
-
-
-
- 这个Controller用来上报节点的一些情况,比如链接了多少客户端等信息
-
-
-
-
- 获取本节点的客户端信息
-
-
-
-
-
- 获取某个节点的客户端信息
-
- 节点地址。
-
-
-
-
- 获取App数量
-
-
-
-
-
- 获取Config项目数量
-
-
-
-
-
- 获取Config项目数量
-
-
-
-
-
- 获取所有节点的状态信息
-
-
-
-
-
- 对请求进行basic认证的filter
-
-
-
-
- 对请求进行basic认证的filter
-
-
-
-
- 因为 attribute 不能传递 func 参数,所有从 action 的参数内获取 appId 的操作只能提前内置在一个静态字典内。
-
-
-
-
- 权限判断,用户信息从basic认证的头部取
-
-
-
-
- 获取用户名,优先从Claim获取,没有从Basic认证的头部取
-
- 控制器实例。
-
-
-
-
- 获取用户Id,优先从Claim获取,没有从Basic认证的头部取用户名后从数据库查Id
-
- 控制器实例。
- 用户服务。
-
-
-
-
+
+ AgileConfig.Server.Apisite
+
+
+
+
+ 是否演示模式
+
+
+
+
+ 是否控制台模式
+
+
+
+
+ is password inited ?
+
+
+
+
+
+ 初始化密码
+
+
+
+
+
+ 应用操作接口
+
+
+
+
+ 获取所有应用
+
+
+
+
+
+ 根据id获取应用
+
+ 应用id
+
+
+
+
+ 添加应用
+
+ 应用模型
+
+
+
+
+ 编辑应用
+
+ 应用id
+ 编辑后的应用模型
+
+
+
+
+ 删除应用
+
+ 应用id
+
+
+
+
+ 发布某个应用的待发布配置项
+
+ 应用id
+ 环境
+
+
+
+
+ 查询某个应用的发布历史
+
+ 应用id
+ 环境
+
+
+
+
+ 回滚某个应用的发布版本,回滚到 historyId 指定的时刻
+
+ 发布历史
+ 环境
+
+
+
+
+ 根据appid查所有发布的配置项 , 包括继承过来的配置项.
+ 注意: 这个接口用的不是用户名密码的认证,用的是appid + secret的认证
+
+ 应用id
+ 环境
+
+
+
+
+ 根据应用id查找配置,这些配置有可能是未发布的配置 。请跟 config/app/{appId} 接口加以区分。
+
+ 应用id
+ 环境
+
+
+
+
+ 根据编号获取配置项的详情
+
+ 配置id
+ 环境
+
+
+
+
+ 添加一个配置项
+
+ 配置模型
+ 环境
+
+
+
+
+ 编辑一个配置
+
+ 编号
+ 模型
+ 环境
+
+
+
+
+ 删除一个配置
+
+ 配置id
+ 环境
+
+
+
+
+ restful api 返回的 app 模型
+
+
+
+
+ 是否可继承
+
+
+
+
+ id
+
+
+
+
+ name
+
+
+
+
+ 密钥
+
+
+
+
+ 是否启用
+
+
+
+
+ 关联的app
+
+
+
+
+ 创建者
+
+
+
+
+ id
+
+
+
+
+ 应用
+
+
+
+
+ 组
+
+
+
+
+ 键
+
+
+
+
+ 值
+
+
+
+
+ 状态
+
+
+
+
+ 在线状态
+
+
+
+
+ 编辑状态
+
+
+
+
+ 描述
+
+
+
+
+ 节点地址
+
+
+
+
+ 备注
+
+
+
+
+ 状态
+
+
+
+
+ 最后响应时间
+
+
+
+
+ 编号
+
+
+
+
+ 应用id
+
+
+
+
+ 发布时间
+
+
+
+
+ 发布者
+
+
+
+
+ 发布版本序号
+
+
+
+
+ 发布日志
+
+
+
+
+ 环境
+
+
+
+
+ 节点操作接口
+
+
+
+
+ 获取所有节点
+
+
+
+
+
+ 添加节点
+
+ 节点模型
+
+
+
+
+ 删除节点
+
+ 节点地址
+
+
+
+
+ 在启动跟禁用之间进行切换
+
+ 应用标识。
+
+
+
+
+ 获取所有可以继承的app
+
+
+
+
+
+ 保存app的授权信息
+
+ 授权视图模型。
+
+
+
+
+ 是否只是修改了描述信息
+
+ 新的配置。
+ 旧的配置。
+
+
+
+
+ 按多条件进行搜索
+
+ 应用id
+ 分组
+ 键
+ 在线状态
+ 分页大小
+ 当前页
+
+
+
+
+ 发布所有待发布的配置项
+
+
+
+
+
+ 预览上传的json文件
+
+
+
+
+
+ 导出json文件
+
+ 应用id
+
+
+
+
+ 获取待发布的明细
+
+ 应用id
+
+
+
+
+ 获取发布详情的历史
+
+ 应用标识。
+
+
+
+
+ 获取json格式的配置
+
+ 应用id
+
+
+
+
+ 这个Controller用来接受控制台节点发送过来的命令
+
+
+
+
+ 这个Controller是控制台网页跟后台的接口,不要跟RemoteOp那个Controller混淆
+
+
+
+
+ 通知一个节点的某个客户端离线
+
+ 节点地址。
+ 客户端标识。
+
+
+
+
+ 通知某个节点让所有的客户端刷新配置项
+
+ 节点地址。
+
+
+
+
+ 通知某个节点个某个客户端刷新配置项
+
+ 节点地址。
+ 客户端标识。
+
+
+
+
+ 这个Controller用来上报节点的一些情况,比如链接了多少客户端等信息
+
+
+
+
+ 获取本节点的客户端信息
+
+
+
+
+
+ 获取某个节点的客户端信息
+
+ 节点地址。
+
+
+
+
+ 获取App数量
+
+
+
+
+
+ 获取Config项目数量
+
+
+
+
+
+ 获取Config项目数量
+
+
+
+
+
+ 获取所有节点的状态信息
+
+
+
+
+
+ 对请求进行basic认证的filter
+
+
+
+
+ 对请求进行basic认证的filter
+
+
+
+
+ 因为 attribute 不能传递 func 参数,所有从 action 的参数内获取 appId 的操作只能提前内置在一个静态字典内。
+
+
+
+
+ 权限判断,用户信息从basic认证的头部取
+
+
+
+
+ 获取用户名,优先从Claim获取,没有从Basic认证的头部取
+
+ 控制器实例。
+
+
+
+
+ 获取用户Id,优先从Claim获取,没有从Basic认证的头部取用户名后从数据库查Id
+
+ 控制器实例。
+ 用户服务。
+
+
+
+
\ No newline at end of file
diff --git a/src/AgileConfig.Server.Apisite/Appsettings.cs b/src/AgileConfig.Server.Apisite/Appsettings.cs
index c1e30b3b..5bda6a77 100644
--- a/src/AgileConfig.Server.Apisite/Appsettings.cs
+++ b/src/AgileConfig.Server.Apisite/Appsettings.cs
@@ -1,58 +1,60 @@
-using AgileConfig.Server.Common;
-using System;
+using System;
+using AgileConfig.Server.Common;
-namespace AgileConfig.Server.Apisite
+namespace AgileConfig.Server.Apisite;
+
+public class Appsettings
{
- public class Appsettings
- {
- ///
- /// Indicates whether the server runs in demo mode.
- ///
- public static bool IsPreviewMode => "true".Equals(Global.Config["preview_mode"], StringComparison.CurrentCultureIgnoreCase);
- ///
- /// Indicates whether the admin console mode is enabled.
- ///
- public static bool IsAdminConsoleMode => "true".Equals(Global.Config["adminConsole"], StringComparison.CurrentCultureIgnoreCase);
-
- ///
- /// Indicates whether the cluster auto-join feature is enabled.
- ///
- public static bool Cluster => "true".Equals(Global.Config["cluster"], StringComparison.CurrentCultureIgnoreCase);
-
- ///
- /// path base
- ///
- public static string PathBase => Global.Config["pathBase"];
-
- ///
- /// Indicates whether single sign-on is enabled.
- ///
- public static bool SsoEnabled => "true".Equals(Global.Config["SSO:enabled"], StringComparison.CurrentCultureIgnoreCase);
-
- ///
- /// SSO button text
- ///
- public static string SsoButtonText => Global.Config["SSO:loginButtonText"];
-
- public static string OtlpLogsEndpoint => Global.Config["otlp:logs:endpoint"];
-
- public static string OtlpLogsHeaders => Global.Config["otlp:logs:headers"];
-
- public static string OtlpLogsProtocol => Global.Config["otlp:logs:protocol"];
-
- public static string OtlpTracesEndpoint => Global.Config["otlp:traces:endpoint"];
-
- public static string OtlpTracesProtocol => Global.Config["otlp:traces:protocol"];
-
- public static string OtlpTracesHeaders => Global.Config["otlp:traces:headers"];
-
- public static string OtlpMetricsEndpoint => Global.Config["otlp:metrics:endpoint"];
-
- public static string OtlpMetricsProtocol => Global.Config["otlp:metrics:protocol"];
-
- public static string OtlpMetricsHeaders => Global.Config["otlp:metrics:headers"];
-
- public static string OtlpInstanceId => Global.Config["otlp:instanceId"];
-
- }
-}
+ ///
+ /// Indicates whether the server runs in demo mode.
+ ///
+ public static bool IsPreviewMode =>
+ "true".Equals(Global.Config["preview_mode"], StringComparison.CurrentCultureIgnoreCase);
+
+ ///
+ /// Indicates whether the admin console mode is enabled.
+ ///
+ public static bool IsAdminConsoleMode =>
+ "true".Equals(Global.Config["adminConsole"], StringComparison.CurrentCultureIgnoreCase);
+
+ ///
+ /// Indicates whether the cluster auto-join feature is enabled.
+ ///
+ public static bool Cluster => "true".Equals(Global.Config["cluster"], StringComparison.CurrentCultureIgnoreCase);
+
+ ///
+ /// path base
+ ///
+ public static string PathBase => Global.Config["pathBase"];
+
+ ///
+ /// Indicates whether single sign-on is enabled.
+ ///
+ public static bool SsoEnabled =>
+ "true".Equals(Global.Config["SSO:enabled"], StringComparison.CurrentCultureIgnoreCase);
+
+ ///
+ /// SSO button text
+ ///
+ public static string SsoButtonText => Global.Config["SSO:loginButtonText"];
+
+ public static string OtlpLogsEndpoint => Global.Config["otlp:logs:endpoint"];
+
+ public static string OtlpLogsHeaders => Global.Config["otlp:logs:headers"];
+
+ public static string OtlpLogsProtocol => Global.Config["otlp:logs:protocol"];
+
+ public static string OtlpTracesEndpoint => Global.Config["otlp:traces:endpoint"];
+
+ public static string OtlpTracesProtocol => Global.Config["otlp:traces:protocol"];
+
+ public static string OtlpTracesHeaders => Global.Config["otlp:traces:headers"];
+
+ public static string OtlpMetricsEndpoint => Global.Config["otlp:metrics:endpoint"];
+
+ public static string OtlpMetricsProtocol => Global.Config["otlp:metrics:protocol"];
+
+ public static string OtlpMetricsHeaders => Global.Config["otlp:metrics:headers"];
+
+ public static string OtlpInstanceId => Global.Config["otlp:instanceId"];
+}
\ No newline at end of file
diff --git a/src/AgileConfig.Server.Apisite/ConfigureJwtBearerOptions.cs b/src/AgileConfig.Server.Apisite/ConfigureJwtBearerOptions.cs
index 4676b6ec..5879d0a4 100644
--- a/src/AgileConfig.Server.Apisite/ConfigureJwtBearerOptions.cs
+++ b/src/AgileConfig.Server.Apisite/ConfigureJwtBearerOptions.cs
@@ -15,7 +15,7 @@ public void Configure(JwtBearerOptions options)
{
ValidIssuer = jwtService.Issuer,
ValidAudience = jwtService.Audience,
- IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtService.GetSecurityKey())),
+ IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtService.GetSecurityKey()))
};
}
diff --git a/src/AgileConfig.Server.Apisite/Controllers/AdminController.cs b/src/AgileConfig.Server.Apisite/Controllers/AdminController.cs
index 9fab1f10..20c0cf70 100644
--- a/src/AgileConfig.Server.Apisite/Controllers/AdminController.cs
+++ b/src/AgileConfig.Server.Apisite/Controllers/AdminController.cs
@@ -1,352 +1,317 @@
-using System;
+using System;
+using System.Collections.Generic;
+using System.Linq;
using System.Threading.Tasks;
using AgileConfig.Server.Apisite.Models;
+using AgileConfig.Server.Apisite.Utilites;
using AgileConfig.Server.Common;
+using AgileConfig.Server.Common.EventBus;
using AgileConfig.Server.Common.Resources;
using AgileConfig.Server.Data.Entity;
+using AgileConfig.Server.Event;
using AgileConfig.Server.IService;
+using AgileConfig.Server.OIDC;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
-using System.Linq;
-using AgileConfig.Server.Apisite.Utilites;
-using AgileConfig.Server.OIDC;
-using System.Collections.Generic;
-using AgileConfig.Server.Event;
-using AgileConfig.Server.Common.EventBus;
-namespace AgileConfig.Server.Apisite.Controllers
+namespace AgileConfig.Server.Apisite.Controllers;
+
+public class AdminController : Controller
{
- public class AdminController : Controller
+ private readonly IJwtService _jwtService;
+ private readonly IOidcClient _oidcClient;
+ private readonly IPermissionService _permissionService;
+ private readonly ISettingService _settingService;
+ private readonly ISystemInitializationService _systemInitializationService;
+ private readonly ITinyEventBus _tinyEventBus;
+ private readonly IUserService _userService;
+
+ public AdminController(
+ ISettingService settingService,
+ IUserService userService,
+ IPermissionService permissionService,
+ IJwtService jwtService,
+ IOidcClient oidcClient,
+ ITinyEventBus tinyEventBus,
+ ISystemInitializationService systemInitializationService
+ )
{
- private readonly ISettingService _settingService;
- private readonly IUserService _userService;
- private readonly IPermissionService _permissionService;
- private readonly IJwtService _jwtService;
- private readonly IOidcClient _oidcClient;
- private readonly ITinyEventBus _tinyEventBus;
- private readonly ISystemInitializationService _systemInitializationService;
-
- public AdminController(
- ISettingService settingService,
- IUserService userService,
- IPermissionService permissionService,
- IJwtService jwtService,
- IOidcClient oidcClient,
- ITinyEventBus tinyEventBus,
- ISystemInitializationService systemInitializationService
- )
- {
- _settingService = settingService;
- _userService = userService;
- _permissionService = permissionService;
- _jwtService = jwtService;
- _oidcClient = oidcClient;
- _tinyEventBus = tinyEventBus;
- _systemInitializationService = systemInitializationService;
- }
-
+ _settingService = settingService;
+ _userService = userService;
+ _permissionService = permissionService;
+ _jwtService = jwtService;
+ _oidcClient = oidcClient;
+ _tinyEventBus = tinyEventBus;
+ _systemInitializationService = systemInitializationService;
+ }
- [HttpPost("admin/jwt/login")]
- public async Task Login4AntdPro([FromBody] LoginVM model)
- {
- string userName = model.userName;
- string password = model.password;
- if (string.IsNullOrEmpty(password))
- {
- return Json(new
- {
- status = "error",
- message = Messages.PasswordCannotBeEmpty
- });
- }
-
- var result = await _userService.ValidateUserPassword(userName, model.password);
- if (result)
- {
- var response = await LoginSuccessful(userName);
- return Json(response);
- }
+ [HttpPost("admin/jwt/login")]
+ public async Task Login4AntdPro([FromBody] LoginVM model)
+ {
+ var userName = model.userName;
+ var password = model.password;
+ if (string.IsNullOrEmpty(password))
return Json(new
{
status = "error",
- message = Messages.PasswordError
+ message = Messages.PasswordCannotBeEmpty
});
+
+ var result = await _userService.ValidateUserPassword(userName, model.password);
+ if (result)
+ {
+ var response = await LoginSuccessful(userName);
+ return Json(response);
}
- private async Task