Add bearer token authentication #11

Merged
wneessen merged 1 commit from bearer-auth into main 2023-08-02 16:13:09 +02:00
wneessen commented 2023-08-02 16:09:44 +02:00 (Migrated from github.com)

In this commit, we've added the capability to authenticate via bearer token to Meteologix's HTTP client. A new method "WithBearerToken" has been implemented, allowing a bearer token to be set in 'meteologix.go'. Additionally, in 'httpclient.go', the token is attached to the "Authorization" header for API requests. Tests asserting token setting functionality have been added in 'meteologix_test.go'. These changes open up an alternative authentication option for our API users. The bearer auth is not public yet, so there is no way for us to test this auth

In this commit, we've added the capability to authenticate via bearer token to Meteologix's HTTP client. A new method "WithBearerToken" has been implemented, allowing a bearer token to be set in 'meteologix.go'. Additionally, in 'httpclient.go', the token is attached to the "Authorization" header for API requests. Tests asserting token setting functionality have been added in 'meteologix_test.go'. These changes open up an alternative authentication option for our API users. The bearer auth is not public yet, so there is no way for us to test this auth
codecov-commenter commented 2023-08-02 16:12:45 +02:00 (Migrated from github.com)

Codecov Report

Merging #11 (a5667bb) into main (173c6eb) will decrease coverage by 0.30%.
The diff coverage is 63.63%.

Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main      #11      +/-   ##
==========================================
- Coverage   90.72%   90.42%   -0.30%     
==========================================
  Files          20       20              
  Lines        1013     1024      +11     
==========================================
+ Hits          919      926       +7     
- Misses         64       67       +3     
- Partials       30       31       +1     
Files Changed Coverage Δ
httpclient.go 71.91% <0.00%> (-3.39%) ⬇️
meteologix.go 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

## [Codecov](https://app.codecov.io/gh/wneessen/go-meteologix/pull/11?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Winni+Neessen) Report > Merging [#11](https://app.codecov.io/gh/wneessen/go-meteologix/pull/11?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Winni+Neessen) (a5667bb) into [main](https://app.codecov.io/gh/wneessen/go-meteologix/commit/173c6eb8ec6f408c003773ed8f4a74cc4a6d7216?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Winni+Neessen) (173c6eb) will **decrease** coverage by `0.30%`. > The diff coverage is `63.63%`. :exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please [install the Github App Integration](https://github.com/apps/codecov) for your organization. [Read more](https://about.codecov.io/blog/codecov-is-updating-its-github-integration/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Winni+Neessen). ```diff @@ Coverage Diff @@ ## main #11 +/- ## ========================================== - Coverage 90.72% 90.42% -0.30% ========================================== Files 20 20 Lines 1013 1024 +11 ========================================== + Hits 919 926 +7 - Misses 64 67 +3 - Partials 30 31 +1 ``` | [Files Changed](https://app.codecov.io/gh/wneessen/go-meteologix/pull/11?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Winni+Neessen) | Coverage Δ | | |---|---|---| | [httpclient.go](https://app.codecov.io/gh/wneessen/go-meteologix/pull/11?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Winni+Neessen#diff-aHR0cGNsaWVudC5nbw==) | `71.91% <0.00%> (-3.39%)` | :arrow_down: | | [meteologix.go](https://app.codecov.io/gh/wneessen/go-meteologix/pull/11?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Winni+Neessen#diff-bWV0ZW9sb2dpeC5nbw==) | `100.00% <100.00%> (ø)` | | :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Winni+Neessen)
Sign in to join this conversation.
No description provided.