Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /mdfarhankc_fastapi-fullauth /fastapi_fullauth /models /sqlmodel /oauth.py
| from datetime import datetime, timezone | |
| from uuid import UUID | |
| from sqlalchemy import Column, DateTime, Text, UniqueConstraint | |
| from sqlmodel import Field, SQLModel | |
| from uuid_utils import uuid7 | |
| class OAuthAccountMixin(SQLModel): | |
| """OAuth-account table. Combine with ``table=True``: | |
| class OAuthAccount(OAuthAccountMixin, table=True): | |
| pass | |
| """ | |
| __tablename__ = "fullauth_oauth_accounts" | |
| __table_args__ = ( | |
| UniqueConstraint("provider", "provider_user_id", name="uq_oauth_provider_user"), | |
| ) | |
| id: UUID = Field(default_factory=uuid7, primary_key=True) | |
| provider: str = Field(max_length=50) | |
| provider_user_id: str = Field(max_length=320) | |
| user_id: UUID = Field(foreign_key="fullauth_users.id", ondelete="CASCADE") | |
| provider_email: str | None = Field(default=None, max_length=320) | |
| # Text, not the default VARCHAR(255): provider access/refresh tokens | |
| # (opaque or JWT-shaped) routinely exceed 255 chars and would silently | |
| # truncate on MySQL. Mirrors the SQLAlchemy model. | |
| access_token: str | None = Field(default=None, sa_column=Column(Text, nullable=True)) | |
| refresh_token: str | None = Field(default=None, sa_column=Column(Text, nullable=True)) | |
| expires_at: datetime | None = Field( | |
| default=None, sa_column=Column(DateTime(timezone=True), nullable=True) | |
| ) | |
| created_at: datetime = Field( | |
| default_factory=lambda: datetime.now(timezone.utc), | |
| sa_column=Column(DateTime(timezone=True), nullable=False), | |
| ) | |
Xet Storage Details
- Size:
- 1.51 kB
- Xet hash:
- d370bd7985e341d67f8fc75636c8a5cacc091ad5ce3b33e79617984a448bbe97
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.