Skip to content

[stable35] fix(dav): scope federated and public access to shares - #67177

Open
backportbot[bot] wants to merge 3 commits into
stable35from
backport/67089/stable35
Open

backportbot[bot] wants to merge 3 commits into
stable35from
backport/67089/stable35

Conversation

@backportbot

@backportbot backportbot Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Backport of #67089

Builds on #67173 and #67178, please merge those first. Until then, this diff also shows their commits.

IUserSession has no setIncognitoMode() on this branch, so PublicAuth calls \OC_User::setIncognitoMode() like the other DAV auth backends here and keeps its constructor. Its test checks \OC_User::isIncognitoMode() instead of a mock.

Assisted by ClaudeCode:claude-opus-5-5

Group principal search returned every group matching the term, and
searchUserPrincipals() kept its own copy of the enumeration rules,
which had drifted from the share dialog: the phone book restriction
had no effect unless the group restriction was also enabled, and the
group-members-only exclude list was not applied. Both searches now
use the same rules as GroupPlugin and Share20\Manager. Default
settings are unaffected.

DavAclPlugin answered inaccessible calendar and address book paths
with its own message, which differed from the collection's regular
not-found response, and multiget hrefs, If: header URIs and
expand-property paths could get different status codes for the same
case. These paths now resolve the same way and return one consistent
"Node with name … could not be found".

Full-match principal search and the remote-calendars/ and
system-calendars/ roots are left as is.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
@backportbot backportbot Bot added 3. to review Waiting for reviews AI assisted labels Nov 30, 2026
@backportbot backportbot Bot added this to the Nextcloud 35.0.4 milestone Nov 30, 2026
Published properties such as calendar availability and the default
calendar URL were looked up in oc_properties by path only. Rows that
another user stored under the same path, which the legacy webdav
endpoint does because its paths are relative to the user's home, were
returned as well, together with any other property on that path. Only
rows stored by the node's owner, and only the published property
names, are read now, as UserStatusAutomation and TimezoneService
already do.

CalendarProvider merged every property a user stored for their view
of a calendar over the backend's calendar info, so stored values for
computed properties such as read-only or owner-principal overrode the
real ones for IManager consumers like calendar import and upcoming
events. Only per-user display properties are taken from oc_properties
now.

Group memberships and calendar delegations of a principal are only
served to the principal itself. Clients only need them for the
current user; other principals answer 403 for these properties.

Not included: prefixing legacy webdav property paths on write, which
needs a repair step for existing rows, and rejecting computed property
names in propPatch(), which the provider now ignores.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
Federated calendar authentication now only accepts a share token for
the shared calendar itself and paths below it. Remote users only have
incoming shares, so their calendar home refuses new collections, and
principals/remote-users is no longer listed, like the other principal
collections.

An incoming OCM calendar share for a calendar the recipient already
has is only taken as an update if it carries the current token or is
signed by the server hosting the calendar. Re-sharing keeps the
existing token, and a downgrade to read-only is stored locally even if
the remote server cannot be informed.

Requests that PublicAuth handles as public now match whole path
segments, run without the session's logged-in user, and only get what
is granted to the public principal by name, not what is granted to
authenticated users. Principal searches return nothing for them, and
the public calendar root gets an explicit read ACL.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
@GVodyanov
GVodyanov force-pushed the backport/67089/stable35 branch from d1844d3 to b943241 Compare November 30, 2026 10:12
@GVodyanov
GVodyanov marked this pull request as ready for review November 30, 2026 10:13
@GVodyanov
GVodyanov requested review from icewind1991 and leftybournes and removed request for a team November 30, 2026 10:13
@nextcloud-bot nextcloud-bot mentioned this pull request Nov 30, 2026

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

3. to review Waiting for reviews AI assisted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants