tlc.service.authentication
¶
Module Contents¶
Classes¶
Class |
Description |
---|---|
Middleware to activate JWT on API key |
Data¶
Data |
Description |
---|---|
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
- 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
andargs
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 ¶