From 10d87180876b6581c965e2f7642e8465ed797050 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Sun, 25 Sep 2022 16:35:01 +0800 Subject: [PATCH 1/8] docs:add error code desc --- release/conf/i18n/en.toml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/release/conf/i18n/en.toml b/release/conf/i18n/en.toml index 5236d4dcc..b0fa36774 100644 --- a/release/conf/i18n/en.toml +++ b/release/conf/i18n/en.toml @@ -156,11 +156,19 @@ 401002 = "auth token empty" #EmptyAutToken 401003 = "token already disabled" #TokenDisabled 401004 = "token not existed" #TokenNotExisted +<<<<<<< HEAD 403001 = "token verify exception" #AuthTokenVerifyException 403002 = "operation role exception" #OperationRoleException 404001 = "not found the host cmdb" #CMDBNotFindHost 409000 = "data is conflict, please try again" #DataConflict 429001 = "instance has too many requests" #InstanceTooManyRequests +======= +403001 = "server limit the ip access" #IPRateLimit +403002 = "server limit the api access" #APIRateLimit +404001 = "not found the host cmdb" #CMDBNotFindHost +409000 = "data is conflict, please try again" #DataConflict +429001 = "your instance has too many requests" #InstanceTooManyRequests +>>>>>>> c07080f0... docs:add error code desc 500000 = "execute exception" #ExecuteException 500001 = "store layer exception" #StoreLayerException 500002 = "cmdb plugin exception" #CMDBPluginException @@ -169,3 +177,8 @@ 500006 = "parse circuit breaker failed" #ParseCircuitBreakerException 500007 = "heartbeat execute exception" #HeartbeatException 500008 = "instance async regist timeout" #InstanceRegisTimeout +<<<<<<< HEAD +======= +500100 = "token verify exception" #AuthTokenVerifyException +500101 = "operation role exception" #OperationRoleException +>>>>>>> c07080f0... docs:add error code desc From 6e32acd74cea98989d6c181d72579bd8aecbb6d8 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Wed, 19 Oct 2022 16:00:33 +0800 Subject: [PATCH 2/8] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4license-checker?= =?UTF-8?q?=E7=9A=84=E8=A7=A6=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/golangci-lint.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 394cb4df3..4fa69ac1e 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -15,10 +15,6 @@ name: golangci-lint on: - push: - branches: - - main - - release* pull_request: branches: - main From 183617420ece8d1625a7f3ce373644f60e71e152 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Wed, 19 Oct 2022 17:08:41 +0800 Subject: [PATCH 3/8] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4license-checker?= =?UTF-8?q?=E7=9A=84=E8=A7=A6=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/golangci-lint.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 4fa69ac1e..394cb4df3 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -15,6 +15,10 @@ name: golangci-lint on: + push: + branches: + - main + - release* pull_request: branches: - main From 0a73518079fb6965577c63a1f106e61758349d34 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Tue, 27 Jun 2023 11:58:15 +0800 Subject: [PATCH 4/8] =?UTF-8?q?hotfix:=E4=BF=AE=E5=A4=8D=E9=89=B4=E6=9D=83?= =?UTF-8?q?interceptor=E9=81=97=E6=BC=8F=E8=AF=B7=E6=B1=82=E6=9D=A5?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- release/conf/i18n/en.toml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/release/conf/i18n/en.toml b/release/conf/i18n/en.toml index b0fa36774..5236d4dcc 100644 --- a/release/conf/i18n/en.toml +++ b/release/conf/i18n/en.toml @@ -156,19 +156,11 @@ 401002 = "auth token empty" #EmptyAutToken 401003 = "token already disabled" #TokenDisabled 401004 = "token not existed" #TokenNotExisted -<<<<<<< HEAD 403001 = "token verify exception" #AuthTokenVerifyException 403002 = "operation role exception" #OperationRoleException 404001 = "not found the host cmdb" #CMDBNotFindHost 409000 = "data is conflict, please try again" #DataConflict 429001 = "instance has too many requests" #InstanceTooManyRequests -======= -403001 = "server limit the ip access" #IPRateLimit -403002 = "server limit the api access" #APIRateLimit -404001 = "not found the host cmdb" #CMDBNotFindHost -409000 = "data is conflict, please try again" #DataConflict -429001 = "your instance has too many requests" #InstanceTooManyRequests ->>>>>>> c07080f0... docs:add error code desc 500000 = "execute exception" #ExecuteException 500001 = "store layer exception" #StoreLayerException 500002 = "cmdb plugin exception" #CMDBPluginException @@ -177,8 +169,3 @@ 500006 = "parse circuit breaker failed" #ParseCircuitBreakerException 500007 = "heartbeat execute exception" #HeartbeatException 500008 = "instance async regist timeout" #InstanceRegisTimeout -<<<<<<< HEAD -======= -500100 = "token verify exception" #AuthTokenVerifyException -500101 = "operation role exception" #OperationRoleException ->>>>>>> c07080f0... docs:add error code desc From 21a15e77cf652bfb65761719c6ec599721779962 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Thu, 11 Jan 2024 11:54:51 +0800 Subject: [PATCH 5/8] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dnacos=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E5=85=BC=E5=AE=B9=E4=B8=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apiserver/nacosserver/model/constant.go | 6 ++++- .../nacosserver/v1/config/config_file.go | 8 ++++++- apiserver/nacosserver/v1/discover/instance.go | 24 +++++++++++++++++++ apiserver/nacosserver/v2/access.go | 17 +++---------- .../nacosserver/v2/config/config_file.go | 24 ++++++++++++++++--- apiserver/nacosserver/v2/config/watch.go | 23 ++++++++++++++++++ cache/api/types.go | 2 +- cache/config/config_file.go | 4 ---- common/metrics/types.go | 8 +++++-- config/config_file.go | 2 +- config/config_file_release.go | 24 +++++++++++++++++++ config/server.go | 12 +++++----- config/server_test.go | 1 - config/watcher.go | 13 +++++----- go.mod | 14 ++++++----- go.sum | 15 ++++++++++++ plugin/statis/logger/statis.go | 10 ++++---- release/standalone/port.properties | 1 - 18 files changed, 157 insertions(+), 51 deletions(-) diff --git a/apiserver/nacosserver/model/constant.go b/apiserver/nacosserver/model/constant.go index 2a239da58..ded1a0870 100644 --- a/apiserver/nacosserver/model/constant.go +++ b/apiserver/nacosserver/model/constant.go @@ -145,5 +145,9 @@ func ToNacosConfigNamespace(ns string) string { } const ( - ActionGetConfigFile = "NACOS_GET_CONFIG" + ActionGetConfigFile = "NACOS_GET_CONFIG" + ActionPublishConfigFile = "NACOS_PUBLISH_CONFIG" + ActionGrpcGetConfigFile = "NACOS_GRPC_GET_CONFIG" + ActionGrpcPublishConfigFile = "NACOS_GRPC_PUBLISH_CONFIG" + ActionGrpcPushConfigFile = "NACOS_GRPC_PUSH_CONFIG" ) diff --git a/apiserver/nacosserver/v1/config/config_file.go b/apiserver/nacosserver/v1/config/config_file.go index ff5f8c072..c263d51b0 100644 --- a/apiserver/nacosserver/v1/config/config_file.go +++ b/apiserver/nacosserver/v1/config/config_file.go @@ -40,7 +40,13 @@ import ( ) func (n *ConfigServer) handlePublishConfig(ctx context.Context, req *model.ConfigFile) (bool, error) { - resp := n.configSvr.UpsertAndReleaseConfigFileFromClient(ctx, req.ToSpecConfigFile()) + var resp *config_manage.ConfigResponse + if req.CasMd5 != "" { + resp = n.configSvr.CasUpsertAndReleaseConfigFileFromClient(ctx, req.ToSpecConfigFile()) + } else { + resp = n.configSvr.UpsertAndReleaseConfigFileFromClient(ctx, req.ToSpecConfigFile()) + } + if resp.GetCode().GetValue() == uint32(apimodel.Code_ExecuteSuccess) { return true, nil } diff --git a/apiserver/nacosserver/v1/discover/instance.go b/apiserver/nacosserver/v1/discover/instance.go index f51cf5179..90c67ae31 100644 --- a/apiserver/nacosserver/v1/discover/instance.go +++ b/apiserver/nacosserver/v1/discover/instance.go @@ -25,9 +25,11 @@ import ( apimodel "github.com/polarismesh/specification/source/go/api/v1/model" apiservice "github.com/polarismesh/specification/source/go/api/v1/service_manage" + "google.golang.org/protobuf/types/known/wrapperspb" "github.com/polarismesh/polaris/apiserver/nacosserver/core" "github.com/polarismesh/polaris/apiserver/nacosserver/model" + commonmodel "github.com/polarismesh/polaris/common/model" "github.com/polarismesh/polaris/common/utils" ) @@ -45,6 +47,24 @@ func (n *DiscoverServer) handleRegister(ctx context.Context, namespace, serviceN func (n *DiscoverServer) handleUpdate(ctx context.Context, namespace, serviceName string, ins *model.Instance) error { specIns := model.PrepareSpecInstance(namespace, serviceName, ins) + if specIns.Id == nil || specIns.GetId().GetValue() == "" { + insId, errRsp := utils.CheckInstanceTetrad(specIns) + if errRsp != nil { + return &model.NacosError{ + ErrCode: int32(model.ExceptionCode_ServerError), + ErrMsg: errRsp.GetInfo().GetValue(), + } + } + specIns.Id = wrapperspb.String(insId) + } + saveIns, err := n.discoverSvr.Cache().GetStore().GetInstance(specIns.GetId().GetValue()) + if err != nil { + return &model.NacosError{ + ErrCode: int32(model.ExceptionCode_ServerError), + ErrMsg: err.Error(), + } + } + specIns = mergeUpdateInstanceInfo(specIns, saveIns) resp := n.discoverSvr.UpdateInstance(ctx, specIns) if apimodel.Code(resp.GetCode().GetValue()) != apimodel.Code_ExecuteSuccess { return &model.NacosError{ @@ -148,3 +168,7 @@ func (n *DiscoverServer) handleQueryInstances(ctx context.Context, params map[st result.Namespace = model.ToNacosNamespace(namespace) return result, nil } + +func mergeUpdateInstanceInfo(req *apiservice.Instance, saveVal *commonmodel.Instance) *apiservice.Instance { + return req +} diff --git a/apiserver/nacosserver/v2/access.go b/apiserver/nacosserver/v2/access.go index 40d82d45b..f4861e88a 100644 --- a/apiserver/nacosserver/v2/access.go +++ b/apiserver/nacosserver/v2/access.go @@ -54,6 +54,7 @@ var ( ) func (h *NacosV2Server) Request(ctx context.Context, payload *nacospb.Payload) (*nacospb.Payload, error) { + ctx = h.ConvertContext(ctx) h.connectionManager.RefreshClient(ctx) ctx = injectPayloadHeader(ctx, payload) handle, val, err := h.UnmarshalPayload(payload) @@ -64,20 +65,8 @@ func (h *NacosV2Server) Request(ctx context.Context, payload *nacospb.Payload) ( if !ok { return nil, ErrorInvalidRequestBodyType } - - if _, ok := debugLevel[msg.GetRequestType()]; !ok { - nacoslog.Info("[NACOS-V2] handler client request", zap.String("conn-id", remote.ValueConnID(ctx)), - utils.ZapRequestID(msg.GetRequestId()), - zap.String("type", msg.GetRequestType()), - ) - } else { - if nacoslog.DebugEnabled() { - nacoslog.Debug("[NACOS-V2] handler client request", zap.String("conn-id", remote.ValueConnID(ctx)), - utils.ZapRequestID(msg.GetRequestId()), - zap.String("type", msg.GetRequestType()), - ) - } - } + nacoslog.Debug("[NACOS-V2] handler client request", zap.String("conn-id", remote.ValueConnID(ctx)), + utils.ZapRequestID(msg.GetRequestId()), zap.String("type", msg.GetRequestType())) connMeta := remote.ValueConnMeta(ctx) startTime := time.Now() diff --git a/apiserver/nacosserver/v2/config/config_file.go b/apiserver/nacosserver/v2/config/config_file.go index 22cf4662a..d1e54305a 100644 --- a/apiserver/nacosserver/v2/config/config_file.go +++ b/apiserver/nacosserver/v2/config/config_file.go @@ -48,7 +48,25 @@ func (h *ConfigServer) handlePublishConfigRequest(ctx context.Context, req nacos return nil, remote.ErrorInvalidRequestBodyType } - resp := h.configSvr.CasUpsertAndReleaseConfigFileFromClient(ctx, configReq.ToSpec()) + var resp *config_manage.ConfigResponse + startTime := commontime.CurrentMillisecond() + defer func() { + plugin.GetStatis().ReportDiscoverCall(metrics.ClientDiscoverMetric{ + Action: nacosmodel.ActionGrpcPublishConfigFile, + ClientIP: meta.ConnectionID, + Namespace: configReq.Tenant, + Resource: metrics.ResourceOfConfigFile(configReq.Group, configReq.DataId), + Timestamp: startTime, + CostTime: commontime.CurrentMillisecond() - startTime, + Success: resp.GetCode().GetValue() == uint32(apimodel.Code_ExecuteSuccess), + }) + }() + + if configReq.CasMd5 != "" { + resp = h.configSvr.CasUpsertAndReleaseConfigFileFromClient(ctx, configReq.ToSpec()) + } else { + resp = h.configSvr.UpsertAndReleaseConfigFileFromClient(ctx, configReq.ToSpec()) + } if resp.GetCode().GetValue() != uint32(apimodel.Code_ExecuteSuccess) { nacoslog.Error("[NACOS-V2][Config] publish config file fail", zap.String("tenant", configReq.Tenant), utils.ZapGroup(configReq.Group), utils.ZapFileName(configReq.DataId), @@ -83,8 +101,8 @@ func (h *ConfigServer) handleGetConfigRequest(ctx context.Context, req nacospb.B startTime := commontime.CurrentMillisecond() defer func() { plugin.GetStatis().ReportDiscoverCall(metrics.ClientDiscoverMetric{ - Action: nacosmodel.ActionGetConfigFile, - ClientIP: utils.ParseClientAddress(ctx), + Action: nacosmodel.ActionGrpcGetConfigFile, + ClientIP: meta.ConnectionID, Namespace: configReq.Tenant, Resource: metrics.ResourceOfConfigFile(configReq.Group, configReq.DataId), Timestamp: startTime, diff --git a/apiserver/nacosserver/v2/config/watch.go b/apiserver/nacosserver/v2/config/watch.go index 21faab30d..646bf03c1 100644 --- a/apiserver/nacosserver/v2/config/watch.go +++ b/apiserver/nacosserver/v2/config/watch.go @@ -28,9 +28,12 @@ import ( nacospb "github.com/polarismesh/polaris/apiserver/nacosserver/v2/pb" "github.com/polarismesh/polaris/apiserver/nacosserver/v2/remote" "github.com/polarismesh/polaris/common/eventhub" + "github.com/polarismesh/polaris/common/metrics" "github.com/polarismesh/polaris/common/model" + commontime "github.com/polarismesh/polaris/common/time" "github.com/polarismesh/polaris/common/utils" "github.com/polarismesh/polaris/config" + "github.com/polarismesh/polaris/plugin" ) type ConnectionClientManager struct { @@ -99,6 +102,9 @@ func (c *StreamWatchContext) ClientID() string { // ShouldNotify . func (c *StreamWatchContext) ShouldNotify(event *model.SimpleConfigFileRelease) bool { + if event.ReleaseType == model.ReleaseTypeGray && !c.betaMatcher(c.ClientLabels(), event) { + return false + } key := event.FileKey() watchFile, ok := c.watchConfigFiles.Load(key) if !ok { @@ -108,6 +114,7 @@ func (c *StreamWatchContext) ShouldNotify(event *model.SimpleConfigFileRelease) if !event.Valid { return true } + nacoslog.Info("should notify", zap.String("client", c.ClientID()), zap.String("save-md5", watchFile.GetMd5().GetValue()), zap.String("recv-md5", event.Md5)) isChange := watchFile.GetMd5().GetValue() != event.Md5 return isChange } @@ -142,6 +149,21 @@ func (c *StreamWatchContext) Reply(event *apiconfig.ConfigClientResponse) { notifyRequest.Group = viewConfig.GetGroup().GetValue() notifyRequest.DataId = viewConfig.GetFileName().GetValue() + success := false + startTime := commontime.CurrentMillisecond() + defer func() { + plugin.GetStatis().ReportDiscoverCall(metrics.ClientDiscoverMetric{ + Action: nacosmodel.ActionGrpcPushConfigFile, + ClientIP: c.ClientID(), + Namespace: notifyRequest.Tenant, + Resource: metrics.ResourceOfConfigFile(notifyRequest.Group, notifyRequest.DataId), + Timestamp: startTime, + CostTime: commontime.CurrentMillisecond() - startTime, + Revision: viewConfig.GetMd5().GetValue(), + Success: success, + }) + }() + remoteClient, ok := c.connMgr.GetClient(c.clientId) if !ok { nacoslog.Error("[NACOS-V2][Config][Push] send ConfigChangeNotifyRequest not found remoteClient", @@ -164,4 +186,5 @@ func (c *StreamWatchContext) Reply(event *apiconfig.ConfigClientResponse) { nacoslog.Error("[NACOS-V2][Config][Push] send ConfigChangeNotifyRequest fail", zap.String("clientId", c.ClientID()), zap.Error(err)) } + success = true } diff --git a/cache/api/types.go b/cache/api/types.go index 7e2360707..188ecacd8 100644 --- a/cache/api/types.go +++ b/cache/api/types.go @@ -382,7 +382,7 @@ type ( // RateLimitCache rateLimit的cache接口 RateLimitCache interface { Cache - // GetRateLimit 根据serviceID进行迭代回调 + // IteratorRateLimit 遍历所有的限流规则 IteratorRateLimit(rateLimitIterProc RateLimitIterProc) // GetRateLimitRules 根据serviceID获取限流数据 GetRateLimitRules(serviceKey model.ServiceKey) ([]*model.RateLimit, string) diff --git a/cache/config/config_file.go b/cache/config/config_file.go index 5fd1034e4..2aa20f128 100644 --- a/cache/config/config_file.go +++ b/cache/config/config_file.go @@ -181,10 +181,6 @@ func (fc *fileCache) setReleases(releases []*model.ConfigFileRelease) (map[strin } if item.Active { - configLog.Info("[Config][Release][Cache] notify config release change", - zap.String("namespace", item.Namespace), zap.String("group", item.Group), zap.String("release", item.Name), - zap.String("file", item.FileName), zap.Uint64("version", item.Version), zap.Bool("valid", item.Valid), - zap.String("type", string(item.ReleaseType))) fc.sendEvent(item) } } diff --git a/common/metrics/types.go b/common/metrics/types.go index 17a6d929e..4bcec5787 100644 --- a/common/metrics/types.go +++ b/common/metrics/types.go @@ -141,8 +141,12 @@ type ClientDiscoverMetric struct { } func (c ClientDiscoverMetric) String() string { - return fmt.Sprintf("%s|%s|%s|%s|%s|%s|%d|%+v", c.ClientIP, c.Action, c.Namespace, c.Resource, - c.Revision, time.Unix(c.Timestamp, 0).Format("2006-01-02 15:04:05"), c.CostTime, c.Success) + revision := c.Revision + if revision == "" { + revision = "-" + } + return fmt.Sprintf("%s|%s|%s|%s|%s|%s|%dms|%+v", c.ClientIP, c.Action, c.Namespace, c.Resource, + revision, time.Unix(c.Timestamp/1000, 0).Format(time.DateTime), c.CostTime, c.Success) } type ConfigMetricType string diff --git a/config/config_file.go b/config/config_file.go index f2f69768e..873f8c142 100644 --- a/config/config_file.go +++ b/config/config_file.go @@ -58,6 +58,7 @@ func (s *Server) CreateConfigFile(ctx context.Context, req *apiconfig.ConfigFile log.Error("[Config][File] create config file commit tx.", utils.RequestID(ctx), zap.Error(err)) return api.NewConfigResponse(commonstore.StoreCode2APICode(err)) } + s.RecordHistory(ctx, configFileRecordEntry(ctx, req, model.OCreate)) resp.ConfigFile = req return resp } @@ -88,7 +89,6 @@ func (s *Server) handleCreateConfigFile(ctx context.Context, tx store.Tx, utils.ZapFileName(req.GetName().GetValue()), zap.Error(err)) return api.NewConfigResponse(commonstore.StoreCode2APICode(err)) } - s.RecordHistory(ctx, configFileRecordEntry(ctx, req, model.OCreate)) return api.NewConfigResponse(apimodel.Code_ExecuteSuccess) } diff --git a/config/config_file_release.go b/config/config_file_release.go index 3a9361110..d2d07a5ff 100644 --- a/config/config_file_release.go +++ b/config/config_file_release.go @@ -136,6 +136,7 @@ func (s *Server) handlePublishConfigFile(ctx context.Context, tx store.Tx, req.Name = utils.NewStringValue(fmt.Sprintf("%s-%d-%d", fileName, time.Now().Unix(), s.nextSequence())) } + fileRelease.Name = req.GetName().GetValue() fileRelease.Format = toPublishFile.Format fileRelease.Metadata = toPublishFile.Metadata fileRelease.Comment = req.GetComment().GetValue() @@ -591,17 +592,25 @@ func (s *Server) CasUpsertAndReleaseConfigFile(ctx context.Context, return api.NewConfigResponse(commonstore.StoreCode2APICode(err)) } + historyRecords := []func(){} + var upsertResp *apiconfig.ConfigResponse if saveFile == nil { if req.GetMd5().GetValue() != "" { return api.NewConfigResponse(apimodel.Code_DataConflict) } upsertResp = s.handleCreateConfigFile(ctx, tx, upsertFileReq) + historyRecords = append(historyRecords, func() { + s.RecordHistory(ctx, configFileRecordEntry(ctx, upsertFileReq, model.OCreate)) + }) } else { if req.GetMd5().GetValue() != CalMd5(saveFile.Content) { return api.NewConfigResponse(apimodel.Code_DataConflict) } upsertResp = s.handleUpdateConfigFile(ctx, tx, upsertFileReq) + historyRecords = append(historyRecords, func() { + s.RecordHistory(ctx, configFileRecordEntry(ctx, upsertFileReq, model.OUpdate)) + }) } if upsertResp.GetCode().GetValue() != uint32(apimodel.Code_ExecuteSuccess) { return upsertResp @@ -625,6 +634,9 @@ func (s *Server) CasUpsertAndReleaseConfigFile(ctx context.Context, log.Error("[Config][File] upsert config file when commit tx.", utils.RequestID(ctx), zap.Error(err)) return api.NewConfigResponse(commonstore.StoreCode2APICode(err)) } + for i := range historyRecords { + historyRecords[i]() + } s.recordReleaseHistory(ctx, data, utils.ReleaseTypeNormal, utils.ReleaseStatusSuccess, "") return releaseResp } @@ -667,9 +679,18 @@ func (s *Server) UpsertAndReleaseConfigFile(ctx context.Context, defer func() { _ = tx.Rollback() }() + + historyRecords := []func(){} upsertResp := s.handleCreateConfigFile(ctx, tx, upsertFileReq) if upsertResp.GetCode().GetValue() == uint32(apimodel.Code_ExistedResource) { upsertResp = s.handleUpdateConfigFile(ctx, tx, upsertFileReq) + historyRecords = append(historyRecords, func() { + s.RecordHistory(ctx, configFileRecordEntry(ctx, upsertFileReq, model.OUpdate)) + }) + } else { + historyRecords = append(historyRecords, func() { + s.RecordHistory(ctx, configFileRecordEntry(ctx, upsertFileReq, model.OCreate)) + }) } if upsertResp.GetCode().GetValue() != uint32(apimodel.Code_ExecuteSuccess) { return upsertResp @@ -693,6 +714,9 @@ func (s *Server) UpsertAndReleaseConfigFile(ctx context.Context, log.Error("[Config][File] upsert config file when commit tx.", utils.RequestID(ctx), zap.Error(err)) return api.NewConfigResponse(commonstore.StoreCode2APICode(err)) } + for i := range historyRecords { + historyRecords[i]() + } s.recordReleaseHistory(ctx, data, utils.ReleaseTypeNormal, utils.ReleaseStatusSuccess, "") return releaseResp } diff --git a/config/server.go b/config/server.go index 9e9413e94..c97b59fc0 100644 --- a/config/server.go +++ b/config/server.go @@ -103,18 +103,18 @@ func Initialize(ctx context.Context, config Config, s store.Store, cacheMgr cach func doInitialize(ctx context.Context, config Config, s store.Store, cacheMgr cachetypes.CacheManager, namespaceOperator namespace.NamespaceOperateServer) (ConfigCenterServer, *Server, error) { + var proxySvr ConfigCenterServer + originSvr := &Server{} + if !config.Open { - originServer.initialized = true + originSvr.initialized = true return nil, nil, nil } - var proxySvr ConfigCenterServer - originSvr := &Server{} - if err := cacheMgr.OpenResourceCache(configCacheEntries...); err != nil { return nil, nil, err } - err := originServer.initialize(ctx, config, s, namespaceOperator, cacheMgr) + err := originSvr.initialize(ctx, config, s, namespaceOperator, cacheMgr) if err != nil { return nil, nil, err } @@ -127,7 +127,7 @@ func doInitialize(ctx context.Context, config Config, s store.Store, cacheMgr ca return nil, nil, fmt.Errorf("name(%s) not exist in serverProxyFactories", order[i]) } - tmpSvr, err := factory(originServer, server) + tmpSvr, err := factory(originSvr, server) if err != nil { return nil, nil, err } diff --git a/config/server_test.go b/config/server_test.go index 66d3a06e2..20409aff6 100644 --- a/config/server_test.go +++ b/config/server_test.go @@ -30,7 +30,6 @@ import ( ) func Test_Initialize(t *testing.T) { - t.SkipNow() eventhub.InitEventHub() ctrl := gomock.NewController(t) mockStore := mockstore.NewMockStore(ctrl) diff --git a/config/watcher.go b/config/watcher.go index c7f096a2d..1af7ff556 100644 --- a/config/watcher.go +++ b/config/watcher.go @@ -330,24 +330,21 @@ func (wc *watchCenter) notifyToWatchers(publishConfigFile *model.SimpleConfigFil if !ok { return } - - log.Info("[Config][Watcher] received config file publish message.", zap.String("file", watchFileId), - zap.Int("clients", clientIds.Len())) - changeNotifyRequest := publishConfigFile.ToSpecNotifyClientRequest() response := api.NewConfigClientResponse(apimodel.Code_ExecuteSuccess, changeNotifyRequest) + notifyCnt := 0 clientIds.Range(func(clientId string) { watchCtx, ok := wc.clients.Load(clientId) if !ok { - log.Info("[Config][Watcher] not found client when do notify.", zap.String("clientId", clientId), + log.Warn("[Config][Watcher] not found client when do notify.", zap.String("clientId", clientId), zap.String("file", watchFileId)) - clientIds.Remove(clientId) return } if watchCtx.ShouldNotify(publishConfigFile) { watchCtx.Reply(response) + notifyCnt++ } // 只能用一次,通知完就要立马清理掉这个 WatchContext if watchCtx.IsOnce() { @@ -355,6 +352,10 @@ func (wc *watchCenter) notifyToWatchers(publishConfigFile *model.SimpleConfigFil wc.RemoveAllWatcher(watchCtx.ClientID()) } }) + + log.Info("[Config][Watcher] received config file release event.", zap.String("file", watchFileId), + zap.Uint64("version", publishConfigFile.Version), zap.Int("clients", clientIds.Len()), + zap.Int("notify", notifyCnt)) } func (wc *watchCenter) MatchBetaReleaseFile(clientLabels map[string]string, event *model.SimpleConfigFileRelease) bool { diff --git a/go.mod b/go.mod index 83fecddb5..67e4431c2 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/nicksnyder/go-i18n/v2 v2.2.0 github.com/pkg/errors v0.9.1 github.com/polarismesh/go-restful-openapi/v2 v2.0.0-20220928152401-083908d10219 - github.com/prometheus/client_golang v1.12.2 + github.com/prometheus/client_golang v1.18.0 github.com/smartystreets/goconvey v1.6.4 github.com/spf13/cobra v1.2.1 github.com/stretchr/testify v1.8.3 @@ -30,11 +30,11 @@ require ( go.uber.org/zap v1.23.0 golang.org/x/crypto v0.17.0 golang.org/x/net v0.17.0 - golang.org/x/sync v0.1.0 + golang.org/x/sync v0.6.0 golang.org/x/text v0.14.0 golang.org/x/time v0.1.1-0.20221020023724-80b9fac54d29 google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 + google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -67,9 +67,9 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.32.1 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/smartystreets/assertions v1.0.1 // indirect github.com/spf13/pflag v1.0.5 // indirect go.uber.org/goleak v1.1.12 // indirect @@ -85,6 +85,8 @@ require ( github.com/polarismesh/specification v1.4.2-alpha.7 ) +require github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect + require ( github.com/dlclark/regexp2 v1.10.0 go.etcd.io/bbolt v1.3.7 diff --git a/go.sum b/go.sum index fa74a49ed..c544ad485 100644 --- a/go.sum +++ b/go.sum @@ -281,6 +281,8 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -332,23 +334,31 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -526,6 +536,9 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -766,6 +779,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/plugin/statis/logger/statis.go b/plugin/statis/logger/statis.go index 8c1a32037..6a8121c09 100644 --- a/plugin/statis/logger/statis.go +++ b/plugin/statis/logger/statis.go @@ -117,7 +117,9 @@ func (a *StatisWorker) metricsHandle(mt metrics.CallMetricType, start time.Time, var prefixMax int for i := range statics { prefixMax = int(math.Max(float64(prefixMax), float64(len(statics[i].API)))) - msg += formatAPICallStatisItem(mt, statics[i]) + } + for i := range statics { + msg += formatAPICallStatisItem(prefixMax, mt, statics[i]) } if len(msg) == 0 { log.Info(fmt.Sprintf("Statis %s: No API Call\n", startStr)) @@ -133,12 +135,12 @@ func (a *StatisWorker) metricsHandle(mt metrics.CallMetricType, start time.Time, log.Info(header + msg) } -func formatAPICallStatisItem(mt metrics.CallMetricType, item *base.APICallStatisItem) string { +func formatAPICallStatisItem(prefixMax int, mt metrics.CallMetricType, item *base.APICallStatisItem) string { if item.Count == 0 { return "" } - return fmt.Sprintf("%-48v|%12v|%17v|%12v|%12v|%12.3f|%12.3f|%12.3f|\n", - item.API, mt, item.TrafficDirection, item.Code, item.Count, + return fmt.Sprintf("%-"+strconv.Itoa(prefixMax)+"v|%12v|%17v|%12v|%12v|%12.3f|%12.3f|%12.3f|\n", + item.API, item.Protocol, item.TrafficDirection, item.Code, item.Count, float64(item.MinTime)/1e6, float64(item.MaxTime)/1e6, float64(item.AccTime)/float64(item.Count)/1e6, diff --git a/release/standalone/port.properties b/release/standalone/port.properties index 4b57b4712..1ce36e5f7 100644 --- a/release/standalone/port.properties +++ b/release/standalone/port.properties @@ -10,4 +10,3 @@ polaris_limiter_grpc_port=8101 prometheus_port=9090 pushgateway_port=9091 nacos_http_port=8848 -nacos_grpc_port=9848 From 2ff102084c5aa495bb4cb6f1860e1d4f0153c16a Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Thu, 11 Jan 2024 14:39:48 +0800 Subject: [PATCH 6/8] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dnacos=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E5=85=BC=E5=AE=B9=E4=B8=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apiserver/nacosserver/v2/config/watch.go | 1 - go.mod | 2 - go.sum | 79 ++---------------------- 3 files changed, 4 insertions(+), 78 deletions(-) diff --git a/apiserver/nacosserver/v2/config/watch.go b/apiserver/nacosserver/v2/config/watch.go index 646bf03c1..185a1de73 100644 --- a/apiserver/nacosserver/v2/config/watch.go +++ b/apiserver/nacosserver/v2/config/watch.go @@ -114,7 +114,6 @@ func (c *StreamWatchContext) ShouldNotify(event *model.SimpleConfigFileRelease) if !event.Valid { return true } - nacoslog.Info("should notify", zap.String("client", c.ClientID()), zap.String("save-md5", watchFile.GetMd5().GetValue()), zap.String("recv-md5", event.Md5)) isChange := watchFile.GetMd5().GetValue() != event.Md5 return isChange } diff --git a/go.mod b/go.mod index 67e4431c2..bdfc7b8a5 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,6 @@ require ( github.com/ArthurHlt/go-eureka-client v1.1.0 github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect github.com/sirupsen/logrus v1.6.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) // Indirect dependencies group @@ -63,7 +62,6 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/jtolds/gls v4.20.0+incompatible // indirect github.com/mailru/easyjson v0.7.6 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/go.sum b/go.sum index c544ad485..a0be8da0a 100644 --- a/go.sum +++ b/go.sum @@ -48,19 +48,12 @@ github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20O github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= @@ -68,8 +61,6 @@ github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqO github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -113,12 +104,6 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= @@ -135,9 +120,7 @@ github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -245,9 +228,6 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= @@ -255,18 +235,15 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -278,9 +255,6 @@ github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= @@ -301,8 +275,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM= github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk= github.com/nicksnyder/go-i18n/v2 v2.2.0 h1:MNXbyPvd141JJqlU6gJKrczThxJy+kdCNivxZpBQFkw= @@ -316,7 +288,6 @@ github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -328,44 +299,23 @@ github.com/polarismesh/go-restful-openapi/v2 v2.0.0-20220928152401-083908d10219/ github.com/polarismesh/specification v1.4.2-alpha.7 h1:4BhlGD/xJ/092cuu/T5BgwAMwlPFg8vIMfBNMRyEtak= github.com/polarismesh/specification v1.4.2-alpha.7/go.mod h1:rDvMMtl5qebPmqiBLNa5Ps0XtwkP31ZLirbH4kXA0YU= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= @@ -423,7 +373,6 @@ go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95a go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -471,7 +420,6 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -480,7 +428,6 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -507,7 +454,6 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -522,7 +468,6 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -534,16 +479,11 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -557,7 +497,6 @@ golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -570,8 +509,6 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -579,7 +516,6 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -587,10 +523,7 @@ golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -777,14 +710,10 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= From 1e7d58c77f6a2feccfeb89a0786d64e1fe5dc0e2 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Thu, 11 Jan 2024 16:35:16 +0800 Subject: [PATCH 7/8] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dnacos=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E5=85=BC=E5=AE=B9=E4=B8=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auth/testexport.go | 5 ++++ config/interceptor/auth/client_authibility.go | 20 +++++++------- .../auth/config_file_authibility.go | 18 ++++++------- .../auth/config_file_group_authibility.go | 10 +++---- .../auth/config_file_release_authibility.go | 16 +++++------ ...config_file_release_history_authibility.go | 2 +- .../auth/config_file_template_authibility.go | 6 ++--- config/interceptor/auth/server_authability.go | 27 +++++++++++-------- config/interceptor/register.go | 9 ++++--- config/server.go | 5 ++-- config/server_test.go | 10 ++++++- config/test_export.go | 11 +++++--- plugin/textexport.go | 25 +++++++++++++++++ 13 files changed, 106 insertions(+), 58 deletions(-) create mode 100644 plugin/textexport.go diff --git a/auth/testexport.go b/auth/testexport.go index cd1b2a660..e2b5b0f48 100644 --- a/auth/testexport.go +++ b/auth/testexport.go @@ -35,3 +35,8 @@ func TestInitialize(ctx context.Context, authOpt *Config, storage store.Store, strategyMgn = strategySvr return userSvr, strategySvr, nil } + +func TestClean() { + userMgn = nil + strategyMgn = nil +} diff --git a/config/interceptor/auth/client_authibility.go b/config/interceptor/auth/client_authibility.go index 3dc57ec65..a3516a3cf 100644 --- a/config/interceptor/auth/client_authibility.go +++ b/config/interceptor/auth/client_authibility.go @@ -40,7 +40,7 @@ func (s *ServerAuthability) UpsertAndReleaseConfigFileFromClient(ctx context.Con ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.UpsertAndReleaseConfigFileFromClient(ctx, req) + return s.nextServer.UpsertAndReleaseConfigFileFromClient(ctx, req) } // CreateConfigFileFromClient 调用config_file的方法创建配置文件 @@ -59,7 +59,7 @@ func (s *ServerAuthability) CreateConfigFileFromClient(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.CreateConfigFileFromClient(ctx, fileInfo) + return s.nextServer.CreateConfigFileFromClient(ctx, fileInfo) } // UpdateConfigFileFromClient 调用config_file的方法更新配置文件 @@ -74,7 +74,7 @@ func (s *ServerAuthability) UpdateConfigFileFromClient(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.UpdateConfigFileFromClient(ctx, fileInfo) + return s.nextServer.UpdateConfigFileFromClient(ctx, fileInfo) } // DeleteConfigFileFromClient 删除配置文件,删除配置文件同时会通知客户端 Not_Found @@ -90,7 +90,7 @@ func (s *ServerAuthability) DeleteConfigFileFromClient(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.DeleteConfigFileFromClient(ctx, req) + return s.nextServer.DeleteConfigFileFromClient(ctx, req) } // PublishConfigFileFromClient 调用config_file_release的方法发布配置文件 @@ -109,7 +109,7 @@ func (s *ServerAuthability) PublishConfigFileFromClient(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.PublishConfigFileFromClient(ctx, fileInfo) + return s.nextServer.PublishConfigFileFromClient(ctx, fileInfo) } // GetConfigFileWithCache 从缓存中获取配置文件,如果客户端的版本号大于服务端,则服务端重新加载缓存 @@ -127,7 +127,7 @@ func (s *ServerAuthability) GetConfigFileWithCache(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.GetConfigFileWithCache(ctx, fileInfo) + return s.nextServer.GetConfigFileWithCache(ctx, fileInfo) } // WatchConfigFiles 监听配置文件变化 @@ -143,7 +143,7 @@ func (s *ServerAuthability) LongPullWatchFile(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.LongPullWatchFile(ctx, request) + return s.nextServer.LongPullWatchFile(ctx, request) } // GetConfigFileNamesWithCache 获取某个配置分组下的配置文件 @@ -163,7 +163,7 @@ func (s *ServerAuthability) GetConfigFileNamesWithCache(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.GetConfigFileNamesWithCache(ctx, req) + return s.nextServer.GetConfigFileNamesWithCache(ctx, req) } func (s *ServerAuthability) GetConfigGroupsWithCache(ctx context.Context, @@ -181,7 +181,7 @@ func (s *ServerAuthability) GetConfigGroupsWithCache(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.GetConfigGroupsWithCache(ctx, req) + return s.nextServer.GetConfigGroupsWithCache(ctx, req) } // CasUpsertAndReleaseConfigFileFromClient 创建/更新配置文件并发布 @@ -197,5 +197,5 @@ func (s *ServerAuthability) CasUpsertAndReleaseConfigFileFromClient(ctx context. ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.CasUpsertAndReleaseConfigFileFromClient(ctx, req) + return s.nextServer.CasUpsertAndReleaseConfigFileFromClient(ctx, req) } diff --git a/config/interceptor/auth/config_file_authibility.go b/config/interceptor/auth/config_file_authibility.go index 321cd72ca..cdf3cc774 100644 --- a/config/interceptor/auth/config_file_authibility.go +++ b/config/interceptor/auth/config_file_authibility.go @@ -39,7 +39,7 @@ func (s *ServerAuthability) CreateConfigFile(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.CreateConfigFile(ctx, configFile) + return s.nextServer.CreateConfigFile(ctx, configFile) } // GetConfigFileRichInfo 获取单个配置文件基础信息,包含发布状态等信息 @@ -53,7 +53,7 @@ func (s *ServerAuthability) GetConfigFileRichInfo(ctx context.Context, } ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.GetConfigFileRichInfo(ctx, req) + return s.nextServer.GetConfigFileRichInfo(ctx, req) } // SearchConfigFile 查询配置文件 @@ -67,7 +67,7 @@ func (s *ServerAuthability) SearchConfigFile(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.SearchConfigFile(ctx, filter) + return s.nextServer.SearchConfigFile(ctx, filter) } // UpdateConfigFile 更新配置文件 @@ -82,7 +82,7 @@ func (s *ServerAuthability) UpdateConfigFile( ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.UpdateConfigFile(ctx, configFile) + return s.nextServer.UpdateConfigFile(ctx, configFile) } // DeleteConfigFile 删除配置文件,删除配置文件同时会通知客户端 Not_Found @@ -98,7 +98,7 @@ func (s *ServerAuthability) DeleteConfigFile(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.DeleteConfigFile(ctx, req) + return s.nextServer.DeleteConfigFile(ctx, req) } // BatchDeleteConfigFile 批量删除配置文件 @@ -113,7 +113,7 @@ func (s *ServerAuthability) BatchDeleteConfigFile(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.BatchDeleteConfigFile(ctx, req) + return s.nextServer.BatchDeleteConfigFile(ctx, req) } func (s *ServerAuthability) ExportConfigFile(ctx context.Context, @@ -133,7 +133,7 @@ func (s *ServerAuthability) ExportConfigFile(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.ExportConfigFile(ctx, configFileExport) + return s.nextServer.ExportConfigFile(ctx, configFileExport) } func (s *ServerAuthability) ImportConfigFile(ctx context.Context, @@ -145,10 +145,10 @@ func (s *ServerAuthability) ImportConfigFile(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.ImportConfigFile(ctx, configFiles, conflictHandling) + return s.nextServer.ImportConfigFile(ctx, configFiles, conflictHandling) } func (s *ServerAuthability) GetAllConfigEncryptAlgorithms( ctx context.Context) *apiconfig.ConfigEncryptAlgorithmResponse { - return s.targetServer.GetAllConfigEncryptAlgorithms(ctx) + return s.nextServer.GetAllConfigEncryptAlgorithms(ctx) } diff --git a/config/interceptor/auth/config_file_group_authibility.go b/config/interceptor/auth/config_file_group_authibility.go index 49377293b..27633868d 100644 --- a/config/interceptor/auth/config_file_group_authibility.go +++ b/config/interceptor/auth/config_file_group_authibility.go @@ -43,7 +43,7 @@ func (s *ServerAuthability) CreateConfigFileGroup(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.CreateConfigFileGroup(ctx, configFileGroup) + return s.nextServer.CreateConfigFileGroup(ctx, configFileGroup) } // QueryConfigFileGroups 查询配置文件组 @@ -59,7 +59,7 @@ func (s *ServerAuthability) QueryConfigFileGroups(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - resp := s.targetServer.QueryConfigFileGroups(ctx, filter) + resp := s.nextServer.QueryConfigFileGroups(ctx, filter) if len(resp.ConfigFileGroups) != 0 { principal := model.Principal{ PrincipalID: utils.ParseUserID(ctx), @@ -70,7 +70,7 @@ func (s *ServerAuthability) QueryConfigFileGroups(ctx context.Context, editable := true // 如果鉴权能力没有开启,那就默认都可以进行编辑 if s.strategyMgn.GetAuthChecker().IsOpenConsoleAuth() { - editable = s.targetServer.CacheManager().AuthStrategy().IsResourceEditable(principal, + editable = s.cacheMgr.AuthStrategy().IsResourceEditable(principal, apisecurity.ResourceType_ConfigGroups, fmt.Sprintf("%d", group.GetId().GetValue())) } group.Editable = utils.NewBoolValue(editable) @@ -93,7 +93,7 @@ func (s *ServerAuthability) DeleteConfigFileGroup( ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.DeleteConfigFileGroup(ctx, namespace, name) + return s.nextServer.DeleteConfigFileGroup(ctx, namespace, name) } // UpdateConfigFileGroup 更新配置文件组 @@ -108,5 +108,5 @@ func (s *ServerAuthability) UpdateConfigFileGroup(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.UpdateConfigFileGroup(ctx, configFileGroup) + return s.nextServer.UpdateConfigFileGroup(ctx, configFileGroup) } diff --git a/config/interceptor/auth/config_file_release_authibility.go b/config/interceptor/auth/config_file_release_authibility.go index 3b5b64f70..7dd0879ec 100644 --- a/config/interceptor/auth/config_file_release_authibility.go +++ b/config/interceptor/auth/config_file_release_authibility.go @@ -41,7 +41,7 @@ func (s *ServerAuthability) PublishConfigFile(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.PublishConfigFile(ctx, configFileRelease) + return s.nextServer.PublishConfigFile(ctx, configFileRelease) } // GetConfigFileRelease 获取配置文件发布内容 @@ -56,7 +56,7 @@ func (s *ServerAuthability) GetConfigFileRelease(ctx context.Context, } ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.GetConfigFileRelease(ctx, req) + return s.nextServer.GetConfigFileRelease(ctx, req) } // DeleteConfigFileReleases implements ConfigCenterServer. @@ -70,7 +70,7 @@ func (s *ServerAuthability) DeleteConfigFileReleases(ctx context.Context, } ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.DeleteConfigFileReleases(ctx, reqs) + return s.nextServer.DeleteConfigFileReleases(ctx, reqs) } // GetConfigFileReleaseVersions implements ConfigCenterServer. @@ -84,7 +84,7 @@ func (s *ServerAuthability) GetConfigFileReleaseVersions(ctx context.Context, } ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.GetConfigFileReleaseVersions(ctx, filters) + return s.nextServer.GetConfigFileReleaseVersions(ctx, filters) } // GetConfigFileReleases implements ConfigCenterServer. @@ -98,7 +98,7 @@ func (s *ServerAuthability) GetConfigFileReleases(ctx context.Context, } ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.GetConfigFileReleases(ctx, filters) + return s.nextServer.GetConfigFileReleases(ctx, filters) } // RollbackConfigFileReleases implements ConfigCenterServer. @@ -112,7 +112,7 @@ func (s *ServerAuthability) RollbackConfigFileReleases(ctx context.Context, } ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.RollbackConfigFileReleases(ctx, reqs) + return s.nextServer.RollbackConfigFileReleases(ctx, reqs) } // UpsertAndReleaseConfigFile . @@ -127,7 +127,7 @@ func (s *ServerAuthability) UpsertAndReleaseConfigFile(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.UpsertAndReleaseConfigFile(ctx, req) + return s.nextServer.UpsertAndReleaseConfigFile(ctx, req) } func (s *ServerAuthability) StopGrayConfigFileReleases(ctx context.Context, @@ -142,5 +142,5 @@ func (s *ServerAuthability) StopGrayConfigFileReleases(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.StopGrayConfigFileReleases(ctx, reqs) + return s.nextServer.StopGrayConfigFileReleases(ctx, reqs) } diff --git a/config/interceptor/auth/config_file_release_history_authibility.go b/config/interceptor/auth/config_file_release_history_authibility.go index 5bf7c024f..d8c985dd4 100644 --- a/config/interceptor/auth/config_file_release_history_authibility.go +++ b/config/interceptor/auth/config_file_release_history_authibility.go @@ -38,5 +38,5 @@ func (s *ServerAuthability) GetConfigFileReleaseHistories(ctx context.Context, } ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.GetConfigFileReleaseHistories(ctx, filter) + return s.nextServer.GetConfigFileReleaseHistories(ctx, filter) } diff --git a/config/interceptor/auth/config_file_template_authibility.go b/config/interceptor/auth/config_file_template_authibility.go index 84d49e4d1..3aa76986a 100644 --- a/config/interceptor/auth/config_file_template_authibility.go +++ b/config/interceptor/auth/config_file_template_authibility.go @@ -37,7 +37,7 @@ func (s *ServerAuthability) GetAllConfigFileTemplates(ctx context.Context) *apic ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.GetAllConfigFileTemplates(ctx) + return s.nextServer.GetAllConfigFileTemplates(ctx) } // GetConfigFileTemplate get config file template @@ -50,7 +50,7 @@ func (s *ServerAuthability) GetConfigFileTemplate(ctx context.Context, name stri ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.GetConfigFileTemplate(ctx, name) + return s.nextServer.GetConfigFileTemplate(ctx, name) } // CreateConfigFileTemplate create config file template @@ -65,5 +65,5 @@ func (s *ServerAuthability) CreateConfigFileTemplate(ctx context.Context, ctx = authCtx.GetRequestContext() ctx = context.WithValue(ctx, utils.ContextAuthContextKey, authCtx) - return s.targetServer.CreateConfigFileTemplate(ctx, template) + return s.nextServer.CreateConfigFileTemplate(ctx, template) } diff --git a/config/interceptor/auth/server_authability.go b/config/interceptor/auth/server_authability.go index c45d160e4..2117e8fe0 100644 --- a/config/interceptor/auth/server_authability.go +++ b/config/interceptor/auth/server_authability.go @@ -26,6 +26,7 @@ import ( "go.uber.org/zap" "github.com/polarismesh/polaris/auth" + cachetypes "github.com/polarismesh/polaris/cache/api" "github.com/polarismesh/polaris/common/model" "github.com/polarismesh/polaris/common/utils" "github.com/polarismesh/polaris/config" @@ -35,19 +36,23 @@ var _ config.ConfigCenterServer = (*ServerAuthability)(nil) // Server 配置中心核心服务 type ServerAuthability struct { - targetServer *config.Server - userMgn auth.UserServer - strategyMgn auth.StrategyServer + cacheMgr cachetypes.CacheManager + nextServer config.ConfigCenterServer + userMgn auth.UserServer + strategyMgn auth.StrategyServer } -func New(targetServer *config.Server, - userMgn auth.UserServer, strategyMgn auth.StrategyServer) config.ConfigCenterServer { +func New(nextServer config.ConfigCenterServer, cacheMgr cachetypes.CacheManager, + userMgr auth.UserServer, strategyMgr auth.StrategyServer) config.ConfigCenterServer { proxy := &ServerAuthability{ - targetServer: targetServer, - userMgn: userMgn, - strategyMgn: strategyMgn, + nextServer: nextServer, + cacheMgr: cacheMgr, + userMgn: userMgr, + strategyMgn: strategyMgr, + } + if val, ok := nextServer.(*config.Server); !ok { + val.SetResourceHooks(proxy) } - targetServer.SetResourceHooks(proxy) return proxy } @@ -289,7 +294,7 @@ func (s *ServerAuthability) queryConfigGroupRsEntryByNames(ctx context.Context, configFileGroups := make([]*model.ConfigFileGroup, 0, len(names)) for i := range names { - data := s.targetServer.GroupCache().GetGroupByName(namespace, names[i]) + data := s.cacheMgr.ConfigGroup().GetGroupByName(namespace, names[i]) if data == nil { continue } @@ -325,7 +330,7 @@ func (s *ServerAuthability) queryWatchConfigFilesResource(ctx context.Context, continue } temp[key] = struct{}{} - data := s.targetServer.GroupCache().GetGroupByName(namespace, groupName) + data := s.cacheMgr.ConfigGroup().GetGroupByName(namespace, groupName) if data == nil { continue } diff --git a/config/interceptor/register.go b/config/interceptor/register.go index ea3ba0825..09b1c2e34 100644 --- a/config/interceptor/register.go +++ b/config/interceptor/register.go @@ -19,22 +19,23 @@ package config_chain import ( "github.com/polarismesh/polaris/auth" + cachetypes "github.com/polarismesh/polaris/cache/api" "github.com/polarismesh/polaris/config" config_auth "github.com/polarismesh/polaris/config/interceptor/auth" ) func init() { - err := config.RegisterServerProxy("auth", func(svr *config.Server, pre config.ConfigCenterServer) (config.ConfigCenterServer, error) { - userMgn, err := auth.GetUserServer() + err := config.RegisterServerProxy("auth", func(cacheMgr cachetypes.CacheManager, pre config.ConfigCenterServer) (config.ConfigCenterServer, error) { + userMgr, err := auth.GetUserServer() if err != nil { return nil, err } - strategyMgn, err := auth.GetStrategyServer() + strategyMgr, err := auth.GetStrategyServer() if err != nil { return nil, err } - return config_auth.New(svr, userMgn, strategyMgn), nil + return config_auth.New(pre, cacheMgr, userMgr, strategyMgr), nil }) if err != nil { panic(err) diff --git a/config/server.go b/config/server.go index c97b59fc0..2cf71588f 100644 --- a/config/server.go +++ b/config/server.go @@ -46,7 +46,7 @@ var ( serverProxyFactories = map[string]ServerProxyFactory{} ) -type ServerProxyFactory func(svr *Server, pre ConfigCenterServer) (ConfigCenterServer, error) +type ServerProxyFactory func(cacheMgr cachetypes.CacheManager, pre ConfigCenterServer) (ConfigCenterServer, error) func RegisterServerProxy(name string, factor ServerProxyFactory) error { if _, ok := serverProxyFactories[name]; ok { @@ -119,6 +119,7 @@ func doInitialize(ctx context.Context, config Config, s store.Store, cacheMgr ca return nil, nil, err } + proxySvr = originSvr // 需要返回包装代理的 DiscoverServer order := config.Interceptors for i := range order { @@ -127,7 +128,7 @@ func doInitialize(ctx context.Context, config Config, s store.Store, cacheMgr ca return nil, nil, fmt.Errorf("name(%s) not exist in serverProxyFactories", order[i]) } - tmpSvr, err := factory(originSvr, server) + tmpSvr, err := factory(cacheMgr, proxySvr) if err != nil { return nil, nil, err } diff --git a/config/server_test.go b/config/server_test.go index 20409aff6..b923ad656 100644 --- a/config/server_test.go +++ b/config/server_test.go @@ -24,8 +24,10 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "github.com/polarismesh/polaris/auth" mockcache "github.com/polarismesh/polaris/cache/mock" "github.com/polarismesh/polaris/common/eventhub" + "github.com/polarismesh/polaris/plugin" mockstore "github.com/polarismesh/polaris/store/mock" ) @@ -36,6 +38,8 @@ func Test_Initialize(t *testing.T) { cacheMgr := mockcache.NewMockCacheManager(ctrl) t.Cleanup(func() { + plugin.TestCleanCryptoPlugin() + auth.TestClean() ctrl.Finish() }) @@ -44,8 +48,12 @@ func Test_Initialize(t *testing.T) { cacheMgr.EXPECT().Gray().Return(nil).AnyTimes() cacheMgr.EXPECT().ConfigGroup().Return(nil).AnyTimes() + _, _, err := auth.TestInitialize(context.Background(), &auth.Config{}, mockStore, cacheMgr) + assert.NoError(t, err) + proxySvr, originSvr, err := doInitialize(context.Background(), Config{ - Open: true, + Open: true, + Interceptors: GetChainOrder(), }, mockStore, cacheMgr, nil) assert.NoError(t, err) assert.NotNil(t, originSvr) diff --git a/config/test_export.go b/config/test_export.go index 775577980..b2f033f19 100644 --- a/config/test_export.go +++ b/config/test_export.go @@ -35,8 +35,10 @@ import ( // Initialize 初始化配置中心模块 func TestInitialize(ctx context.Context, config Config, s store.Store, cacheMgn *cache.CacheManager, namespaceOperator namespace.NamespaceOperateServer, userMgn auth.UserServer, - strategyMgn auth.StrategyServer) (ConfigCenterServer, ConfigCenterServer, error) { - mockServer := &Server{} + strategyMgn auth.StrategyServer) (ConfigCenterServer, *Server, error) { + mockServer := &Server{ + initialized: true, + } log.Info("Config.TestInitialize", zap.Any("entries", testConfigCacheEntries)) _ = cacheMgn.OpenResourceCache(testConfigCacheEntries...) @@ -45,7 +47,7 @@ func TestInitialize(ctx context.Context, config Config, s store.Store, cacheMgn } var proxySvr ConfigCenterServer - var err error + proxySvr = mockServer // 需要返回包装代理的 ConfigCenterServer order := config.Interceptors for i := range order { @@ -54,10 +56,11 @@ func TestInitialize(ctx context.Context, config Config, s store.Store, cacheMgn return nil, nil, fmt.Errorf("name(%s) not exist in serverProxyFactories", order[i]) } - proxySvr, err = factory(mockServer, proxySvr) + tmpSvr, err := factory(cacheMgn, proxySvr) if err != nil { return nil, nil, err } + proxySvr = tmpSvr } return proxySvr, mockServer, nil } diff --git a/plugin/textexport.go b/plugin/textexport.go new file mode 100644 index 000000000..d87b4a3e4 --- /dev/null +++ b/plugin/textexport.go @@ -0,0 +1,25 @@ +/** + * Tencent is pleased to support the open source community by making Polaris available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the BSD 3-Clause License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://opensource.org/licenses/BSD-3-Clause + * + * Unless required by applicable law or agreed to in writing, software distributed + * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package plugin + +import "sync" + +func TestCleanCryptoPlugin() { + cryptoManagerOnce = sync.Once{} + cryptoManager = nil +} From e1e1dbbabdfae80ac0c520687aa909bc52413d68 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Thu, 11 Jan 2024 18:10:50 +0800 Subject: [PATCH 8/8] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dnacos=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E5=85=BC=E5=AE=B9=E4=B8=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/interceptor/register.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/interceptor/register.go b/config/interceptor/register.go index 09b1c2e34..8f048731b 100644 --- a/config/interceptor/register.go +++ b/config/interceptor/register.go @@ -25,7 +25,8 @@ import ( ) func init() { - err := config.RegisterServerProxy("auth", func(cacheMgr cachetypes.CacheManager, pre config.ConfigCenterServer) (config.ConfigCenterServer, error) { + err := config.RegisterServerProxy("auth", func(cacheMgr cachetypes.CacheManager, + pre config.ConfigCenterServer) (config.ConfigCenterServer, error) { userMgr, err := auth.GetUserServer() if err != nil { return nil, err