-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Port WorkloadIdentityCredential's auth flow to ClientAssertionCredential. #46285
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the WorkloadIdentityCredential
class to use ClientAssertionCredential
internally instead of the lower-level IdentityClient
and IdentitySyncClient
implementations. The change simplifies the implementation by delegating to an existing credential type while maintaining the same external API.
- Replaces direct use of
IdentityClient
/IdentitySyncClient
withClientAssertionCredential
- Introduces a private method to read federated tokens from files
- Updates constructor to build
ClientAssertionCredential
with proper configuration transfer
Comments suppressed due to low confidence (1)
sdk/identity/azure-identity/src/main/java/com/azure/identity/WorkloadIdentityCredential.java:148
- The new readFederatedTokenFromFile method lacks test coverage. This method handles file I/O and exception scenarios that should be thoroughly tested, including IOException handling and file reading edge cases.
private String readFederatedTokenFromFile(String filePath) {
sdk/identity/azure-identity/src/main/java/com/azure/identity/WorkloadIdentityCredential.java
Outdated
Show resolved
Hide resolved
sdk/identity/azure-identity/src/main/java/com/azure/identity/WorkloadIdentityCredential.java
Outdated
Show resolved
Hide resolved
sdk/identity/azure-identity/src/main/java/com/azure/identity/WorkloadIdentityCredential.java
Outdated
Show resolved
Hide resolved
1977cef
to
fbf9815
Compare
Description
Porting WorkloadIdentityCredential's auth flow to ClientAssertionCredential.
Porting Auth Flow
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines