Skip to content

feat: add current-user URI remapping for shared request builders - #1146

Open
Gavin Barron (gavinbarron) wants to merge 4 commits into
mainfrom
gavinbarron-me-path-remapping
Open

Gavin Barron (gavinbarron) wants to merge 4 commits into
mainfrom
gavinbarron-me-path-remapping

Conversation

@gavinbarron

@gavinbarron Gavin Barron (gavinbarron) commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

N/A (no linked issue).

Changes proposed in this pull request

  • Add the shared CoreConstants.ReplacementConstants.UserIdTokenToReplace contract and a Graph-specific URI replacement option. The default HTTP pipeline maps the reserved /users/TokenToReplace path back to /me, allowing service SDKs to reuse /users/{user-id} request builders without looking up the current user's ID.
  • Apply the same replacement when constructing batch steps, since middleware on the outer batch request cannot rewrite serialized subrequest URLs. Preserve ordinary user IDs, query values, encoded paths, authority, and existing Kiota URI-replacement customization.
  • Document custom HTTP client/adapter requirements and add direct-request, batch, path-boundary, encoding, and customization regression coverage. Stable and beta SDK follow-ups remove duplicate /me generation and depend on this support being released first.
  • Follow the repository's UTF-8 BOM encoding requirement for the new C# files. Update the pinned SDK from 10.0.202 to 10.0.404, whose patched 10.0.15 NativeAOT tooling resolves the existing NU1903 audit failure in trimming CI without suppressing vulnerability auditing.

Validation

  • Passed: dotnet format --verify-no-changes --no-restore --verbosity minimal.
  • Passed: dotnet test tests\Microsoft.Graph.DotnetCore.Core.Test\Microsoft.Graph.DotnetCore.Core.Test.csproj --framework net10.0 --no-restore --verbosity minimal (209 passed, 1 existing skipped test).
  • Passed: dotnet publish -c Release -r win-x64 /p:TreatWarningsAsErrors=true /warnaserror -f net10.0, run from tests\Microsoft.Graph.DotnetCore.Core.Trimming (including native-code generation).
  • Passed: Debug packing with dotnet pack built all five configured non-MAUI target frameworks and created the local integration package used by both service SDKs.
  • MAUI targets and the full multi-framework solution test suite were not run locally.

Other links

Microsoft Reviewers: Open in CodeFlow

Add default Graph URI replacement and batch-step remapping for the shared Me request-builder sentinel.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Update the pinned .NET SDK to 10.0.404 so trimming CI uses the patched 10.0.15 NativeAOT compiler instead of vulnerable 10.0.8 tooling.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@gavinbarron Gavin Barron (gavinbarron) changed the title Add current-user URI remapping for shared request builders feat: add current-user URI remapping for shared request builders Nov 17, 2026
The trimming job runs from its project directory, where a nested global.json overrode the root SDK pin and selected the vulnerable 10.0.8 NativeAOT compiler on CI. Update both nested pins to 10.0.404 as well.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

1 participant