Skip to content

Commit

Permalink
feat: modify rbac not process statu code and add support health query…
Browse files Browse the repository at this point in the history
… for hook client.
  • Loading branch information
lovestaryouth committed Mar 5, 2025
1 parent 5ab918d commit 7027a8b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
13 changes: 12 additions & 1 deletion FEATURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,15 @@ query($username: String!) {

## 问题修复:

1. 前端Graphql页面特殊参数输入框导致白屏问题
1. 前端Graphql页面特殊参数输入框导致白屏问题

# 版本v2.2.10

## 新增功能:

1. 钩子健康探测添加enable-hook-report参数,用于钩子在开发环境中跳过首次探测时初始化访问9991端口

## 重大变更:

1. RBAC权限判断不通过时状态码返回403,而不是401,并提示Permission not enough
2. Token失效和无效现在会在401状态码基础上增加错误提示
4 changes: 3 additions & 1 deletion pkg/websocket/hook_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ func (r *hookReportInfo) report(isFirstReport bool) {
var report healthReport
buf := pool.GetBytesBuffer()
defer pool.PutBytesBuffer(buf)
enableHookReport := utils.GetBoolWithLockViper(consts.EnableHookReport)
r.client.ResetServerUrl(models.GetHookServerUrl())
r.client.ResetHealthQuery(map[string]interface{}{consts.EnableHookReport: enableHookReport})
// 调用钩子的健康检查接口
if r.client.DoHealthCheckRequest(r.ctx, buf) {
var health Health
Expand All @@ -155,7 +157,7 @@ func (r *hookReportInfo) report(isFirstReport bool) {
if reportChanged || isFirstReport {
r.Time = report.Time
}
if utils.GetBoolWithLockViper(consts.EnableHookReport) {
if enableHookReport {
// 仅有dev模式会触发热重启
var affectCount int
affectCount += migrateCustomizes(report.Customizes)
Expand Down

0 comments on commit 7027a8b

Please sign in to comment.