Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
823838a8
Commit
823838a8
authored
Oct 09, 2018
by
Erik Sundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stackdriver: wip - remove debug code
parent
aa2e64e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
pkg/api/pluginproxy/ds_auth_provider.go
+5
-4
pkg/tsdb/stackdriver/test_datasource_query.go
+2
-2
No files found.
pkg/api/pluginproxy/ds_auth_provider.go
View file @
823838a8
...
...
@@ -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
)
...
...
pkg/tsdb/stackdriver/test_datasource_query.go
View file @
823838a8
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment