diff --git a/agent/client/basic_auth.go b/agent/client/basic_auth.go index 5055250fc9..ae822e264b 100644 --- a/agent/client/basic_auth.go +++ b/agent/client/basic_auth.go @@ -31,7 +31,7 @@ func (b *basicAuth) GetRequestMetadata(ctx context.Context, uri ...string) (map[ auth := b.username + ":" + b.password enc := base64.StdEncoding.EncodeToString([]byte(auth)) return map[string]string{ - "authorization": "Basic " + enc, + "Authorization": "Basic " + enc, }, nil } diff --git a/managed/services/grafana/client.go b/managed/services/grafana/client.go index d3d67e162b..a3d5b2883d 100644 --- a/managed/services/grafana/client.go +++ b/managed/services/grafana/client.go @@ -302,7 +302,7 @@ func (c *Client) proceedTokenAuth(ctx context.Context, authHeaders http.Header) return none, false } - if strings.HasPrefix(string(token), "glsa_") { + if strings.HasPrefix(token, "glsa_") { role, err := c.getRoleForServiceToken(ctx, authHeaders) if err != nil { return none, false @@ -354,7 +354,6 @@ func (c *Client) getRoleForAPIKey(ctx context.Context, authHeaders http.Header) func (c *Client) getRoleForServiceToken(ctx context.Context, authHeaders http.Header) (role, error) { var k map[string]interface{} - fmt.Println(authHeaders) if err := c.do(ctx, http.MethodGet, "/api/auth/serviceaccount", "", authHeaders, nil, &k); err != nil { return none, err }