Adds signed in user to backend v2 plugins requests (#22584)

closes #12043
This commit is contained in:
Carl Bergquist
2020-03-06 14:37:36 +01:00
committed by GitHub
parent c73a0007c7
commit 1dcfaf25fc
7 changed files with 42 additions and 8 deletions

View File

@ -5,6 +5,7 @@ import (
"time"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana-plugin-sdk-go/genproto/pluginv2"
)
@ -37,8 +38,9 @@ func (hs HealthStatus) String() string {
// CheckHealthResult check health result.
type CheckHealthResult struct {
Status HealthStatus
Message string
Status HealthStatus
Message string
JSONDetails string
}
func checkHealthResultFromProto(protoResp *pluginv2.CheckHealth_Response) *CheckHealthResult {
@ -51,8 +53,9 @@ func checkHealthResultFromProto(protoResp *pluginv2.CheckHealth_Response) *Check
}
return &CheckHealthResult{
Status: status,
Message: protoResp.Message,
Status: status,
Message: protoResp.Message,
JSONDetails: protoResp.JsonDetails,
}
}
@ -83,6 +86,7 @@ type CallResourceRequest struct {
URL string
Headers map[string][]string
Body []byte
User *models.SignedInUser
}
// CallResourceResult call resource result.