Files
MoviePilot/app/schemas/mfa.py
InfinityPacer 5c70757a81 fix(auth): align v3 authentication contracts
按已确认的 V3 AUTH-001 交付门禁合并:后端认证与用户资料契约已完成本地前后端联调,Architecture、Coverage、单测分片和 Pylint 全部通过。
2026-08-31 04:57:34 +08:00

37 lines
941 B
Python

"""多因素认证 API 输出模型。"""
from typing import Optional
from pydantic import BaseModel, Field, RootModel
from app.schemas.common import JsonData
class PasskeyOptions(RootModel[dict[str, JsonData]]):
"""浏览器 WebAuthn API 使用的动态选项。"""
class OtpGenerateData(BaseModel):
"""OTP 绑定密钥和验证 URI。"""
secret: str = Field(description="OTP 密钥")
uri: str = Field(description="OTP 验证 URI")
class PasskeyStartData(BaseModel):
"""PassKey 注册或认证的启动数据。"""
options: PasskeyOptions = Field(description="WebAuthn 选项")
transaction_token: str = Field(description="一次性事务令牌")
class PasskeyInfo(BaseModel):
"""当前用户绑定的 PassKey 摘要。"""
id: int
name: str
created_at: Optional[str] = None
last_used_at: Optional[str] = None
aaguid: Optional[str] = None
transports: Optional[str] = None