feat: support verify signature

This commit is contained in:
Yeuoly 2024-10-09 23:13:01 +08:00
parent dfaf639790
commit 2622159763
No known key found for this signature in database
GPG Key ID: A66E7E320FB19F61

View File

@ -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",