mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* svg fun * #50597: add proto * #50597: add sanitizer methods * #50597: add provider * #50597: use sanitizer * #50597: use sanitizer * update grafana to match new api * add comments * add capability check * add timing * update sanitize path * improve log message * strings.HasPrefix rather than filepath.IsAbs * filepath.Clean + filepath.ToSlash for windows * read 404 * remove `path.clean` from `getPathAndScope` * add resp body close * remove unneeded prop * Update pkg/services/rendering/rendering.go Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * remove test files * filepath.ToSlash correct wrapping * filepath.ToSlash correct wrapping * filepath.ToSlash comment * compilation error * lint fix * fix error message * Update pkg/services/rendering/rendering.go Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * add `image/svg+xml` mime type * refactored log * refactored log Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
24 lines
484 B
Go
24 lines
484 B
Go
package sanitizer
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
|
|
"github.com/grafana/grafana/pkg/services/rendering"
|
|
)
|
|
|
|
// workaround for cyclic dep between the store and the renderer
|
|
|
|
type Provider struct{}
|
|
|
|
var SanitizeSVG = func(ctx context.Context, req *rendering.SanitizeSVGRequest) (*rendering.SanitizeSVGResponse, error) {
|
|
return nil, errors.New("not implemented")
|
|
}
|
|
|
|
func ProvideService(
|
|
renderer rendering.Service,
|
|
) *Provider {
|
|
SanitizeSVG = renderer.SanitizeSVG
|
|
return &Provider{}
|
|
}
|