lomas_server.auth package
Submodules
lomas_server.auth.auth module
- class lomas_server.auth.auth.FreePassAuthenticator[source]
Bases:
UserAuthenticatorAuthenticator class that simply extracts user information from.
the provided bearer. ! No verification is performed!
- get_user_id(security_scopes: SecurityScopes, auth_creds: HTTPAuthorizationCredentials) UserId[source]
Parses the HTTP bearer token as a json string to construct a UserId.
!Does NOT perform any verification!
- Parameters:
security_scopes (SecurityScopes) – The required scopes for the endpoint.
auth_creds (HTTPAuthorizationCredentials) – Authorization credentials.
- Returns:
The parsed UserId.
- Return type:
- class lomas_server.auth.auth.JWTAuthenticator(keycloak_url: HttpUrl, realm: str)[source]
Bases:
UserAuthenticatorAuthenticator class that identifies users by validating the provided JWT token.
- get_user_id(security_scopes: SecurityScopes, auth_creds: HTTPAuthorizationCredentials) UserId[source]
Parses the JWT bearer token to construct a UserId.
The JWT is verified against the certificates provided by the Id Provider.
! Does not verify scopes yet !
- Parameters:
security_scopes (SecurityScopes) – The required scopes for the endpoint.
auth_creds (HTTPAuthorizationCredentials) – Authorization credentials.
- Returns:
The parsed UserId.
- Return type:
- class lomas_server.auth.auth.UserAuthenticator[source]
Bases:
ABCAbstract base class for providing user authentification methods.
- abstract get_user_id(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: