diff --git a/api/services/plugin/plugin_service.py b/api/services/plugin/plugin_service.py index 7fe9379e7c..8bdbd21249 100644 --- a/api/services/plugin/plugin_service.py +++ b/api/services/plugin/plugin_service.py @@ -351,6 +351,10 @@ class PluginService: @staticmethod def install_from_local_pkg(tenant_id: str, plugin_unique_identifiers: Sequence[str]): manager = PluginInstaller() + for plugin_unique_identifier in plugin_unique_identifiers: + resp = manager.decode_plugin_from_identifier(tenant_id, plugin_unique_identifier) + PluginService._check_plugin_installation_availability(resp.verification) + return manager.install_from_identifiers( tenant_id, plugin_unique_identifiers, @@ -365,6 +369,8 @@ class PluginService: returns plugin_unique_identifier """ manager = PluginInstaller() + plugin_decode_response = manager.decode_plugin_from_identifier(tenant_id, plugin_unique_identifier) + PluginService._check_plugin_installation_availability(plugin_decode_response.verification) return manager.install_from_identifiers( tenant_id, [plugin_unique_identifier], @@ -421,6 +427,9 @@ class PluginService: for plugin_unique_identifier in plugin_unique_identifiers: try: manager.fetch_plugin_manifest(tenant_id, plugin_unique_identifier) + plugin_decode_response = manager.decode_plugin_from_identifier(tenant_id, plugin_unique_identifier) + # check if the plugin is available to install + PluginService._check_plugin_installation_availability(plugin_decode_response.verification) # already downloaded, skip except Exception: # plugin not installed, download and upload pkg