From 1b5b2c42e546a3c6b95d300fbbbdf0d00f3d567b Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Thu, 24 Oct 2024 22:40:14 +0800 Subject: [PATCH] :sparkles: Add service type for pusher --- pkg/internal/directory/service_rpc.go | 2 ++ pkg/nex/const.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/internal/directory/service_rpc.go b/pkg/internal/directory/service_rpc.go index 9d140b7..f0ba2fa 100644 --- a/pkg/internal/directory/service_rpc.go +++ b/pkg/internal/directory/service_rpc.go @@ -66,6 +66,8 @@ func (v *ServiceRpcServer) AddService(ctx context.Context, info *proto.ServiceIn if info.GetId() != clientId { return nil, status.Errorf(codes.InvalidArgument, "client_id mismatch in metadata") + } else if len(clientId) == 0 { + return nil, status.Errorf(codes.InvalidArgument, "client_id must not be blank") } in := &ServiceInstance{ diff --git a/pkg/nex/const.go b/pkg/nex/const.go index b493f31..37d91e2 100644 --- a/pkg/nex/const.go +++ b/pkg/nex/const.go @@ -1,5 +1,6 @@ package nex const ( - ServiceTypeAuth = "id" + ServiceTypeAuth = "id" + ServiceTypePusher = "pusher" )