[v9.0.x] Plugins: Register management endpoints only when external managed is also false (#51817)
* Plugins: Register management endpoints only when external managed is also false (#51802)
* Only define plugin install endpoints when catalog enabled
* add external check
(cherry picked from commit 40dff288cd)
* fix test
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Will Browne <will.browne@grafana.com>
This commit is contained in:
co-authored by
Will Browne
Will Browne
parent
65f31f978c
commit
11c15f3bfa
+1
-1
@@ -325,7 +325,7 @@ func (hs *HTTPServer) registerRoutes() {
|
||||
apiRoute.Any("/plugins/:pluginId/resources/*", hs.CallResource)
|
||||
apiRoute.Get("/plugins/errors", routing.Wrap(hs.GetPluginErrorsList))
|
||||
|
||||
if hs.Cfg.PluginAdminEnabled {
|
||||
if hs.Cfg.PluginAdminEnabled && !hs.Cfg.PluginAdminExternalManageEnabled {
|
||||
apiRoute.Group("/plugins", func(pluginRoute routing.RouteRegister) {
|
||||
pluginRoute.Post("/:pluginId/install", routing.Wrap(hs.InstallPlugin))
|
||||
pluginRoute.Post("/:pluginId/uninstall", routing.Wrap(hs.UninstallPlugin))
|
||||
|
||||
Reference in New Issue
Block a user