[Identity] Implement binding mode support in WorkloadIdentityCredential - #43287
Merged
Conversation
pvaneck
force-pushed
the
identity-aks-fic
branch
from
October 16, 2025 03:32
dcc57a2 to
a571b18
Compare
Contributor
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
pvaneck
force-pushed
the
identity-aks-fic
branch
from
October 21, 2025 01:53
a571b18 to
fc51678
Compare
- Implement a new http.client transport that will leverage Proxy, CA, SNI settings. Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
pvaneck
force-pushed
the
identity-aks-fic
branch
from
October 29, 2025 02:44
fc51678 to
8cb2eb9
Compare
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
pvaneck
force-pushed
the
identity-aks-fic
branch
from
October 29, 2025 02:50
8cb2eb9 to
747f53d
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds token proxy support to WorkloadIdentityCredential for both synchronous and asynchronous implementations. The changes enable the credential to use a token proxy server for acquiring tokens in Kubernetes environments with custom network configurations.
Key Changes:
- Added
use_token_proxyparameter toWorkloadIdentityCredentialin both sync and async versions - Implemented custom transport classes (
HttpClientTransportandWorkloadIdentityAioHttpTransport) with support for SNI, CA certificates, and proxy endpoints - Added
TokenBindingTransportMixinto provide shared functionality for URL validation, CA file tracking, and proxy URL handling - Added comprehensive test coverage including unit tests, integration tests with a local test server, and test utilities
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
sdk/identity/azure-identity/azure/identity/_credentials/workload_identity.py |
Added token proxy support to sync WorkloadIdentityCredential |
sdk/identity/azure-identity/azure/identity/aio/_credentials/workload_identity.py |
Added token proxy support to async WorkloadIdentityCredential with custom AioHttpTransport |
sdk/identity/azure-identity/azure/identity/_internal/http_client_transport.py |
New sync HTTP transport implementation using http.client |
sdk/identity/azure-identity/azure/identity/_internal/token_binding_transport_mixin.py |
New mixin providing shared transport functionality for URL validation, CA file tracking, and proxy handling |
sdk/identity/azure-identity/azure/identity/_constants.py |
Added environment variable constants for Kubernetes token proxy configuration |
sdk/identity/azure-identity/tests/test_workload_identity_credential.py |
Added comprehensive test cases for sync token proxy functionality |
sdk/identity/azure-identity/tests/test_workload_identity_credential_async.py |
Added comprehensive test cases for async token proxy functionality |
sdk/identity/azure-identity/tests/test_http_client_transport.py |
Added test coverage for sync HTTP client transport |
sdk/identity/azure-identity/tests/proxy_server.py |
Added test server utility for integration testing |
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
pvaneck
force-pushed
the
identity-aks-fic
branch
from
October 30, 2025 03:17
d78062a to
23824fa
Compare
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
pvaneck
marked this pull request as ready for review
October 31, 2025 22:38
pvaneck
requested review from
KarishmaGhiya,
anannya03,
g2vinay,
joshfree,
maorleger and
minhanh-phan
October 31, 2025 22:38
chlowell
reviewed
Nov 3, 2025
xiangyan99
reviewed
Nov 4, 2025
Member
Author
|
Successfully validated these changes in an actual AKS cluster with token binding enabled. |
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
chlowell
reviewed
Nov 4, 2025
chlowell
approved these changes
Nov 6, 2025
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
xiangyan99
approved these changes
Nov 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding support for AKS custom token endpoint proxies in WorkloadIdentityCredential. In this binding mode, an internal Kubernetes endpoint is used for token requests.
✔ Validated these changes in an actual AKS cluster with token binding enabled.
This is enabled with the
use_token_proxy=Truekeyword argument inWorkloadIdentityCredential. This argument is not honored throughDefaultAzureCredential.Closes: https://github.com/Azure/azure-sdk-for-python-pr/issues/904