lomas_server.auth package
Submodules
lomas_server.auth.auth module
- class lomas_server.auth.auth.FreePassAuthenticator(*, authentication_type: Literal[AuthenticationType.FREE_PASS])[source]
Bases:
BaseModelAuthenticator that Bypass Auth.
- authentication_type: Literal[AuthenticationType.FREE_PASS]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class lomas_server.auth.auth.JWTAuthenticator(*, authentication_type: Literal[AuthenticationType.JWT], keycloak_url: HttpUrl, realm: str)[source]
Bases:
BaseModelAuthenticator that identifies users by validating the provided JWT token.
- authentication_type: Literal[AuthenticationType.JWT]
The keycloak address for this app instance.
- keycloak_url: HttpUrl
The realm name for this app instance.
- Type:
Realm
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- realm: str
- lomas_server.auth.auth.get_user_id(authenticator: Annotated[FreePassAuthenticator | JWTAuthenticator, FieldInfo(annotation=NoneType, required=True, discriminator='authentication_type')], security_scopes: SecurityScopes, auth_creds: HTTPAuthorizationCredentials) UserId[source]
Extracts user id from bearer token.
- Parameters:
security_scopes (SecurityScopes) – The required scopes for the endpoint.
auth_creds (HTTPAuthorizationCredentials) – Authorization credentials.
- Returns:
The UserId object containing user infos.
- Return type: