Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /mdfarhankc_fastapi-fullauth /fastapi_fullauth /models /sqlmodel /passkey.py
| from datetime import datetime, timezone | |
| from uuid import UUID | |
| from sqlalchemy import Column, DateTime, Text | |
| from sqlmodel import Field, SQLModel | |
| from uuid_utils import uuid7 | |
| class PasskeyMixin(SQLModel): | |
| """Passkey credential table. Combine with ``table=True``: | |
| class Passkey(PasskeyMixin, table=True): | |
| pass | |
| """ | |
| __tablename__ = "fullauth_passkeys" | |
| id: UUID = Field(default_factory=uuid7, primary_key=True) | |
| user_id: UUID = Field(foreign_key="fullauth_users.id", ondelete="CASCADE", index=True) | |
| # VARCHAR(512), not Text: MySQL can't build a unique index on a TEXT column | |
| # (matches the refresh-token column and the SQLAlchemy mixin). | |
| credential_id: str = Field(unique=True, index=True, max_length=512) | |
| public_key: str = Field(sa_column=Column(Text, nullable=False)) | |
| sign_count: int = Field(default=0) | |
| device_name: str = Field(default="", max_length=200) | |
| transports: str = Field(default="") # comma-separated: "internal,hybrid" | |
| backed_up: bool = Field(default=False) | |
| created_at: datetime = Field( | |
| default_factory=lambda: datetime.now(timezone.utc), | |
| sa_column=Column(DateTime(timezone=True), nullable=False), | |
| ) | |
| last_used_at: datetime | None = Field( | |
| default=None, sa_column=Column(DateTime(timezone=True), nullable=True) | |
| ) | |
Xet Storage Details
- Size:
- 1.33 kB
- Xet hash:
- dc85499f55ab84a654b48da9123ee207549dbfda772a98a1e50699dad6b1acd9
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.