Skip to content

Commit

Permalink
PMM-12251 Lint, small changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriCtvrtka committed Oct 9, 2023
1 parent a8a86e3 commit f3f21b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion agent/client/basic_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
3 changes: 1 addition & 2 deletions managed/services/grafana/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit f3f21b0

Please sign in to comment.