authentication
frequenz.client.base.authentication ¤
An Interceptor that adds the API key to a gRPC call.
Classes¤
frequenz.client.base.authentication.AuthenticationInterceptorUnaryStream ¤
Bases: UnaryStreamClientInterceptor
An Interceptor that adds HMAC authentication of the metadata fields to a gRPC call.
Source code in src/frequenz/client/base/authentication.py
Functions¤
__init__ ¤
__init__(options: AuthenticationOptions)
Create an instance of the interceptor.
PARAMETER | DESCRIPTION |
---|---|
options
|
The options for authenticating to the endpoint.
TYPE:
|
intercept_unary_stream
async
¤
intercept_unary_stream(
continuation: Callable[
[ClientCallDetails, object],
UnaryStreamCall[object, object],
],
client_call_details: ClientCallDetails,
request: object,
) -> (
AsyncIterable[object] | UnaryStreamCall[object, object]
)
Intercept the call to add HMAC authentication to the metadata fields.
This is a known method from the base class that is overridden.
PARAMETER | DESCRIPTION |
---|---|
continuation
|
The next interceptor in the chain.
TYPE:
|
client_call_details
|
The call details.
TYPE:
|
request
|
The request object.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
AsyncIterable[object] | UnaryStreamCall[object, object]
|
The response object (this implementation does not modify the response). |
Source code in src/frequenz/client/base/authentication.py
frequenz.client.base.authentication.AuthenticationInterceptorUnaryUnary ¤
Bases: UnaryUnaryClientInterceptor
An Interceptor that adds HMAC authentication of the metadata fields to a gRPC call.
Source code in src/frequenz/client/base/authentication.py
Functions¤
__init__ ¤
__init__(options: AuthenticationOptions)
Create an instance of the interceptor.
PARAMETER | DESCRIPTION |
---|---|
options
|
The options for authenticating to the endpoint.
TYPE:
|
intercept_unary_unary
async
¤
intercept_unary_unary(
continuation: Callable[
[ClientCallDetails, object],
UnaryUnaryCall[object, object],
],
client_call_details: ClientCallDetails,
request: object,
) -> object
Intercept the call to add HMAC authentication to the metadata fields.
This is a known method from the base class that is overridden.
PARAMETER | DESCRIPTION |
---|---|
continuation
|
The next interceptor in the chain.
TYPE:
|
client_call_details
|
The call details.
TYPE:
|
request
|
The request object.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
object
|
The response object (this implementation does not modify the response). |
Source code in src/frequenz/client/base/authentication.py
frequenz.client.base.authentication.AuthenticationOptions
dataclass
¤
Options for authenticating to the endpoint.