Skip to content

jam.ext.litestar.plugins

plugins

Classes:

Name Description
BasePlugin

Base Litestar plugin.

JWTPlugin

JWT plugin for litestar.

OAuth2Plugin

OAuth2 plugin for litestar.

PASETOPlugin

PASETO plugin for litestar.

SessionPlugin

Sessions plugin for litestar.

BasePlugin

BasePlugin(
    config: dict[str, Any] | str | None = None,
    pointer: str = GENERIC_POINTER,
    cookie_name: str | None = None,
    header_name: str | None = None,
    bearer: bool = False,
    middleware: bool = True,
    user: type[BaseUser] | None = None,
    **kwargs,
)

Bases: InitPlugin

Base Litestar plugin.

Parameters:

Name Type Description Default
config dict[str, Any] | str | None

Jam config as path/to/file or dict.

None
pointer str

Config pointer

GENERIC_POINTER
cookie_name str | None

Cookie name to read token

None
header_name str | None

Header name to read token

None
bearer bool

Use bearer prefix for token (e.g. "Bearer ")

False
middleware bool

Use middleware?

True
user type[BaseUser]

User for request state. See: DOCUMENTATION

None
**kwargs

Config arguments if config=None

{}

JWTPlugin

JWTPlugin(
    config: dict[str, Any] | str | None = None,
    pointer: str = GENERIC_POINTER,
    cookie_name: str | None = None,
    header_name: str | None = None,
    middleware: bool = True,
    bearer: bool = False,
    use_list: bool = False,
    user: type[BaseUser] | None = None,
    **kwargs,
)

Bases: BasePlugin

JWT plugin for litestar.

Parameters:

Name Type Description Default
config dict[str, Any] | str | None

Jam config as path/to/file or dict.

None
pointer str

Config pointer

GENERIC_POINTER
cookie_name str | None

Cookie name to read token

None
header_name str | None

Header name to read token

None
middleware bool

Use middleware?

True
bearer bool

Use bearer prefix for token (e.g. "Bearer ")

False
use_list bool

Use token list for authentication?

False
user type[BaseUser]

User for request state. See: DOCUMENTATION

None
**kwargs

Config arguments if config=None

{}

OAuth2Plugin

OAuth2Plugin(
    config: str | dict[str, Any] | None = None,
    pointer: str = GENERIC_POINTER,
    **kwargs,
)

Bases: BasePlugin

OAuth2 plugin for litestar.

Parameters:

Name Type Description Default
config dict[str, Any] | str | None

Jam config as path/to/file or dict.

None
pointer str

Config pointer

GENERIC_POINTER
**kwargs

Config arguments if config=None

{}

PASETOPlugin

PASETOPlugin(
    config: dict[str, Any] | str | None = None,
    pointer: str = GENERIC_POINTER,
    cookie_name: str | None = None,
    header_name: str | None = None,
    bearer: bool = False,
    middleware: bool = True,
    user: type[BaseUser] | None = None,
    **kwargs,
)

Bases: BasePlugin

PASETO plugin for litestar.

SessionPlugin

SessionPlugin(
    config: dict[str, Any] | str | None = None,
    pointer: str = GENERIC_POINTER,
    cookie_name: str | None = None,
    header_name: str | None = None,
    bearer: bool = False,
    middleware: bool = True,
    user: type[BaseUser] | None = None,
    **kwargs,
)

Bases: BasePlugin

Sessions plugin for litestar.