From 26221597639595f991c8e1ed3bfbd5c9bd026b1d Mon Sep 17 00:00:00 2001 From: Yeuoly Date: Wed, 9 Oct 2024 23:13:01 +0800 Subject: [PATCH] feat: support verify signature --- api/core/plugin/manager/plugin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/api/core/plugin/manager/plugin.py b/api/core/plugin/manager/plugin.py index 1fc4bc0a2c..6e11f95d91 100644 --- a/api/core/plugin/manager/plugin.py +++ b/api/core/plugin/manager/plugin.py @@ -24,12 +24,17 @@ class PluginInstallationManager(BasePluginManager): params={"page": 1, "page_size": 256}, ) - def install_from_pkg(self, tenant_id: str, pkg: bytes) -> Generator[InstallPluginMessage, None, None]: + def install_from_pkg( + self, tenant_id: str, pkg: bytes, verify_signature: bool = False + ) -> Generator[InstallPluginMessage, None, None]: """ Install a plugin from a package. """ # using multipart/form-data to encode body - body = {"dify_pkg": ("dify_pkg", pkg, "application/octet-stream")} + body = { + "dify_pkg": ("dify_pkg", pkg, "application/octet-stream"), + "verify_signature": "true" if verify_signature else "false", + } return self._request_with_plugin_daemon_response_stream( "POST",