From 301bb127cef1ae2cde5961454990683e54aa3a85 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Tue, 25 Feb 2020 22:15:44 +0000 Subject: [PATCH] =?UTF-8?q?add=20MICRO=5FAUTH=5FTOKEN,=20parse=20token=20i?= =?UTF-8?q?n=20wrapper,=20preload=20config=20and=20othe=E2=80=A6=20(#1261)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add MICRO_AUTH_TOKEN, parse token in wrapper, preload config and other things * fix wrapper panic --- grpc.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/grpc.go b/grpc.go index cefb315..0905eac 100644 --- a/grpc.go +++ b/grpc.go @@ -18,7 +18,6 @@ import ( "github.com/micro/go-micro/v2/errors" "github.com/micro/go-micro/v2/metadata" "github.com/micro/go-micro/v2/registry" - "github.com/micro/go-micro/v2/util/config" "google.golang.org/grpc" "google.golang.org/grpc/credentials" @@ -129,10 +128,6 @@ func (g *grpcClient) call(ctx context.Context, node *registry.Node, req client.R header["timeout"] = fmt.Sprintf("%d", opts.RequestTimeout) // set the content type for the request header["x-content-type"] = req.ContentType() - // set the authorization token if one is saved locally - if token, err := config.Get("token"); err == nil && len(token) > 0 { - header["authorization"] = fmt.Sprintf("Bearer %v", token) - } md := gmetadata.New(header) ctx = gmetadata.NewOutgoingContext(ctx, md)