chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
60158935f4
commit
6519682885
15831 files changed
+3063428
No files matched your search
@@ -0,0 +1,79 @@
|
||||
"""Consumer-owned read contracts for credential lists and their visibility policy."""
|
||||
|
||||
from collections.abc import Mapping, Sequence
|
||||
from dataclasses import dataclass
|
||||
from typing import Protocol
|
||||
|
||||
from core.plugin.entities.plugin_daemon import CredentialType
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class ModelCredentialRecord:
|
||||
id: str
|
||||
name: str
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class DatasourceCredentialListItem:
|
||||
id: str
|
||||
name: str
|
||||
auth_type: str
|
||||
encrypted_credentials: Mapping[str, object]
|
||||
avatar_url: str | None
|
||||
is_default: bool
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class ToolCredentialRecord:
|
||||
id: str
|
||||
name: str
|
||||
provider: str
|
||||
credential_type: CredentialType
|
||||
credentials: Mapping[str, object]
|
||||
is_default: bool
|
||||
visibility: str
|
||||
created_by: str
|
||||
partial_member_ids: tuple[str, ...]
|
||||
from_other_member: bool
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class TriggerSubscriptionRecord:
|
||||
id: str
|
||||
name: str
|
||||
provider: str
|
||||
credential_type: CredentialType
|
||||
credentials: Mapping[str, object]
|
||||
endpoint_id: str
|
||||
parameters: Mapping[str, object]
|
||||
properties: Mapping[str, object]
|
||||
workflows_in_use: int
|
||||
|
||||
|
||||
class CredentialQuery(Protocol):
|
||||
"""Return loaded values; implementations own SQL and short read sessions.
|
||||
|
||||
An absent actor is reserved for trusted internal callers. Account-scoped
|
||||
callers must supply their actor ID; administrator roles do not bypass it.
|
||||
"""
|
||||
|
||||
def list_models(
|
||||
self, *, workspace_id: str, provider: str, actor_id: str | None
|
||||
) -> Sequence[ModelCredentialRecord]: ...
|
||||
|
||||
def list_datasources(
|
||||
self, *, workspace_id: str, provider: str, plugin_id: str, actor_id: str | None
|
||||
) -> Sequence[DatasourceCredentialListItem]: ...
|
||||
|
||||
def list_tools(
|
||||
self,
|
||||
*,
|
||||
workspace_id: str,
|
||||
provider: str,
|
||||
actor_id: str | None,
|
||||
include_credential_ids: Sequence[str] = (),
|
||||
) -> Sequence[ToolCredentialRecord]: ...
|
||||
|
||||
def list_trigger_subscriptions(
|
||||
self, *, workspace_id: str, provider: str, actor_id: str | None
|
||||
) -> Sequence[TriggerSubscriptionRecord]: ...
|
||||
Reference in new issue
Block a user