fmn.api.auth module

class fmn.api.auth.Identity(*, name: str, admin: bool, expires_at: float, user_info: dict[str, Any])[source]

Bases: BaseModel

admin: bool
classmethod client() AsyncClient[source]
expires_at: float
async classmethod from_oidc_token(token: str) Identity[source]
model_config = {'extra': 'ignore'}

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

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

name: str
user_info: dict[str, Any]
class fmn.api.auth.IdentityFactory(optional=False)[source]

Bases: object

async process_oidc_auth(creds: HTTPAuthorizationCredentials | None) Identity | None[source]
exception fmn.api.auth.TokenExpired[source]

Bases: ValueError

async fmn.api.auth.get_identity_admin(identity: Identity = Depends(dependency=<fmn.api.auth.IdentityFactory object>, use_cache=True, scope=None))[source]