refactor(graph): split colon paths on ":/" so colons in names work

Review feedback: split the anchor/path and path/suffix on the structural
delimiter ":/" instead of a bare ":". Since the path and suffix always
start with "/", ":/" is the real delimiter, and a ":" *inside* a file or
directory name (which OpenCloud allows but MS Graph/OneDrive forbid) is
kept as part of the path instead of being mistaken for a separator.

A ":" sitting at a segment boundary (e.g. a name ending in ":") stays
ambiguous and must be percent-encoded as "%3A": the split works on the
literal ":/", so "%3A" is never a delimiter and decodes back to ":". This
is now documented in the code and the acceptance feature.

Tests: colon inside a name (with and without a suffix), the Stat path
carrying the colon, and the "%3A" boundary escape.
This commit is contained in:
Dominik Schmidt
2026-07-01 14:24:10 +02:00
committed by Ralf Haferkamp
parent 95544b65ef
commit b6a4a66aef
3 changed files with 83 additions and 20 deletions

View File

@@ -12,6 +12,13 @@ Feature: colon-syntax path lookup on the Graph API
collapse to 404 so the middleware never discloses the existence of
resources the caller is not allowed to see.
The delimiter is ":/", so a raw ':' inside a file or directory name is kept
as part of the path. A ':' at a segment boundary (e.g. a name ending in ':')
is ambiguous and must be percent-encoded as "%3A" to be addressed. MS Graph
and OneDrive sidestep this by forbidding ':' in names entirely; OpenCloud
allows it (via WebDAV), so the "%3A" escape is how such names are reached
here.
Background:
Given user "Alice" has been created with default attributes
And user "Alice" has created folder "folder1"