enhance: [Cherry-pick] report auth log to hook when grpc authenticate failed (#39192)

relate: https://github.com/milvus-io/milvus/pull/38943

Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
pull/38913/head^2
aoiasd 2025-01-14 17:47:04 +08:00 committed by GitHub
parent 4a47f760b3
commit e6ac2fe063
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -31,7 +31,6 @@ import (
"github.com/gin-gonic/gin"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth"
"github.com/soheilhy/cmux"
clientv3 "go.etcd.io/etcd/client/v3"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
@ -242,7 +241,7 @@ func (s *Server) startExternalGrpc(errChan chan error) {
if enableCustomInterceptor {
unaryServerOption = grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(
accesslog.UnaryAccessLogInterceptor,
grpc_auth.UnaryServerInterceptor(proxy.AuthenticationInterceptor),
proxy.GrpcAuthInterceptor(proxy.AuthenticationInterceptor),
proxy.DatabaseInterceptor(),
proxy.UnaryServerHookInterceptor(),
proxy.UnaryServerInterceptor(proxy.PrivilegeInterceptor),