import uuid from sqlalchemy import String, Text, UniqueConstraint from sqlalchemy.orm import Mapped, mapped_column from app.models.base import Base, TimestampMixin, UUIDMixin class Secret(Base, UUIDMixin, TimestampMixin): __tablename__ = "secret" __table_args__ = ( UniqueConstraint("scope_type", "scope_id", "key"), ) scope_type: Mapped[str] = mapped_column(String(50)) scope_id: Mapped[uuid.UUID] = mapped_column(index=True) key: Mapped[str] = mapped_column(String(255)) encrypted_value: Mapped[str] = mapped_column(Text)