OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

[Feature]: WebDAV: user-scoped root, read-only switch and HTTP Basic credentials

Open ragnos-dev opened this issue 2 weeks ago • 0 comments

Version

OpenViking v0.5.4 (9dfa9017a). The same code is on current main (checked 2026-11-13).

Summary

Three gaps stop a desktop WebDAV client (for example macOS Finder) from opening a user's resources safely through openviking/server/routers/webdav.py:

  1. The router roots every path at the account-shared viking://resources, so a corpus stored under viking://user/<user>/resources is not visible.
  2. There is no read-only option: PUT, DELETE, MKCOL and MOVE are always allowed.
  3. Authentication reads only X-API-Key or a Bearer token, while desktop clients send HTTP Basic.

Reproduction

Store a resource under a user scope, then mount the WebDAV endpoint with a Basic credential whose password is a valid API key. The mount is refused (401 with no Basic challenge). With a header-capable client, the user's resources are absent from the listing.

Proposed fix

  • A root setting (user scope or the shared root).
  • A read-only setting that answers write methods with 403 before any storage call and lists only the read methods in Allow.
  • Accept a Basic password as the API key through the existing identity resolution, send WWW-Authenticate: Basic on 401, and refuse Basic requests that carry an Origin header (CORS allows credentials from any origin).

We run a local patch with these three changes and are happy to open a PR.

ragnos-dev avatar Nov 13 '26 14:11 ragnos-dev