mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 11:20:27 -06:00
stackdriver: wip - temp remove jwt token auth
This commit is contained in:
parent
b2de0d8c3e
commit
3f9ed2efaa
@ -64,11 +64,7 @@ func ApplyRoute(ctx context.Context, req *http.Request, proxyPath string, route
|
||||
// }
|
||||
|
||||
if ds.Type == "stackdriver" {
|
||||
defaultCredentials, err := google.FindDefaultCredentials(ctx, "https://www.googleapis.com/auth/monitoring.read")
|
||||
projectName := ds.JsonData.Get("defaultProject").MustString()
|
||||
if projectName == "" {
|
||||
ds.JsonData.Set("defaultProject", defaultCredentials.ProjectID)
|
||||
}
|
||||
defaultCredentials, err := google.FindDefaultCredentials(ctx, route.JwtTokenAuth.Scopes...)
|
||||
if err != nil {
|
||||
logger.Error("Failed to get default credentials", "error", err)
|
||||
} else {
|
||||
@ -76,6 +72,7 @@ func ApplyRoute(ctx context.Context, req *http.Request, proxyPath string, route
|
||||
if err != nil {
|
||||
logger.Error("Failed to get default access token", "error", err)
|
||||
} else {
|
||||
ds.JsonData.Set("defaultProject", defaultCredentials.ProjectID)
|
||||
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token.AccessToken))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user