Auth Client Wrapper

This commit is contained in:
Ben Toogood
2020-04-29 15:11:06 +01:00
parent 9d2fdb84be
commit 99f8be5b3d
5 changed files with 145 additions and 132 deletions

View File

@@ -39,8 +39,9 @@ func newService(opts ...Option) Service {
authFn := func() auth.Auth { return options.Server.Options().Auth }
// wrap client to inject From-Service header on any calls
options.Client = wrapper.FromService(serviceName, options.Client, authFn)
options.Client = wrapper.FromService(serviceName, options.Client)
options.Client = wrapper.TraceCall(serviceName, trace.DefaultTracer, options.Client)
options.Client = wrapper.AuthClient(serviceName, authFn, options.Client)
// wrap the server to provide handler stats
options.Server.Init(