Plugins: Remove pkg/infra/fs, pkg/infra/tracing and pkg/infra/process dependencies from pkg/plugins (#115798)
* remove dependency on packages * update tests * trigger
This commit is contained in:
+4
-5
@@ -13,7 +13,6 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins/auth"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||
|
||||
@@ -22,6 +21,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/api/dtos"
|
||||
"github.com/grafana/grafana/pkg/api/response"
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/auth"
|
||||
"github.com/grafana/grafana/pkg/plugins/repo"
|
||||
ac "github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
|
||||
@@ -32,7 +32,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
"github.com/grafana/grafana/pkg/web"
|
||||
)
|
||||
|
||||
@@ -355,7 +354,7 @@ func (hs *HTTPServer) getPluginAssets(c *contextmodel.ReqContext) {
|
||||
}
|
||||
|
||||
// prepend slash for cleaning relative paths
|
||||
requestedFile, err := util.CleanRelativePath(web.Params(c.Req)["*"])
|
||||
requestedFile, err := plugins.CleanRelativePath(web.Params(c.Req)["*"])
|
||||
if err != nil {
|
||||
// slash is prepended above therefore this is not expected to fail
|
||||
c.JsonApiErr(500, "Failed to clean relative file path", err)
|
||||
@@ -598,9 +597,9 @@ func mdFilepath(mdFilename string) (string, error) {
|
||||
fileExt := filepath.Ext(mdFilename)
|
||||
switch fileExt {
|
||||
case "md":
|
||||
return util.CleanRelativePath(mdFilename)
|
||||
return plugins.CleanRelativePath(mdFilename)
|
||||
case "":
|
||||
return util.CleanRelativePath(fmt.Sprintf("%s.md", mdFilename))
|
||||
return plugins.CleanRelativePath(fmt.Sprintf("%s.md", mdFilename))
|
||||
default:
|
||||
return "", ErrUnexpectedFileExtension
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user