This commit is contained in:
uubulb 2024-12-26 22:49:38 +08:00
parent 41d68e5051
commit 747ef5656c

View File

@ -38,7 +38,7 @@ func (a *authHandler) Check(ctx context.Context) (uint64, error) {
singleton.UserLock.RLock() singleton.UserLock.RLock()
userId, ok := singleton.AgentSecretToUserId[clientSecret] userId, ok := singleton.AgentSecretToUserId[clientSecret]
if !ok && clientSecret != singleton.Conf.AgentSecretKey { if !ok {
singleton.UserLock.RUnlock() singleton.UserLock.RUnlock()
model.BlockIP(singleton.DB, ip, model.WAFBlockReasonTypeAgentAuthFail, model.BlockIDgRPC) model.BlockIP(singleton.DB, ip, model.WAFBlockReasonTypeAgentAuthFail, model.BlockIDgRPC)
return 0, status.Error(codes.Unauthenticated, "客户端认证失败") return 0, status.Error(codes.Unauthenticated, "客户端认证失败")