feat(sync): 首次登录后固定随机初始凭据

This commit is contained in:
2026-09-15 00:23:20 +08:00
parent 5eb9a2b106
commit e119811800
15 changed files with 220 additions and 31 deletions
+13
View File
@@ -20,6 +20,19 @@ class Refresh(DTO):
refresh_token: str = Field(min_length=32, max_length=256)
class CredentialChange(DTO):
current_password: str = Field(min_length=12, max_length=256)
username: str = Field(min_length=1, max_length=80)
password: str = Field(min_length=12, max_length=256)
@field_validator("username")
@classmethod
def username_valid(cls, value):
if value != value.strip():
raise ValueError("账户名首尾不能包含空白")
return value
class VaultCreate(DTO):
name: str = Field(min_length=1, max_length=120)