mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 21:53:00 +08:00
dsproxy: adds support for url params for plugin routes (#23503)
* dsproxy: adds support for url params for plugin routes * docs: fixes after review * pluginproxy: rename Params to URLParams * Update pkg/plugins/app_plugin.go Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com> * Apply suggestions from code review Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com> * pluginproxy: rename struct Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
This commit is contained in:
@ -23,21 +23,33 @@ type AppPlugin struct {
|
||||
Pinned bool `json:"-"`
|
||||
}
|
||||
|
||||
// AppPluginRoute describes a plugin route that is defined in
|
||||
// the plugin.json file for a plugin.
|
||||
type AppPluginRoute struct {
|
||||
Path string `json:"path"`
|
||||
Method string `json:"method"`
|
||||
ReqRole models.RoleType `json:"reqRole"`
|
||||
Url string `json:"url"`
|
||||
Headers []AppPluginRouteHeader `json:"headers"`
|
||||
TokenAuth *JwtTokenAuth `json:"tokenAuth"`
|
||||
JwtTokenAuth *JwtTokenAuth `json:"jwtTokenAuth"`
|
||||
Path string `json:"path"`
|
||||
Method string `json:"method"`
|
||||
ReqRole models.RoleType `json:"reqRole"`
|
||||
URL string `json:"url"`
|
||||
URLParams []AppPluginRouteURLParam `json:"urlParams"`
|
||||
Headers []AppPluginRouteHeader `json:"headers"`
|
||||
TokenAuth *JwtTokenAuth `json:"tokenAuth"`
|
||||
JwtTokenAuth *JwtTokenAuth `json:"jwtTokenAuth"`
|
||||
}
|
||||
|
||||
// AppPluginRouteHeader describes an HTTP header that is forwarded with
|
||||
// the proxied request for a plugin route
|
||||
type AppPluginRouteHeader struct {
|
||||
Name string `json:"name"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
// AppPluginRouteURLParam describes query string parameters for
|
||||
// a url in a plugin route
|
||||
type AppPluginRouteURLParam struct {
|
||||
Name string `json:"name"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
// JwtTokenAuth struct is both for normal Token Auth and JWT Token Auth with
|
||||
// an uploaded JWT file.
|
||||
type JwtTokenAuth struct {
|
||||
|
Reference in New Issue
Block a user