From 6c4e593b54815153e79551a1cfca9f529df61ee1 Mon Sep 17 00:00:00 2001 From: WTIFS <9314475+WTIFS@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:34:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=85=E5=9C=A8token=E4=B8=8D?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=E8=BF=9B=E8=A1=8C=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=20(#1339)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apiserver/grpcserver/discover/v1/client_access.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apiserver/grpcserver/discover/v1/client_access.go b/apiserver/grpcserver/discover/v1/client_access.go index 89a3d5d19..a190d383c 100644 --- a/apiserver/grpcserver/discover/v1/client_access.go +++ b/apiserver/grpcserver/discover/v1/client_access.go @@ -144,6 +144,10 @@ func (g *DiscoverServer) Discover(server apiservice.PolarisGRPC_DiscoverServer) }) }() + if in.GetService().GetToken().GetValue() != "" { + ctx = context.WithValue(ctx, utils.ContextAuthTokenKey, in.GetService().GetToken().GetValue()) + } + switch in.Type { case apiservice.DiscoverRequest_INSTANCE: action = metrics.ActionDiscoverInstance