Skip to content

Commit

Permalink
fix: authenticate with X-Bearer header
Browse files Browse the repository at this point in the history
  • Loading branch information
robinmuhia committed Jul 19, 2024
1 parent 3955926 commit b98358a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 26 deletions.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (s *client) MakeRequest(ctx context.Context, method, path string, queryPara
request.Header.Set("Content-Type", "application/json")

if authorised {
request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", s.accessToken))
request.Header.Set("Authorization", fmt.Sprintf("X-Bearer %s", s.accessToken))
}

if queryParams != nil {
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require (
github.com/brianvoe/gofakeit v3.18.0+incompatible
github.com/jarcoal/httpmock v1.2.0
github.com/mitchellh/mapstructure v1.5.0
github.com/savannahghi/authutils v0.0.12
github.com/savannahghi/serverutils v0.0.7
github.com/sirupsen/logrus v1.9.0
)
Expand Down Expand Up @@ -44,15 +45,13 @@ require (
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.9 // indirect
github.com/jstemmer/go-junit-report v0.9.1 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/lithammer/shortuuid v3.0.0+incompatible // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/savannahghi/authutils v0.0.12 // indirect
github.com/savannahghi/enumutils v0.0.3 // indirect
github.com/savannahghi/errorcodeutil v0.0.5 // indirect
github.com/savannahghi/firebasetools v0.0.19 // indirect
Expand All @@ -65,7 +64,6 @@ require (
go.opentelemetry.io/otel/exporters/jaeger v1.0.0-RC1 // indirect
go.opentelemetry.io/otel/sdk v1.0.0-RC1 // indirect
go.opentelemetry.io/otel/trace v1.0.0-RC1 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
Expand Down
Loading

0 comments on commit b98358a

Please sign in to comment.