(
ctx context.Context,
req interface{},
info *grpc.UnaryServerInfo,
handler grpc.UnaryHandler,
)
| 46 | } |
| 47 | |
| 48 | func (s *GrpcServer) grpcUnaryAuthInterceptor( |
| 49 | ctx context.Context, |
| 50 | req interface{}, |
| 51 | info *grpc.UnaryServerInfo, |
| 52 | handler grpc.UnaryHandler, |
| 53 | ) (interface{}, error) { |
| 54 | if strings.HasPrefix(info.FullMethod, "/auth.v1.AuthService/LoginBy") || |
| 55 | strings.HasPrefix(info.FullMethod, "/auth.v1.AuthService/RefreshToken") { |
| 56 | return handler(ctx, req) |
| 57 | } |
| 58 | |
| 59 | actor, err := s.authUserActor(ctx) |
| 60 | if err != nil { |
| 61 | return nil, err |
| 62 | } |
| 63 | |
| 64 | return handler(contextutil.SetActor(ctx, actor), req) |
| 65 | } |
| 66 | |
| 67 | func (s *GrpcServer) grpcStreamAuthInterceptor( |
| 68 | srv interface{}, |
nothing calls this directly
no test coverage detected