Skip to content

#1028 validate region string format before use in URL construction - #1051

Open
gterminator wants to merge 2 commits into
AzureAD:devfrom
gterminator:feature/issue-1028_validate_region_format
Open

#1028 validate region string format before use in URL construction#1051
gterminator wants to merge 2 commits into
AzureAD:devfrom
gterminator:feature/issue-1028_validate_region_format

Conversation

@gterminator

Copy link
Copy Markdown
Contributor

this should fix #1028

@gterminator
gterminator requested a review from a team as a code owner July 30, 2026 00:14
@gterminator

Copy link
Copy Markdown
Contributor Author

@Avery-Dunn @bgavrilMS need a review.

@gterminator
gterminator marked this pull request as draft July 31, 2026 04:07
@gterminator
gterminator marked this pull request as ready for review July 31, 2026 04:07
gterminator added a commit to gterminator/microsoft-authentication-library-for-java that referenced this pull request Aug 3, 2026
Auto-detected regions (REGION_NAME env var, IMDS) that fail the naming
convention check now log a warning and fall back to the global endpoint
like any other failed autodetection, instead of throwing and aborting
the request. Developer-supplied regions still fail fast, but now at
Builder.azureRegion(val) instead of at first token request, so
getRegionalizedHost no longer needs to re-validate on every lookup.
…gion

Region format is now validated at Builder.azureRegion(val), failing
fast for a developer-supplied region instead of at first token request.

Auto-detected regions (REGION_NAME env var, IMDS) that fail the naming
convention check now log a warning and fall back to the global endpoint
like any other failed autodetection, instead of throwing and aborting
the request.

getRegionalizedHost no longer re-validates the region on every lookup,
since it is now guaranteed valid by the time it is used.
@gterminator
gterminator force-pushed the feature/issue-1028_validate_region_format branch from ad9ed3a to 839e367 Compare August 3, 2026 22:34
@gterminator

Copy link
Copy Markdown
Contributor Author

@bgavrilMS done.

May we can (in the future) think about how the discovery is failed. Don't like that we returning null as a business logic.

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.

Validate region string format before use in URL construction

2 participants