tool_credential.py 755 B

1234567891011121314151617
  1. from sqlalchemy import String, Text
  2. from sqlalchemy.dialects.sqlite import JSON
  3. from sqlalchemy.orm import Mapped, mapped_column
  4. from core_db import AuditMixin, Base, TenantMixin, VersionMixin
  5. from core_shared import JSONValue
  6. class ToolCredential(TenantMixin, AuditMixin, VersionMixin, Base):
  7. __tablename__ = "tool_credential"
  8. name: Mapped[str] = mapped_column(String(128))
  9. credential_type: Mapped[str] = mapped_column(String(64), default="generic")
  10. encrypted_payload_text: Mapped[str] = mapped_column(Text)
  11. secret_fingerprint: Mapped[str] = mapped_column(String(64), index=True)
  12. encryption_algorithm: Mapped[str] = mapped_column(String(64))
  13. metadata_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict)