Skip to content

Commit

Permalink
fix: revert OAuth passthrough for non-Viya deployments and treat
Browse files Browse the repository at this point in the history
websocket scheme as-is
  • Loading branch information
amlmtl committed Dec 8, 2023
1 parent 73df97b commit 3434f08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ type SampleDatasource struct {
}

type datasourceJsonData struct {
IsViya bool `json:"isViya"`
UseInternalNetworking bool `json:"useInternalNetworking"`
OauthPassThru bool `json:"oauthPassThru"`
TlsSkipVerify bool `json:"tlsSkipVerify"`
Expand All @@ -117,7 +118,7 @@ func (d *SampleDatasource) QueryData(ctx context.Context, req *backend.QueryData
return nil, err
}
var authorizationHeaderPtr *string = nil
if jsonData.OauthPassThru {
if jsonData.OauthPassThru && jsonData.IsViya {
authorizationHeader := req.GetHTTPHeader(backend.OAuthIdentityTokenHeaderName)
authorizationHeaderPtr = &authorizationHeader
}
Expand Down Expand Up @@ -162,7 +163,6 @@ func (d *SampleDatasource) query(_ context.Context, datasourceUid string, qdto q
return handleQueryError("invalid server URL", err)
}
serverUrl := s.GetUrl()
serverUrl.Scheme = "wss"

q := query.New(serverUrl, qdto.ProjectName, qdto.CqName, qdto.WindowName, qdto.Interval, qdto.MaxDataPoints, qdto.Fields, authorizationHeader)

Expand Down

0 comments on commit 3434f08

Please sign in to comment.