Skip to content

Support WebDAV COPY, PROPPATCH and REPORT in the SSO binder #1121

Open

Description

@joe-123

How to use GitHub

  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Feature request

Nextcloud Server Version: 33+34
Nextcloud Files app version: current release (35.x)

Problem

I work on a comprehensive Android gallery app for Nextcloud that uses SSO.
Third-party apps connected via SSO cannot use three WebDAV operations, because they are not on the whitelist of InputStreamBinder.buildMethod() (GET, POST, PATCH, PUT, DELETE, MOVE, PROPFIND, MKCOL, HEAD).
This blocks major functionality in my app:

  • COPY — the only way to add a photo to a photo album. The server
    exposes albums at /remote.php/dav/photos/<user>/albums/ and COPY-ing
    a file into that collection links the file into the album. The Files app
    itself uses exactly this operation. Third-party apps can already create
    albums (MKCOL), remove photos (DELETE on the album item) and delete
    albums (DELETE on the collection) through the binder.

  • PROPPATCH — the documented way to set properties like oc:favorite
    The Files app toggles favorites through its own HTTP stack
    (ToggleFavoriteRemoteOperation); a companion app can display the star
    but never set it.

  • REPORT — the only efficient way to list favorites. The server
    offers the oc:filter-files report. Server implementation:
    apps/dav/lib/Connector/Sabre/FilesReportPlugin.php

    PROPFIND (whitelisted) is not a practical substitute here: the binder
    pins the request to Depth: 1. So reading favorites via PROPFIND
    means one request per folder (plus a custom request body).

    This matters because favoriting a file changes neither the file's nor its
    parent folder's etag (verified on NC 33). Etag-based incremental syncs
    can never notice a favorite change made by another client; the only
    workaround is a full PROPFIND sweep over every folder.

A concrete user-visible gap: my gallery companion app relying on SSO for server access cannot add a photo to an album, toggle a favorite, or sync favorites efficiently — the Files app is able to do all of that.

The solution I'd like

Add COPY, PROPPATCH and REPORT cases to buildMethod() in the Files app, plus any request-model support needed in the SSO library.

Implementation notes (verified on current master):

  • The required method classes (CopyMethod, PropPatchMethod,
    ReportMethod) are already on the app classpath via the same jackrabbit
    library as PropFindMethod/MoveMethod/MkColMethod — no new dependency.
  • COPY: reuse the established additional-parameter pattern from MOVE
    (ADDITIONAL_PARAMETER_MOVE_DESTINATION/_OVERWRITE →
    Destination/Overwrite headers).
  • PROPPATCH/REPORT bodies: the string-body path hardwires
    application/json for POST/PATCH/PUT; the new verbs need an XML content
    type (application/xml). PROPFIND already ships a text/xml request
    entity with a code comment conceding it "should be application/xml".
  • REPORT (and PROPPATCH) answers are 207 Multi-Status XML. Like PROPFIND,
    the response body must be passed through for the client to parse — it
    must not go through the JSON/Gson default path.

Alternatives considered

  • PUT into the album collection: the server then creates a real file
    copy
    in the user's files — duplicates data, not a membership.
  • OCS/photos API for album membership: does not exist in NC 33/34; the
    WebDAV collection is the API.
  • Raw credentials from SSO to do our own WebDAV: not exposed (see Possibility to get WebDAV-capable app password/token from SSO #598).
  • Dropping the verb whitelist entirely and letting the server answer 405 for
    invalid verbs, as discussed in SEARCH HTTP method is not supported #427 — unresolved since 2021; targeted verb
    additions are the smaller, reviewable step.

Context

PROPPATCH was already requested in December 2019 (#147); HEAD and PROPFIND
from that era were added, PROPPATCH never was.
MOVE was added in October via nextcloud/android#17852 +
Android-SingleSignOn#1096.
Couldn't find any existing issues or PRs for COPY, PROPPATCH, REPORT or filter-files
in either repository.

Related: #427 (SEARCH, whitelist discussion), #147 (2019 WebDAV verb
request), #598 (raw credentials), #395 (E2E tests).

Happy to test dev builds or contribute a PR for the binder side.
(I want to be transparent: the PR would be vibe coded. I can't do it alone, sorry.)

Edit: of course I can also provide an APK of my gallery app if that's of interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions