mindroot.coreplugins.jwt_auth package

Submodules

mindroot.coreplugins.jwt_auth.middleware module

mindroot.coreplugins.jwt_auth.middleware.create_access_token(data: dict)[source]
mindroot.coreplugins.jwt_auth.middleware.decode_token(token: str)[source]
mindroot.coreplugins.jwt_auth.middleware.get_or_create_jwt_secret()[source]
mindroot.coreplugins.jwt_auth.middleware.is_public_route(request_path: str) bool[source]

Check if a request path matches any registered public route pattern.

async mindroot.coreplugins.jwt_auth.middleware.middleware(request: Request, call_next)[source]
mindroot.coreplugins.jwt_auth.middleware.path_matches_pattern(request_path: str, route_pattern: str) bool[source]

Check if a request path matches a route pattern with parameters.

Examples: - path_matches_pattern(‘/chat/embed/abc123’, ‘/chat/embed/{token}’) -> True - path_matches_pattern(‘/chat/widget/xyz/session’, ‘/chat/widget/{token}/session’) -> True - path_matches_pattern(‘/login’, ‘/login’) -> True

mindroot.coreplugins.jwt_auth.mod module

async mindroot.coreplugins.jwt_auth.mod.startup(app, context)[source]

mindroot.coreplugins.jwt_auth.role_checks module

mindroot.coreplugins.jwt_auth.router module

class mindroot.coreplugins.jwt_auth.router.LoginRequest(*, username: str, password: str)[source]

Bases: BaseModel

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

password: str
username: str
async mindroot.coreplugins.jwt_auth.router.protected_route(token: HTTPAuthorizationCredentials = Depends(HTTPBearer))[source]

Module contents