mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 20:59:35 +08:00
stackdriver: add default value for authentication type
This commit is contained in:
@ -55,7 +55,7 @@ func ApplyRoute(ctx context.Context, req *http.Request, proxyPath string, route
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
authenticationType := ds.JsonData.Get("authenticationType").MustString()
|
authenticationType := ds.JsonData.Get("authenticationType").MustString("jwt")
|
||||||
if route.JwtTokenAuth != nil && authenticationType == "jwt" {
|
if route.JwtTokenAuth != nil && authenticationType == "jwt" {
|
||||||
logger.Info("authenticationType", "authenticationType", "jwt")
|
logger.Info("authenticationType", "authenticationType", "jwt")
|
||||||
if token, err := tokenProvider.getJwtAccessToken(ctx, data); err != nil {
|
if token, err := tokenProvider.getJwtAccessToken(ctx, data); err != nil {
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (e *StackdriverExecutor) executeTestDataSource(ctx context.Context, tsdbQuery *tsdb.TsdbQuery) (*tsdb.Response, error) {
|
func (e *StackdriverExecutor) executeTestDataSource(ctx context.Context, tsdbQuery *tsdb.TsdbQuery) (*tsdb.Response, error) {
|
||||||
authenticationType := e.dsInfo.JsonData.Get("authenticationType").MustString()
|
authenticationType := e.dsInfo.JsonData.Get("authenticationType").MustString("jwt")
|
||||||
if authenticationType == "gce" {
|
if authenticationType == "gce" {
|
||||||
defaultProject, err := e.getDefaultProject(ctx)
|
defaultProject, err := e.getDefaultProject(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user