Class MxGatewayAuthInterceptor

java.lang.Object
com.zb.mom.ww.mxgateway.client.MxGatewayAuthInterceptor
All Implemented Interfaces:
io.grpc.ClientInterceptor

public final class MxGatewayAuthInterceptor extends Object implements io.grpc.ClientInterceptor
gRPC client interceptor that attaches the authorization: Bearer ... header carrying the gateway API key. A blank or null key disables the interceptor so unauthenticated calls pass through unchanged.
  • Constructor Details

    • MxGatewayAuthInterceptor

      public MxGatewayAuthInterceptor(String apiKey)
      Creates a new interceptor using the supplied API key.
      Parameters:
      apiKey - gateway API key; null or blank disables the interceptor
  • Method Details

    • interceptCall

      public <ReqT, RespT> io.grpc.ClientCall<ReqT,RespT> interceptCall(io.grpc.MethodDescriptor<ReqT,RespT> method, io.grpc.CallOptions callOptions, io.grpc.Channel next)
      Specified by:
      interceptCall in interface io.grpc.ClientInterceptor