Skip to content

Commit

Permalink
fix: discorrectly allowing upgrade plugin to another plugin_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Oct 25, 2024
1 parent eeadb3e commit cea4cb0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/service/install_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ func UpgradePlugin(
return entities.NewErrorResponse(-400, "original and new plugin unique identifier are the same")
}

if original_plugin_unique_identifier.PluginID() != new_plugin_unique_identifier.PluginID() {
return entities.NewErrorResponse(-400, "original and new plugin id are different")
}

// uninstall the original plugin
installation, err := db.GetOne[models.PluginInstallation](
db.Equal("tenant_id", tenant_id),
Expand Down

0 comments on commit cea4cb0

Please sign in to comment.