ApiTokenAuth#
- class ApiTokenAuth(get_token_callback)#
Bases:
UnaryUnaryClientInterceptor
,UnaryStreamClientInterceptor
Module:
iqm.station_control.client.iqm_server.grpc_utils
Methods
Intercepts a unary-stream invocation.
Intercepts a unary-unary invocation asynchronously.
- intercept_unary_stream(continuation, client_call_details, request)#
Intercepts a unary-stream invocation.
- Parameters:
continuation – A function that proceeds with the invocation by executing the next interceptor in chain or invoking the actual RPC on the underlying Channel. It is the interceptor’s responsibility to call it if it decides to move the RPC forward. The interceptor can use response_iterator = continuation(client_call_details, request) to continue with the RPC. continuation returns an object that is both a Call for the RPC and an iterator for response values. Drawing response values from the returned Call-iterator may raise RpcError indicating termination of the RPC with non-OK status.
client_call_details – A ClientCallDetails object describing the outgoing RPC.
request – The request value for the RPC.
- Returns:
An object that is both a Call for the RPC and an iterator of response values. Drawing response values from the returned Call-iterator may raise RpcError indicating termination of the RPC with non-OK status. This object should also fulfill the Future interface, though it may not.
- intercept_unary_unary(continuation, client_call_details, request)#
Intercepts a unary-unary invocation asynchronously.
- Parameters:
continuation – A function that proceeds with the invocation by executing the next interceptor in chain or invoking the actual RPC on the underlying Channel. It is the interceptor’s responsibility to call it if it decides to move the RPC forward. The interceptor can use response_future = continuation(client_call_details, request) to continue with the RPC. continuation returns an object that is both a Call for the RPC and a Future. In the event of RPC completion, the return Call-Future’s result value will be the response message of the RPC. Should the event terminate with non-OK status, the returned Call-Future’s exception value will be an RpcError.
client_call_details – A ClientCallDetails object describing the outgoing RPC.
request – The request value for the RPC.
- Returns:
An object that is both a Call for the RPC and a Future. In the event of RPC completion, the return Call-Future’s result value will be the response message of the RPC. Should the event terminate with non-OK status, the returned Call-Future’s exception value will be an RpcError.