flytekit.clients.grpc_utils.auth_interceptor
Directory
Classes
Class |
Description |
AuthUnaryInterceptor |
This Interceptor can be used to automatically add Auth Metadata for every call - lazily in case authentication. |
Authenticator |
Base authenticator for all authentication flows. |
flytekit.clients.grpc_utils.auth_interceptor.AuthUnaryInterceptor
This Interceptor can be used to automatically add Auth Metadata for every call - lazily in case authentication
is needed.
def AuthUnaryInterceptor(
get_authenticator: typing.Callable[[], flytekit.clients.auth.authenticator.Authenticator],
):
Parameter |
Type |
get_authenticator |
typing.Callable[[], flytekit.clients.auth.authenticator.Authenticator] |
Methods
intercept_unary_stream()
def intercept_unary_stream(
continuation,
client_call_details,
request,
):
Handles a stream call and adds authentication metadata if needed
Parameter |
Type |
continuation |
|
client_call_details |
|
request |
|
intercept_unary_unary()
def intercept_unary_unary(
continuation: typing.Callable,
client_call_details: grpc.ClientCallDetails,
request: typing.Any,
):
Intercepts unary calls and adds auth metadata if available. On Unauthenticated, resets the token and refreshes
and then retries with the new token
Parameter |
Type |
continuation |
typing.Callable |
client_call_details |
grpc.ClientCallDetails |
request |
typing.Any |
Properties
Property |
Type |
Description |
authenticator |
|
|
flytekit.clients.grpc_utils.auth_interceptor.Authenticator
Base authenticator for all authentication flows
def Authenticator(
endpoint: str,
header_key: str,
credentials: flytekit.clients.auth.keyring.Credentials,
http_proxy_url: typing.Optional[str],
verify: typing.Union[bool, str, NoneType],
):
Parameter |
Type |
endpoint |
str |
header_key |
str |
credentials |
flytekit.clients.auth.keyring.Credentials |
http_proxy_url |
typing.Optional[str] |
verify |
typing.Union[bool, str, NoneType] |
Methods
def fetch_grpc_call_auth_metadata()
get_credentials()
refresh_credentials()
def refresh_credentials()