mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 01:18:05 +08:00
feat(trigger): enhance subscription builder management and update API
- Introduced `SubscriptionBuilderUpdater` class to streamline updates to subscription builders, encapsulating properties like name, parameters, and credentials. - Refactored API endpoints to utilize the new updater class, improving code clarity and maintainability. - Adjusted OAuth handling to create and update subscription builders more effectively, ensuring proper credential management. This change enhances the overall functionality and organization of the trigger subscription builder API.
This commit is contained in:
@ -11,7 +11,7 @@ class OAuthProxyService(BasePluginClient):
|
||||
__KEY_PREFIX__ = "oauth_proxy_context:"
|
||||
|
||||
@staticmethod
|
||||
def create_proxy_context(user_id: str, tenant_id: str, plugin_id: str, provider: str):
|
||||
def create_proxy_context(user_id: str, tenant_id: str, plugin_id: str, provider: str, extra_data: dict = {}):
|
||||
"""
|
||||
Create a proxy context for an OAuth 2.0 authorization request.
|
||||
|
||||
@ -26,6 +26,7 @@ class OAuthProxyService(BasePluginClient):
|
||||
"""
|
||||
context_id = str(uuid.uuid4())
|
||||
data = {
|
||||
**extra_data,
|
||||
"user_id": user_id,
|
||||
"plugin_id": plugin_id,
|
||||
"tenant_id": tenant_id,
|
||||
|
||||
Reference in New Issue
Block a user