Table of Contents

Class ApiKeyClientInterceptor

Namespace
Virtufin.Api.Client
Assembly
Virtufin.Api.Client.dll

Client-side gRPC interceptor that attaches x-api-key to every outbound call on the channel it is applied to. Pairs with the gateway's server-side ApiKeyInterceptor, which rejects every non-health-check call once at least one key is configured on it.

public sealed class ApiKeyClientInterceptor : Interceptor
Inheritance
ApiKeyClientInterceptor
Inherited Members

Constructors

ApiKeyClientInterceptor(string?)

public ApiKeyClientInterceptor(string? apiKey)

Parameters

apiKey string

The key to send. Null or empty sends no key, which is correct when the gateway's auth is disabled (local dev, no keys configured).

Fields

HeaderName

The request metadata header carrying the API key.

public const string HeaderName = "x-api-key"

Field Value

string

Methods

AsyncClientStreamingCall<TRequest, TResponse>(ClientInterceptorContext<TRequest, TResponse>, AsyncClientStreamingCallContinuation<TRequest, TResponse>)

Intercepts an asynchronous invocation of a client streaming call.

public override AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(ClientInterceptorContext<TRequest, TResponse> context, Interceptor.AsyncClientStreamingCallContinuation<TRequest, TResponse> continuation) where TRequest : class where TResponse : class

Parameters

context ClientInterceptorContext<TRequest, TResponse>

The ClientInterceptorContext<TRequest, TResponse> associated with the current invocation.

continuation Interceptor.AsyncClientStreamingCallContinuation<TRequest, TResponse>

The callback that continues the invocation process. This can be invoked zero or more times by the interceptor. The interceptor can invoke the continuation passing the given context argument, or substitute as it sees fit.

Returns

AsyncClientStreamingCall<TRequest, TResponse>

An instance of AsyncClientStreamingCall<TRequest, TResponse> representing an asynchronous client-streaming invocation. The interceptor can simply return the return value of the continuation delegate passed to it intact, or construct its own substitute as it sees fit.

Type Parameters

TRequest
TResponse

AsyncDuplexStreamingCall<TRequest, TResponse>(ClientInterceptorContext<TRequest, TResponse>, AsyncDuplexStreamingCallContinuation<TRequest, TResponse>)

Intercepts an asynchronous invocation of a duplex streaming call.

public override AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(ClientInterceptorContext<TRequest, TResponse> context, Interceptor.AsyncDuplexStreamingCallContinuation<TRequest, TResponse> continuation) where TRequest : class where TResponse : class

Parameters

context ClientInterceptorContext<TRequest, TResponse>

The ClientInterceptorContext<TRequest, TResponse> associated with the current invocation.

continuation Interceptor.AsyncDuplexStreamingCallContinuation<TRequest, TResponse>

The callback that continues the invocation process. This can be invoked zero or more times by the interceptor. The interceptor can invoke the continuation passing the given context argument, or substitute as it sees fit.

Returns

AsyncDuplexStreamingCall<TRequest, TResponse>

An instance of AsyncDuplexStreamingCall<TRequest, TResponse> representing an asynchronous duplex-streaming invocation. The interceptor can simply return the return value of the continuation delegate passed to it intact, or construct its own substitute as it sees fit.

Type Parameters

TRequest
TResponse

AsyncServerStreamingCall<TRequest, TResponse>(TRequest, ClientInterceptorContext<TRequest, TResponse>, AsyncServerStreamingCallContinuation<TRequest, TResponse>)

Intercepts an asynchronous invocation of a streaming remote call.

public override AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(TRequest request, ClientInterceptorContext<TRequest, TResponse> context, Interceptor.AsyncServerStreamingCallContinuation<TRequest, TResponse> continuation) where TRequest : class where TResponse : class

Parameters

request TRequest

The request message of the invocation.

context ClientInterceptorContext<TRequest, TResponse>

The ClientInterceptorContext<TRequest, TResponse> associated with the current invocation.

continuation Interceptor.AsyncServerStreamingCallContinuation<TRequest, TResponse>

The callback that continues the invocation process. This can be invoked zero or more times by the interceptor. The interceptor can invoke the continuation passing the given request value and context arguments, or substitute them as it sees fit.

Returns

AsyncServerStreamingCall<TResponse>

An instance of AsyncServerStreamingCall<TResponse> representing an asynchronous server-streaming invocation. The interceptor can simply return the return value of the continuation delegate passed to it intact, or construct its own substitute as it sees fit.

Type Parameters

TRequest
TResponse

AsyncUnaryCall<TRequest, TResponse>(TRequest, ClientInterceptorContext<TRequest, TResponse>, AsyncUnaryCallContinuation<TRequest, TResponse>)

Intercepts an asynchronous invocation of a simple remote call.

public override AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(TRequest request, ClientInterceptorContext<TRequest, TResponse> context, Interceptor.AsyncUnaryCallContinuation<TRequest, TResponse> continuation) where TRequest : class where TResponse : class

Parameters

request TRequest

The request message of the invocation.

context ClientInterceptorContext<TRequest, TResponse>

The ClientInterceptorContext<TRequest, TResponse> associated with the current invocation.

continuation Interceptor.AsyncUnaryCallContinuation<TRequest, TResponse>

The callback that continues the invocation process. This can be invoked zero or more times by the interceptor. The interceptor can invoke the continuation passing the given request value and context arguments, or substitute them as it sees fit.

Returns

AsyncUnaryCall<TResponse>

An instance of AsyncUnaryCall<TResponse> representing an asynchronous unary invocation. The interceptor can simply return the return value of the continuation delegate passed to it intact, or construct its own substitute as it sees fit.

Type Parameters

TRequest
TResponse

BlockingUnaryCall<TRequest, TResponse>(TRequest, ClientInterceptorContext<TRequest, TResponse>, BlockingUnaryCallContinuation<TRequest, TResponse>)

Intercepts a blocking invocation of a simple remote call.

public override TResponse BlockingUnaryCall<TRequest, TResponse>(TRequest request, ClientInterceptorContext<TRequest, TResponse> context, Interceptor.BlockingUnaryCallContinuation<TRequest, TResponse> continuation) where TRequest : class where TResponse : class

Parameters

request TRequest

The request message of the invocation.

context ClientInterceptorContext<TRequest, TResponse>

The ClientInterceptorContext<TRequest, TResponse> associated with the current invocation.

continuation Interceptor.BlockingUnaryCallContinuation<TRequest, TResponse>

The callback that continues the invocation process. This can be invoked zero or more times by the interceptor. The interceptor can invoke the continuation passing the given request value and context arguments, or substitute them as it sees fit.

Returns

TResponse

The response message of the current invocation. The interceptor can simply return the return value of the continuation delegate passed to it intact, or an arbitrary value as it sees fit.

Type Parameters

TRequest
TResponse