dify/api/services/entities/data_source_api_key_auth_entities.py
Byron.wang 891627b210
refactor(api): decouple data source API key auth flow (#40452)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-18 04:30:17 +00:00

31 lines
713 B
Python

"""Framework- and persistence-independent contracts for data-source API-key auth."""
from collections.abc import Mapping
from dataclasses import dataclass
from datetime import datetime
from typing import Any
@dataclass(frozen=True, slots=True)
class DataSourceApiKeyAuthCredentials:
auth_type: str
api_key: str
options: Mapping[str, Any]
@dataclass(frozen=True, slots=True)
class DataSourceApiKeyAuthBindingCreate:
category: str
provider: str
credentials: DataSourceApiKeyAuthCredentials
@dataclass(frozen=True, slots=True)
class DataSourceApiKeyAuthBindingRecord:
id: str
category: str
provider: str
disabled: bool
created_at: datetime
updated_at: datetime