tlc.service.authentication

Module Contents

Classes

Data

Data

Description

DEFAULT_AUTH_TOKEN_MAX_AGE

API

tlc.service.authentication.DEFAULT_AUTH_TOKEN_MAX_AGE = 300
class tlc.service.authentication.BearerTokenAuthenticationMiddleware(app: litestar.types.ASGIApp, exclude: str | list[str] | None = None, exclude_from_auth_key: str = 'exclude_from_auth', exclude_http_methods: Sequence[litestar.types.Method] | None = None, scopes: litestar.types.Scopes | None = None)

Bases: litestar.middleware.authentication.AbstractAuthenticationMiddleware

async ensure_bearer_token(connection: litestar.connection.ASGIConnection) str
exception tlc.service.authentication.TimestampSkewException(message: str, server_time: str, request_time: str, actual_skew_seconds: float, allowed_skew_seconds: float)

Bases: litestar.exceptions.PermissionDeniedException

Raised when there is a timestamp skew.

Initialize HTTPException.

Set detail and args if not provided.

Args: *args: if detail kwarg not provided, first arg should be error detail. detail: Exception details or message. Will default to args[0] if not provided. status_code: Exception HTTP status code. headers: Headers to set on the response. extra: An extra mapping to attach to the exception.

class tlc.service.authentication.TimestampHmacAuthenticationMiddleware(app: litestar.types.ASGIApp, exclude: str | list[str] | None = None, exclude_from_auth_key: str = 'exclude_from_auth', exclude_http_methods: Sequence[litestar.types.Method] | None = None, scopes: litestar.types.Scopes | None = None)

Bases: tlc.service.authentication.BearerTokenAuthenticationMiddleware

async authenticate_request(connection: litestar.connection.ASGIConnection) litestar.middleware.authentication.AuthenticationResult
class tlc.service.authentication.JwtAuthenticationMiddleware(app: litestar.types.ASGIApp, exclude: str | list[str] | None = None, exclude_from_auth_key: str = 'exclude_from_auth', exclude_http_methods: Sequence[litestar.types.Method] | None = None, scopes: litestar.types.Scopes | None = None)

Bases: tlc.service.authentication.BearerTokenAuthenticationMiddleware

async authenticate_request(connection: litestar.connection.ASGIConnection) litestar.middleware.authentication.AuthenticationResult
class tlc.service.authentication.ActivateJwtOnApiKeyMiddleware

Bases: litestar.middleware.base.ASGIMiddleware

Middleware to activate JWT on API key

async handle(scope: litestar.types.Scope, receive: litestar.types.Receive, send: litestar.types.Send, next_app: litestar.types.ASGIApp) None