diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-09-29 16:11:05 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-10-04 13:46:01 +0300 |
commit | 6a0e4459a16dc0cd6d0007c08d44172b1ce360b7 (patch) | |
tree | 644b6cc5a7c4bb800e748b049ec29fd132d8bb90 /internal/praefect | |
parent | a59dc197402b0eb7d5cc53a7ea57c85daad3abe1 (diff) |
requestinfohandler: Absorb functionality of the field extractor
Merge the functionality that the field extractor provides into our
requestinfohandler logic. This unifies two related functionalities and
will eventually make it easier to move away from the tags mechanism that
is going away in go-grpc-middleware v2.
Add tests to make sure that the requestinfohandler interceptors work as
expected.
Diffstat (limited to 'internal/praefect')
-rw-r--r-- | internal/praefect/server.go | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/internal/praefect/server.go b/internal/praefect/server.go index 4044e8eab..167688b51 100644 --- a/internal/praefect/server.go +++ b/internal/praefect/server.go @@ -8,7 +8,6 @@ import ( "time" grpcmwlogrus "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" - grpcmwtags "github.com/grpc-ecosystem/go-grpc-middleware/tags" grpcprometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/server/auth" "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/backchannel" @@ -20,7 +19,6 @@ import ( "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/middleware/statushandler" "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/proxy" "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/sidechannel" - "gitlab.com/gitlab-org/gitaly/v16/internal/helper/fieldextractors" "gitlab.com/gitlab-org/gitaly/v16/internal/log" "gitlab.com/gitlab-org/gitaly/v16/internal/praefect/config" "gitlab.com/gitlab-org/gitaly/v16/internal/praefect/datastore" @@ -67,7 +65,6 @@ func NewBackchannelServerFactory(logger log.Logger, refSvc gitalypb.RefTransacti func commonUnaryServerInterceptors(logger log.Logger, messageProducer grpcmwlogrus.MessageProducer) []grpc.UnaryServerInterceptor { return []grpc.UnaryServerInterceptor{ - grpcmwtags.UnaryServerInterceptor(ctxtagsInterceptorOption()), grpccorrelation.UnaryServerCorrelationInterceptor(), // Must be above the metadata handler requestinfohandler.UnaryInterceptor, grpcprometheus.UnaryServerInterceptor, @@ -85,10 +82,6 @@ func commonUnaryServerInterceptors(logger log.Logger, messageProducer grpcmwlogr } } -func ctxtagsInterceptorOption() grpcmwtags.Option { - return grpcmwtags.WithFieldExtractorForInitialReq(fieldextractors.FieldExtractor) -} - // ServerOption is an option that can be passed to `NewGRPCServer()`. type ServerOption func(cfg *serverConfig) @@ -136,7 +129,6 @@ func NewGRPCServer( unaryInterceptors = append(unaryInterceptors, serverCfg.unaryInterceptors...) streamInterceptors := []grpc.StreamServerInterceptor{ - grpcmwtags.StreamServerInterceptor(ctxtagsInterceptorOption()), grpccorrelation.StreamServerCorrelationInterceptor(), // Must be above the metadata handler middleware.MethodTypeStreamInterceptor(deps.Registry, deps.Logger), requestinfohandler.StreamInterceptor, |