Fix trusted endpoint validation for token providers - #643
Closed
komal-rani522 wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
@microsoft-github-policy-service agree company="Microsoft" |
Copilot started reviewing on behalf of
Tanmaya Panda (tanmaya-panda1)
August 11, 2026 12:28
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes trusted-endpoint validation across token-provider authentication paths.
Changes:
- Validates endpoints before token use or network activity.
- Lazily resolves cloud metadata for built-in endpoints.
- Adds synchronous and asynchronous regression tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
client_base.py |
Applies validation to all AAD token providers. |
kusto_trusted_endpoints.py |
Adds deferred login-endpoint resolution. |
test_endpoint_validation.py |
Tests early rejection and trust policies. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+82
to
+86
| lambda: CloudSettings.get_cloud_info_for_cluster( | ||
| self._kusto_cluster, | ||
| self._aad_helper.token_provider._proxy_dict, | ||
| self._session if isinstance(self._session, Session) else None, | ||
| ).login_endpoint | ||
| well_known_kusto_endpoints.validate_trusted_endpoint( | ||
| self._kusto_cluster, | ||
| endpoint, | ||
| ) | ||
| ).login_endpoint, |
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.
Summary
Fixes trusted-endpoint validation for BasicTokenProvider and
CallbackTokenProvider authentication paths.
Changes
Authorization-header creation, or HTTP requests.
override-policy behavior.
Validation
Local tests could not be executed because the development machine cannot
establish the required TLS connections. GitHub Actions should run the test,
formatting, and lint checks on the pull request.