Add Graph national cloud endpoint support#264
Open
ronanflannery wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Microsoft Graph national cloud support by introducing a centralized cloud-environment mapping and wiring the selected environment through authentication authority, Graph base URL, allowed hosts, and direct Graph requests—while keeping Global as the default.
Changes:
- Introduces
GraphCloudEnvironment/GraphCloudEndpointmapping and parsing helpers for Global/USGov/DoD/China. - Threads the selected Graph environment into MSAL-based auth providers and Graph client creation (base URL + allowed hosts).
- Updates direct Intune Graph extension requests to respect the configured
RequestAdapter.BaseUrl, and adds a test for the configured base URL behavior.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/WingetIntune.Tests/GraphExtensions/GraphServiceExtensionsTests.cs | Adds coverage ensuring configured (non-global) Graph base URLs are used. |
| src/WinTuner.Proxy.Client/WinTunerProxyClientExtensions.cs | Implements telemetry opt-out detection via an env var helper. |
| src/WingetIntune/WingetServiceCollectionExtension.cs | Uses centralized Graph endpoint constant for the default HttpClient base address. |
| src/WingetIntune/Intune/IntuneManager.cs | Uses centralized Graph endpoint constants/allowed hosts when building a Graph client. |
| src/WingetIntune/Internal/Msal/PublicClientAuth.cs | Uses selected cloud authority + host matching for MSAL public-client auth. |
| src/WingetIntune/Internal/Msal/InteractiveAuthenticationProvider.cs | Uses selected cloud authority + host matching for interactive MSAL auth. |
| src/WingetIntune/Graph/GraphServiceClientExtensions.cs | Builds direct-request URIs from the configured RequestAdapter.BaseUrl. |
| src/WingetIntune/Graph/GraphCloudEnvironment.cs | Adds environment enum + endpoint definitions and parsing/alias handling. |
| src/WingetIntune/Graph/GraphClientFactory.cs | Allows specifying Graph base URL when creating a GraphServiceClient. |
| src/Svrooij.WinTuner.CmdLets/Commands/Graph/*.cs | Uses selected environment’s Graph beta endpoint when creating Graph clients. |
| src/Svrooij.WinTuner.CmdLets/Commands/Graph/ConnectWtWinTuner.cs | Adds -Environment selection (and env var default), configures authority/scopes/allowed hosts accordingly, and validates ClientId for national-cloud interactive auth. |
| src/Svrooij.WinTuner.CmdLets/Commands/Deploy/*.cs | Uses selected environment’s Graph beta endpoint when creating Graph clients for deployment operations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Adds Microsoft Graph national cloud endpoint support to WinTuner while preserving the existing global-cloud behavior as the default.
Supported environments:
Changes
-Environmentoption toConnect-WtWinTuner, including aliases such asUSGov,GCCHigh, andDoD.WINTUNER_ENVIRONMENTenvironment variable.Validation
dotnet format WingetIntune.sln --verify-no-changesdotnet test WingetIntune.sln --configuration ReleaseRelated
Related discussion: #263