feat: Gmail OAuth flow, per-user SMTP, message dedup, account disable toggle
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> Agent-Logs-Url: https://github.com/christianlouis/pop_puller_to_gmail/sessions/b77800ca-b452-4427-b0bf-63403e906916
This commit is contained in:
@@ -339,3 +339,35 @@ class ProviderPreset(BaseModel):
|
||||
|
||||
class ProviderListResponse(BaseModel):
|
||||
providers: List[ProviderPreset]
|
||||
|
||||
|
||||
# User SMTP Config Schemas
|
||||
class UserSmtpConfigBase(BaseModel):
|
||||
host: str = "smtp.gmail.com"
|
||||
port: int = Field(587, gt=0, lt=65536)
|
||||
username: str = ""
|
||||
use_tls: bool = True
|
||||
|
||||
|
||||
class UserSmtpConfigUpdate(UserSmtpConfigBase):
|
||||
password: Optional[str] = None # Only provided when changing the password
|
||||
|
||||
|
||||
class UserSmtpConfigResponse(UserSmtpConfigBase):
|
||||
id: int
|
||||
user_id: int
|
||||
has_password: bool # True if a password is stored (value is never returned)
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
# Gmail OAuth Schemas
|
||||
class GmailAuthorizeResponse(BaseModel):
|
||||
authorization_url: str
|
||||
|
||||
|
||||
class GmailCallbackRequest(BaseModel):
|
||||
code: str
|
||||
redirect_uri: str
|
||||
|
||||
Reference in New Issue
Block a user