Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrote token implementation and added official cache support #608

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

weinong
Copy link
Contributor

@weinong weinong commented Feb 23, 2025

Changes:

  1. removed adal from all interfaces and replaced with azidentity
  2. rewrote most credential flows using azidentity
  3. enabled persistent cache for supported credential flows. For details https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azidentity/TOKEN_CACHING.MD
  4. every combination of credential flow is written in its own struct
  5. added support to use PEM files for client certs
  6. added http client to allow recording and playback and go-vcr based unit tests
  7. migrated go-vcr to v4
  8. added disabling instance discovery option to all azidentiy credentials
  9. fixed a bug where authority host is not set correct in some environments

Breaking change:

  1. Previous caching implementation is removed. Now we are using caching provided by azidentity. This also means any credential flows not implemented by azidentity will not have any caching. Notably, interactive with pop, device code with legacy and ropc with pop will NOT have cache.

1. removed adal from all interfaces and replaced with azidentity
2. rewrote most credential flows using azidentity
3. enabled persistent cache for supported credential flows. For details
   https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azidentity/TOKEN_CACHING.MD
4. every combination of credential flow is written in its own struct
5. added support to use PEM files for client certs
6. added http client to allow recording and playback and go-vcr based unit tests
7. migrated go-vcr to v4
8. added disabling instance discovery option to all azidentiy credentials
9. fixed a bug where authority host is not set correct in some environments

Breaking change:
1. Previous caching implementation is removed. Now we are using caching
   provided by azidentity. This also means any credential flows not
   implemented by azidentity will not have any caching. Notably,
   interactive with pop, device code with legacy and ropc with pop will
   NOT have cache.
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 41.76471% with 693 lines in your changes missing coverage. Please review.

Project coverage is 54.41%. Comparing base (15edb67) to head (4f1f1d7).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
pkg/internal/testutils/govcrutils.go 0.00% 104 Missing ⚠️
pkg/internal/token/clientcertcredential.go 50.37% 51 Missing and 15 partials ⚠️
...nternal/token/usernamepasswordcredentialwithpop.go 0.00% 54 Missing ⚠️
pkg/internal/token/interactivebrowsercredential.go 0.00% 41 Missing ⚠️
pkg/internal/token/githubactionscredential.go 51.21% 32 Missing and 8 partials ⚠️
pkg/internal/token/execCredentialPlugin.go 11.90% 37 Missing ⚠️
pkg/internal/token/adalclientcertcredential.go 45.09% 27 Missing and 1 partial ⚠️
pkg/internal/token/clientcertcredentialwithpop.go 55.17% 23 Missing and 3 partials ⚠️
...kg/internal/token/clientsecretcredentialwithpop.go 51.85% 23 Missing and 3 partials ⚠️
pkg/internal/token/usernamepasswordcredential.go 44.68% 20 Missing and 6 partials ⚠️
... and 20 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #608      +/-   ##
==========================================
- Coverage   63.43%   54.41%   -9.03%     
==========================================
  Files          37       42       +5     
  Lines        2210     2354     +144     
==========================================
- Hits         1402     1281     -121     
- Misses        733      974     +241     
- Partials       75       99      +24     

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

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.

5 participants