setting, session and profile
This commit is contained in:
parent
48eea5d201
commit
4a563f4f34
31 changed files with 1797 additions and 159 deletions
|
|
@ -16,14 +16,22 @@ class AccountRegister(BaseModel):
|
|||
first_name: str = Field(min_length=1, max_length=80)
|
||||
last_name: str = Field(min_length=1, max_length=80)
|
||||
date_of_birth: date
|
||||
phone_number: str = Field(
|
||||
min_length=7,
|
||||
max_length=24,
|
||||
pattern=r"^\+?[0-9][0-9 ()-]{5,22}[0-9]$",
|
||||
)
|
||||
country_code: str = Field(min_length=1, max_length=4, pattern=r"^\d+$")
|
||||
phone: str = Field(min_length=6, max_length=15, pattern=r"^\d+$")
|
||||
otp: str | None = Field(default=None, min_length=4, max_length=8)
|
||||
password: str = Field(min_length=8, max_length=128)
|
||||
|
||||
|
||||
class SignupOtpSendRequest(BaseModel):
|
||||
country_code: str = Field(min_length=1, max_length=4, pattern=r"^\d+$")
|
||||
phone: str = Field(min_length=6, max_length=15, pattern=r"^\d+$")
|
||||
|
||||
|
||||
class SignupOtpSendResponse(BaseModel):
|
||||
message: str
|
||||
expires_in_minutes: int
|
||||
|
||||
|
||||
class AccountRead(BaseModel):
|
||||
id: UUID
|
||||
account_type: str
|
||||
|
|
@ -32,6 +40,7 @@ class AccountRead(BaseModel):
|
|||
last_name: str
|
||||
date_of_birth: date
|
||||
phone_number: str
|
||||
profile_picture_url: str | None = None
|
||||
company_domain: str | None
|
||||
is_domain_owner: bool = False
|
||||
must_change_password: bool = False
|
||||
|
|
@ -40,9 +49,15 @@ class AccountRead(BaseModel):
|
|||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class AccountProfileUpdate(BaseModel):
|
||||
profile_picture_url: str | None = None
|
||||
|
||||
|
||||
class LoginRequest(BaseModel):
|
||||
email: EmailStr
|
||||
password: str = Field(min_length=1, max_length=128)
|
||||
otp: str | None = Field(default=None, min_length=4, max_length=8)
|
||||
challenge_token: str | None = Field(default=None, min_length=8, max_length=128)
|
||||
|
||||
|
||||
class AuthResponse(BaseModel):
|
||||
|
|
@ -51,6 +66,35 @@ class AuthResponse(BaseModel):
|
|||
account: AccountRead
|
||||
|
||||
|
||||
class LoginChallengeResponse(BaseModel):
|
||||
mfa_required: Literal[True] = True
|
||||
challenge_token: str
|
||||
phone_hint: str
|
||||
expires_in_minutes: int
|
||||
|
||||
|
||||
class LoginOtpResendRequest(BaseModel):
|
||||
challenge_token: str = Field(min_length=8, max_length=128)
|
||||
|
||||
|
||||
class LoginOtpResendResponse(BaseModel):
|
||||
phone_hint: str
|
||||
expires_in_minutes: int
|
||||
|
||||
|
||||
class AccountSecurityRead(BaseModel):
|
||||
mfa_enabled: bool
|
||||
mfa_available: bool
|
||||
session_timeout_minutes: int
|
||||
effective_session_timeout_minutes: int
|
||||
org_session_timeout_minutes: int | None = None
|
||||
|
||||
|
||||
class AccountSecurityUpdate(BaseModel):
|
||||
mfa_enabled: bool | None = None
|
||||
session_timeout_minutes: int | None = None
|
||||
|
||||
|
||||
class OrgMemberCreate(BaseModel):
|
||||
first_name: str = Field(min_length=1, max_length=80)
|
||||
last_name: str = Field(min_length=1, max_length=80)
|
||||
|
|
@ -367,7 +411,7 @@ class OrgSecuritySettingsUpdate(BaseModel):
|
|||
require_strong_passwords: bool | None = None
|
||||
require_mfa_admins: bool | None = None
|
||||
require_mfa_all_users: bool | None = None
|
||||
session_timeout_minutes: int | None = Field(default=None, ge=15, le=1440)
|
||||
session_timeout_minutes: int | None = Field(default=None, ge=60, le=129600)
|
||||
|
||||
|
||||
class OrgMemberRoleUpdate(BaseModel):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue