flux_restful.routers package

Submodules

flux_restful.routers.api module

flux_restful.routers.depends module

flux_restful.routers.depends.current_superuser(user: ~flux_restful.auth.base.Principal | None = Depends(dependency=<function current_user>, use_cache=True, scope=None)) → Principal[source]

The authenticated user, who must be a superuser.

flux_restful.routers.depends.current_user(db: ~sqlalchemy.orm.session.Session = Depends(dependency=<function get_db>, use_cache=True, scope=None), token: str | None = Depends(dependency=<fastapi.security.oauth2.OAuth2PasswordBearer object>, use_cache=True, scope=None)) → Principal | None[source]

The authenticated API user, or None when the auth backend is “none”.

flux_restful.routers.depends.current_user_views(request: ~starlette.requests.Request, db: ~sqlalchemy.orm.session.Session = Depends(dependency=<function get_db>, use_cache=True, scope=None), credentials: ~fastapi.security.http.HTTPBasicCredentials | None = Depends(dependency=<fastapi.security.http.HTTPBasic object>, use_cache=True, scope=None)) → Principal | None[source]

The authenticated web UI user, or None when the auth backend is “none”.

A bearer token (header or access_token cookie) is accepted for every backend. Password backends additionally accept HTTP Basic auth, which is what browsers use.

flux_restful.routers.depends.get_db() → Generator[source]

Get the database in a context so we can then close it.

flux_restful.routers.depends.unauthorized(detail: str, scheme: str = 'Bearer') → HTTPException[source]

flux_restful.routers.views module

Module contents