Skip to content

Fix permissions for path-addressed drive items - #1919

Merged
waldekmastykarz merged 1 commit into
dotnet:mainfrom
waldekmastykarz:investigate-issue-1918
Oct 10, 2026
Merged

waldekmastykarz merged 1 commit into
dotnet:mainfrom
waldekmastykarz:investigate-issue-1918

Conversation

@waldekmastykarz

Copy link
Copy Markdown
Collaborator

Summary

  • canonicalize Microsoft Graph drive item path addressing to equivalent ID-addressed routes before querying the permissions service
  • support root-relative, item-relative, and special-folder paths across Graph drive namespaces
  • normalize the /drive alias to /me/drive and preserve operation suffixes
  • cover direct and batch requests, special characters, and unchanged non-path URLs

Why

The permissions service resolves ID-addressed drive item routes reliably, while concrete root:/path:/... routes and Dev Proxy's previous root:<value>/... form fail. Canonicalizing at the permissions boundary avoids changing the shared URL sanitizer and also handles other path-addressed drive item APIs beyond the upload reported in #1918.

Tests

dotnet test DevProxy.Integration.Tests/DevProxy.Integration.Tests.csproj --filter FullyQualifiedName~GraphUtilsTests --no-restore --verbosity minimal --maxcpucount:1 -p:RunPostBuildEvent=Never -p:UseSharedCompilation=false

Closes #1918

Canonicalize Graph drive item paths to their equivalent ID-addressed routes before querying the permissions service. Closes dotnet#1918.

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

Copilot-Session: 8a9b0692-9775-4433-b9b0-b65f1d6ff25c
Copilot AI balanced review requested due to automatic review settings October 10, 2026 06:49
@waldekmastykarz
waldekmastykarz requested a review from a team as a code owner October 10, 2026 06:49
@waldekmastykarz waldekmastykarz added the pr-bugfix Fixes a bug label Oct 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation matches the stated requirements and includes comprehensive coverage of the affected URL forms.

0 open findings

What changed in this PR

Canonicalizes path-addressed Microsoft Graph drive-item URLs before permission lookup.

Changes:

  • Converts root-, item-, and special-folder paths to ID-addressed routes.
  • Supports direct and batch requests with operation suffixes and special characters.
  • Adds focused integration tests.
File Description
DevProxy.Plugins/​Utils/​GraphUtils.cs Adds drive-item path canonicalization.
DevProxy.Integration.Tests/​GraphUtilsTests.cs Tests supported routes and batch handling.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@waldekmastykarz
waldekmastykarz merged commit c03208c into dotnet:main Oct 10, 2026
4 checks passed
@waldekmastykarz
waldekmastykarz deleted the investigate-issue-1918 branch October 10, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue resolving file upload permissions

2 participants