Fix msgraph/Power BI auth failure from empty allowed_hosts list#69014
Merged
dabla merged 3 commits intoJul 2, 2026
Conversation
davidnzhang
force-pushed
the
fix/msgraph-allowed-hosts-validation
branch
from
June 26, 2026 07:25
2fbbc56 to
a738dc2
Compare
davidnzhang
marked this pull request as ready for review
June 26, 2026 07:26
davidnzhang
force-pushed
the
fix/msgraph-allowed-hosts-validation
branch
from
June 27, 2026 10:48
5e90794 to
5d79dd9
Compare
dabla
approved these changes
Jun 29, 2026
davidnzhang
force-pushed
the
fix/msgraph-allowed-hosts-validation
branch
3 times, most recently
from
June 30, 2026 14:17
a1b99ea to
3d2bc0b
Compare
davidnzhang
force-pushed
the
fix/msgraph-allowed-hosts-validation
branch
from
June 30, 2026 21:46
3d2bc0b to
6a9df5a
Compare
75 tasks
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.
What
KiotaRequestAdapterHook._build_request_adapterderivesallowed_hostsfrom the connection'sextrafield and passes it toAzureIdentityAuthenticationProvider. When neitherallowed_hostsnorauthorityis configured,allowed_hostsreturned[""]rather than a true empty list.When this value eventually flows through to kiota's
AllowedHostsValidator.is_url_host_validmethod, it fails to skip validation via the early return:This PR filters out blank strings so an unconfigured connection yields
[]and correctly takes the early exit described above.Why
A recent change in the microsoft-kiota-abstractions package (microsoft/kiota-python@8755f70) fixed the
AllowedHostsValidatorto actually enforce a list of allowed hosts. Previously, it only checked whether a URL was structurally valid and ignored the configuredallowed_hostsset entirely. Theis_url_host_validmethod now correctly extracts the hostname from the URL and checks is against the allow list.This seemed to break existing Power BI connections which did not configure
allowed_hostsorauthority(which is the default for Power BI connections), as the validator receives a list with an empty string instead of a true empty list, causing requests to fail validation.Note that before the Microsoft change this was harmless, as the validator method never actually compared against the configured hosts (
return all([scheme, netloc])->True). This PR restores kiota's "skip validation" pathway for the default case where noallowed_hostsare set.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Sonnet 4.6, following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.