From e0c7f48d20eb99718c4a5b491e4ed69f164a8c1f Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Tue, 31 Mar 2020 12:57:38 +0100 Subject: [PATCH] WithServicePrivileges => ServicePrivileges --- client/grpc/grpc.go | 2 +- client/options.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/grpc/grpc.go b/client/grpc/grpc.go index acc1e649..340f2df7 100644 --- a/client/grpc/grpc.go +++ b/client/grpc/grpc.go @@ -133,7 +133,7 @@ func (g *grpcClient) call(ctx context.Context, node *registry.Node, req client.R // if the caller specifies using service privelages, and the client // has auth set, override the authorization header - if opts.WithServicePrivileges && g.opts.Auth != nil && g.opts.Auth.Options().Token != nil { + if opts.ServicePrivileges && g.opts.Auth != nil && g.opts.Auth.Options().Token != nil { t := g.opts.Auth.Options().Token header["authorization"] = auth.BearerScheme + t.Token } diff --git a/client/options.go b/client/options.go index 1366ad56..72d9d2bd 100644 --- a/client/options.go +++ b/client/options.go @@ -58,7 +58,7 @@ type CallOptions struct { // Request/Response timeout RequestTimeout time.Duration // Use the services own auth token - WithServicePrivileges bool + ServicePrivileges bool // Middleware for low level call func CallWrappers []CallWrapper @@ -307,7 +307,7 @@ func WithDialTimeout(d time.Duration) CallOption { // authorization header with the services own auth token func WithServicePrivileges() CallOption { return func(o *CallOptions) { - o.WithServicePrivileges = true + o.ServicePrivileges = true } }