integrate/app/authentik/models.py

43 lines
962 B
Python
Raw Normal View History

2022-03-04 18:51:33 +01:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
2022-04-29 14:56:51 +02:00
from app.consumer.baseConsumer import BaseUser
2022-03-04 18:51:33 +01:00
class UsersObjItem(BaseModel):
pk: int
username: str
name: str
is_active: bool
2022-04-22 18:34:48 +02:00
last_login: Optional[str]
2022-03-04 18:51:33 +01:00
email: str
avatar: str
attributes: Dict[str, Any]
uid: str
class GroupsObjItem(BaseModel):
pk: str
name: str
is_superuser: bool
2022-03-06 12:31:12 +01:00
parent: Optional[str]
parent_name: Optional[str]
2022-03-04 18:51:33 +01:00
users: List[int]
attributes: Dict[str, Any]
users_obj: List[UsersObjItem]
2022-04-29 14:56:51 +02:00
class User(BaseUser):
2022-03-04 18:51:33 +01:00
pk: Optional[str]
username: str
name: str
2022-03-06 15:29:00 +01:00
is_active: bool = True
2022-03-04 18:51:33 +01:00
last_login: Optional[str] = None
is_superuser: Optional[bool] = None
2022-03-06 15:29:00 +01:00
groups: List[str] = []
2022-03-04 18:51:33 +01:00
groups_obj: Optional[List[GroupsObjItem]] = None
email: str
avatar: Optional[str] = None
2022-03-06 15:29:00 +01:00
attributes: Dict[str, Any] = {}
2022-03-04 18:51:33 +01:00
uid: Optional[str] = None