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.

fix bug 26613: get wrong credentials with multiple authorizations plugin (#26615)

Charles Liufaaca822e441
diff --git a/api/services/tools/builtin_tools_manage_service.py b/api/services/tools/builtin_tools_manage_service.py
index 6b0b6b0f0e8..cab4a5c6abc 100644
--- a/api/services/tools/builtin_tools_manage_service.py
+++ b/api/services/tools/builtin_tools_manage_service.py
@@ -349,14 +349,10 @@ class BuiltinToolManageService:
provider_controller = ToolManager.get_builtin_provider(default_provider.provider, tenant_id)
credentials: list[ToolProviderCredentialApiEntity] = []
- encrypters = {}
for provider in providers:
- credential_type = provider.credential_type
- if credential_type not in encrypters:
- encrypters[credential_type] = BuiltinToolManageService.create_tool_encrypter(
- tenant_id, provider, provider.provider, provider_controller
- )[0]
- encrypter = encrypters[credential_type]
+ encrypter, _ = BuiltinToolManageService.create_tool_encrypter(
+ tenant_id, provider, provider.provider, provider_controller
+ )
decrypt_credential = encrypter.mask_tool_credentials(encrypter.decrypt(provider.credentials))
credential_entity = ToolTransformService.convert_builtin_provider_to_credential_entity(
provider=provider,