Package com.zb.mom.ww.mxgateway.client
Class MxGatewayAuthInterceptor
java.lang.Object
com.zb.mom.ww.mxgateway.client.MxGatewayAuthInterceptor
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionMxGatewayAuthInterceptor(String apiKey) Creates a new interceptor using the supplied API key. -
Method Summary
Modifier and TypeMethodDescription<ReqT,RespT>
io.grpc.ClientCall<ReqT,RespT> interceptCall(io.grpc.MethodDescriptor<ReqT, RespT> method, io.grpc.CallOptions callOptions, io.grpc.Channel next)
-
Constructor Details
-
MxGatewayAuthInterceptor
Creates a new interceptor using the supplied API key.- Parameters:
apiKey- gateway API key;nullor 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:
interceptCallin interfaceio.grpc.ClientInterceptor
-