Skip to content

Commit

Permalink
ACM-12794: forward auth header to datasource
Browse files Browse the repository at this point in the history
This allows rbac-query-proxy to authentication against obs-api. This is
needed as Grafana no longer automatically forwards the header (and for
now only does so in our patched Grafana version).

Signed-off-by: Jacob Baungard Hansen <[email protected]>
  • Loading branch information
jacobbaungard committed Aug 21, 2024
1 parent c088a5a commit 19274a7
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ type JsonData struct {
TLSAuth bool `yaml:"tlsAuth,omitempty"`
TLSAuthCA bool `yaml:"tlsAuthWithCACert,omitempty"`
// Timeout is the request timeout in seconds for an HTTP datasource.
Timeout string `yaml:"timeout,omitempty"`
HttpMethod string `yaml:"httpMethod,omitempty"`
TimeInterval string `yaml:"timeInterval,omitempty"`
CustomQueryParameters string `yaml:"customQueryParameters,omitempty"`
Timeout string `yaml:"timeout,omitempty"`
HttpMethod string `yaml:"httpMethod,omitempty"`
TimeInterval string `yaml:"timeInterval,omitempty"`
CustomQueryParameters string `yaml:"customQueryParameters,omitempty"`
ForwardHeaders []string `yaml:"forwardHeaders,omitempty"`
}

type SecureJsonData struct {
Expand Down Expand Up @@ -104,6 +105,7 @@ func GenerateGrafanaDataSource(
Timeout: "300",
CustomQueryParameters: "max_source_resolution=auto",
TimeInterval: fmt.Sprintf("%ds", mco.Spec.ObservabilityAddonSpec.Interval),
ForwardHeaders: []string{"X-Forwarded-Access-Token", "X-Forwarded-User"},
},
},
{
Expand All @@ -120,6 +122,7 @@ func GenerateGrafanaDataSource(
Timeout: "300",
CustomQueryParameters: "max_source_resolution=auto",
TimeInterval: fmt.Sprintf("%ds", DynamicTimeInterval),
ForwardHeaders: []string{"X-Forwarded-Access-Token", "X-Forwarded-User"},
},
},
},
Expand Down

0 comments on commit 19274a7

Please sign in to comment.