Skip to content

Added config.NewAzureCliTokenSource and config.NewAzureMsiTokenSource constructors#727

Merged
nfx merged 1 commit intomainfrom
expose/aad-token-sources
Dec 4, 2023
Merged

Added config.NewAzureCliTokenSource and config.NewAzureMsiTokenSource constructors#727
nfx merged 1 commit intomainfrom
expose/aad-token-sources

Conversation

@nfx
Copy link
Copy Markdown
Contributor

@nfx nfx commented Dec 1, 2023

Changes

This PR exposes Azure CLI and Azure MSI token sources, that can be used externally to authenticate to services like Azure Resource Manager and Microsoft Graph, but still staying within the same testing ecosystem and without any extra dependencies.

Tests

  • make test passing
  • make fmt applied
  • relevant integration tests applied

…rce` helpers

This PR exposes Azure CLI and Azure MSI token sources, that can be used externally to authenticate to services like Azure Resource Manager and Microsoft Graph, but still staying within the same testing ecosystem and without any extra dependences.
@nfx nfx requested a review from mgyucht December 1, 2023 20:04
@nfx nfx enabled auto-merge December 1, 2023 20:06
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (82d089a) 17.57% compared to head (fe55e62) 17.58%.

Files Patch % Lines
config/auth_azure_cli.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #727   +/-   ##
=======================================
  Coverage   17.57%   17.58%           
=======================================
  Files         103      103           
  Lines       14188    14191    +3     
=======================================
+ Hits         2494     2495    +1     
- Misses      11489    11491    +2     
  Partials      205      205           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nfx nfx added this pull request to the merge queue Dec 4, 2023
Merged via the queue into main with commit 964cdc1 Dec 4, 2023
@nfx nfx deleted the expose/aad-token-sources branch December 4, 2023 07:54
mgyucht added a commit that referenced this pull request Dec 7, 2023
This is a bugfix release, including a fix correcting issues with OAuth flows, due to a bug with the propagation of the response status in `httpclient`'s `RoundTrip()` implementation. This fixes the `failed during request visitor: token: oauth2: cannot fetch token: Response: {...}` error.

All fixes:

* Migrate Azure MSI & Metadata Service token sources to `httpclient` and add 100% test coverage ([#709](#709)).
* Added `config.NewAzureCliTokenSource` and `config.NewAzureMsiTokenSource` constructors ([#727](#727)).
* Use per-config refresh context for OAuth tokens ([#728](#728)).
@mgyucht mgyucht mentioned this pull request Dec 7, 2023
github-merge-queue bot pushed a commit that referenced this pull request Dec 7, 2023
This is a bugfix release, including a fix correcting issues with OAuth
flows, due to a bug with the propagation of the response status in
`httpclient`'s `RoundTrip()` implementation. This fixes the `failed
during request visitor: token: oauth2: cannot fetch token: Response:
{...}` error.

All fixes:

* Migrate Azure MSI & Metadata Service token sources to `httpclient` and
add 100% test coverage
([#709](#709)).
* Added `config.NewAzureCliTokenSource` and
`config.NewAzureMsiTokenSource` constructors
([#727](#727)).
* Use per-config refresh context for OAuth tokens
([#728](#728)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants