tlc.service.authentication
¶
Module Contents¶
Classes¶
Class |
Description |
---|---|
Middleware to activate JWT on API key |
Data¶
Data |
Description |
---|---|
API¶
- DEFAULT_AUTH_TOKEN_MAX_AGE = 300¶
- class 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: ASGIConnection,
- exception 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 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: ASGIConnection,
- class 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: ASGIConnection,
- class ActivateJwtOnApiKeyMiddleware¶
Bases:
litestar.middleware.base.ASGIMiddleware
Middleware to activate JWT on API key