mirror of
https://github.com/ae-utbm/sith.git
synced 2025-11-02 18:13:05 +00:00
24 lines
528 B
Python
24 lines
528 B
Python
from ninja import ModelSchema, Schema
|
|
from pydantic import Field, HttpUrl
|
|
|
|
from api.models import ApiClient
|
|
from core.schemas import SimpleUserSchema
|
|
|
|
|
|
class ApiClientSchema(ModelSchema):
|
|
class Meta:
|
|
model = ApiClient
|
|
fields = ["id", "name"]
|
|
|
|
owner: SimpleUserSchema
|
|
permissions: list[str] = Field(alias="all_permissions")
|
|
|
|
|
|
class ThirdPartyAuthParamsSchema(Schema):
|
|
client_id: int
|
|
third_party_app: str
|
|
privacy_link: HttpUrl
|
|
username: str
|
|
callback_url: HttpUrl
|
|
signature: str
|