mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 03:11:01 -06:00
stackdriver: wip - remove debug code
This commit is contained in:
parent
aa2e64e160
commit
823838a839
@ -55,9 +55,9 @@ func ApplyRoute(ctx context.Context, req *http.Request, proxyPath string, route
|
||||
}
|
||||
}
|
||||
|
||||
gceAutoAuthentication := ds.JsonData.Get("gceAutomaticAuthentication").MustBool()
|
||||
logger.Info("gceAutoAuthentication", "gceAutoAuthentication", gceAutoAuthentication)
|
||||
if route.JwtTokenAuth != nil && !gceAutoAuthentication {
|
||||
authenticationType := ds.JsonData.Get("authenticationType").MustString()
|
||||
if route.JwtTokenAuth != nil && authenticationType == "jwt" {
|
||||
logger.Info("authenticationType", "authenticationType", "jwt")
|
||||
if token, err := tokenProvider.getJwtAccessToken(ctx, data); err != nil {
|
||||
logger.Error("Failed to get access token", "error", err)
|
||||
} else {
|
||||
@ -65,7 +65,8 @@ func ApplyRoute(ctx context.Context, req *http.Request, proxyPath string, route
|
||||
}
|
||||
}
|
||||
|
||||
if gceAutoAuthentication && route.JwtTokenAuth == nil {
|
||||
if authenticationType == "gce" {
|
||||
logger.Info("authenticationType", "authenticationType", "gce")
|
||||
tokenSrc, err := google.DefaultTokenSource(ctx, route.JwtTokenAuth.Scopes...)
|
||||
if err != nil {
|
||||
logger.Error("Failed to get default token from meta data server", "error", err)
|
||||
|
@ -17,8 +17,8 @@ import (
|
||||
)
|
||||
|
||||
func (e *StackdriverExecutor) executeTestDataSource(ctx context.Context, tsdbQuery *tsdb.TsdbQuery) (*tsdb.Response, error) {
|
||||
gceAutomaticAuthentication := e.dsInfo.JsonData.Get("gceAutomaticAuthentication").MustBool()
|
||||
if gceAutomaticAuthentication {
|
||||
authenticationType := e.dsInfo.JsonData.Get("authenticationType").MustString()
|
||||
if authenticationType == "gce" {
|
||||
defaultProject, err := e.getDefaultProject(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user