mindroot.coreplugins.jwt_auth package - MindRoot 9.10.0 documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# mindroot.coreplugins.jwt_auth package

## Submodules

## mindroot.coreplugins.jwt_auth.middleware module

mindroot.coreplugins.jwt_auth.middleware.create_access_token(data: dict)

mindroot.coreplugins.jwt_auth.middleware.decode_token(token: str)

mindroot.coreplugins.jwt_auth.middleware.get_or_create_jwt_secret()

mindroot.coreplugins.jwt_auth.middleware.is_public_route(request_path: str) → bool

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

async mindroot.coreplugins.jwt_auth.middleware.middleware(request: Request, call_next)

mindroot.coreplugins.jwt_auth.middleware.path_matches_pattern(request_path: str, route_pattern: str) → bool

  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)

## mindroot.coreplugins.jwt_auth.role_checks module

## mindroot.coreplugins.jwt_auth.router module

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

  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))

## Module contents