Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /mdfarhankc_fastapi-fullauth /fastapi_fullauth /models /sqlalchemy /passkey.py
| from datetime import datetime, timezone | |
| from uuid import UUID | |
| from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, String, Text, Uuid | |
| from sqlalchemy.orm import Mapped, mapped_column | |
| from uuid_utils import uuid7 | |
| class PasskeyMixin: | |
| """Passkey credential table. Combine with your DeclarativeBase: | |
| class Passkey(PasskeyMixin, Base): | |
| pass | |
| """ | |
| __tablename__ = "fullauth_passkeys" | |
| id: Mapped[UUID] = mapped_column(Uuid, primary_key=True, default=uuid7) | |
| user_id: Mapped[UUID] = mapped_column( | |
| Uuid, ForeignKey("fullauth_users.id", ondelete="CASCADE"), index=True, nullable=False | |
| ) | |
| # String(512), not Text: MySQL (and Tortoise) cannot build a unique index on | |
| # a TEXT column. 512 matches the refresh-token column width. | |
| credential_id: Mapped[str] = mapped_column(String(512), unique=True, index=True, nullable=False) | |
| public_key: Mapped[str] = mapped_column(Text, nullable=False) | |
| sign_count: Mapped[int] = mapped_column(Integer, default=0) | |
| device_name: Mapped[str] = mapped_column(String(200), default="") | |
| transports: Mapped[str] = mapped_column(String(200), default="") | |
| backed_up: Mapped[bool] = mapped_column(Boolean, default=False) | |
| created_at: Mapped[datetime] = mapped_column( | |
| DateTime(timezone=True), default=lambda: datetime.now(timezone.utc) | |
| ) | |
| last_used_at: Mapped[datetime | None] = mapped_column( | |
| DateTime(timezone=True), nullable=True, default=None | |
| ) | |
Xet Storage Details
- Size:
- 1.48 kB
- Xet hash:
- 7aa3b8971801994486acf0d5bae5ffbea1f82abb87135522b6d10224c72dda11
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.