Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

refactor: migrate verify_subscription_credentials return type to TypedDict (#34967)

Sven Weidenmann859920a81f6f
diff --git a/api/services/trigger/trigger_provider_service.py b/api/services/trigger/trigger_provider_service.py
index ae74f7a8cd2..ec39dfdaaf3 100644
--- a/api/services/trigger/trigger_provider_service.py
+++ b/api/services/trigger/trigger_provider_service.py
@@ -3,7 +3,7 @@ import logging
import time as _time
import uuid
from collections.abc import Mapping
-from typing import Any
+from typing import Any, TypedDict
from sqlalchemy import desc, func
from sqlalchemy.orm import Session, sessionmaker
@@ -42,6 +42,10 @@ from services.plugin.plugin_service import PluginService
logger = logging.getLogger(__name__)
+class VerifyCredentialsResult(TypedDict):
+ verified: bool
+
+
class TriggerProviderService:
"""Service for managing trigger providers and credentials"""
@@ -792,7 +796,7 @@ class TriggerProviderService:
provider_id: TriggerProviderID,
subscription_id: str,
credentials: dict[str, Any],
- ) -> dict[str, Any]:
+ ) -> VerifyCredentialsResult:
"""
Verify credentials for an existing subscription without updating it.