From d1529fced8863f3e2b3d2ffd6cfd1dc92086e0b1 Mon Sep 17 00:00:00 2001 From: kevin Date: Tue, 11 Aug 2020 13:47:22 +0800 Subject: [PATCH] move auth interceptor into serverinterceptors --- rpcx/internal/{ => serverinterceptors}/authinterceptor.go | 2 +- rpcx/server.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename rpcx/internal/{ => serverinterceptors}/authinterceptor.go (96%) diff --git a/rpcx/internal/authinterceptor.go b/rpcx/internal/serverinterceptors/authinterceptor.go similarity index 96% rename from rpcx/internal/authinterceptor.go rename to rpcx/internal/serverinterceptors/authinterceptor.go index d59e0158..7cea029f 100644 --- a/rpcx/internal/authinterceptor.go +++ b/rpcx/internal/serverinterceptors/authinterceptor.go @@ -1,4 +1,4 @@ -package internal +package serverinterceptors import ( "context" diff --git a/rpcx/server.go b/rpcx/server.go index 76dc086f..040808bb 100644 --- a/rpcx/server.go +++ b/rpcx/server.go @@ -117,8 +117,8 @@ func setupInterceptors(server internal.Server, c RpcServerConf, metrics *stat.Me return err } - server.AddStreamInterceptors(internal.StreamAuthorizeInterceptor(authenticator)) - server.AddUnaryInterceptors(internal.UnaryAuthorizeInterceptor(authenticator)) + server.AddStreamInterceptors(serverinterceptors.StreamAuthorizeInterceptor(authenticator)) + server.AddUnaryInterceptors(serverinterceptors.UnaryAuthorizeInterceptor(authenticator)) } return nil