Skip to content

Commit

Permalink
Revert "Use GRPC interceptors for bearer token (jaegertracing#6063)"
Browse files Browse the repository at this point in the history
This reverts commit f5575e2.
  • Loading branch information
yurishkuro committed Nov 2, 2024
1 parent 2d2d902 commit b6f2782
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 365 deletions.
20 changes: 5 additions & 15 deletions cmd/query/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,14 @@ func createGRPCServerLegacy(

grpcOpts = append(grpcOpts, grpc.Creds(creds))
}

unaryInterceptors := []grpc.UnaryServerInterceptor{
bearertoken.NewUnaryServerInterceptor(),
}
streamInterceptors := []grpc.StreamServerInterceptor{
bearertoken.NewStreamServerInterceptor(),
}
//nolint:contextcheck
if tm.Enabled {
unaryInterceptors = append(unaryInterceptors, tenancy.NewGuardingUnaryInterceptor(tm))
streamInterceptors = append(streamInterceptors, tenancy.NewGuardingStreamInterceptor(tm))
//nolint:contextcheck
grpcOpts = append(grpcOpts,
grpc.StreamInterceptor(tenancy.NewGuardingStreamInterceptor(tm)),
grpc.UnaryInterceptor(tenancy.NewGuardingUnaryInterceptor(tm)),
)
}

grpcOpts = append(grpcOpts,
grpc.ChainUnaryInterceptor(unaryInterceptors...),
grpc.ChainStreamInterceptor(streamInterceptors...),
)

server := grpc.NewServer(grpcOpts...)
return server, nil
}
Expand Down
19 changes: 4 additions & 15 deletions cmd/remote-storage/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"google.golang.org/grpc/reflection"

"github.com/jaegertracing/jaeger/cmd/query/app/querysvc"
"github.com/jaegertracing/jaeger/pkg/bearertoken"
"github.com/jaegertracing/jaeger/pkg/telemetery"
"github.com/jaegertracing/jaeger/pkg/tenancy"
"github.com/jaegertracing/jaeger/plugin/storage/grpc/shared"
Expand Down Expand Up @@ -97,23 +96,13 @@ func createGRPCServer(opts *Options, tm *tenancy.Manager, handler *shared.GRPCHa
creds := credentials.NewTLS(tlsCfg)
grpcOpts = append(grpcOpts, grpc.Creds(creds))
}

unaryInterceptors := []grpc.UnaryServerInterceptor{
bearertoken.NewUnaryServerInterceptor(),
}
streamInterceptors := []grpc.StreamServerInterceptor{
bearertoken.NewStreamServerInterceptor(),
}
if tm.Enabled {
unaryInterceptors = append(unaryInterceptors, tenancy.NewGuardingUnaryInterceptor(tm))
streamInterceptors = append(streamInterceptors, tenancy.NewGuardingStreamInterceptor(tm))
grpcOpts = append(grpcOpts,
grpc.StreamInterceptor(tenancy.NewGuardingStreamInterceptor(tm)),
grpc.UnaryInterceptor(tenancy.NewGuardingUnaryInterceptor(tm)),
)
}

grpcOpts = append(grpcOpts,
grpc.ChainUnaryInterceptor(unaryInterceptors...),
grpc.ChainStreamInterceptor(streamInterceptors...),
)

server := grpc.NewServer(grpcOpts...)
healthServer := health.NewServer()
reflection.Register(server)
Expand Down
135 changes: 0 additions & 135 deletions pkg/bearertoken/grpc.go

This file was deleted.

196 changes: 0 additions & 196 deletions pkg/bearertoken/grpc_test.go

This file was deleted.

Loading

0 comments on commit b6f2782

Please sign in to comment.