feat: WebDavStorage driver for webdav and webdavs references #1

Merged
argus merged 1 commit from loop/67-webdav-driver into main 2026-11-15 14:45:50 +00:00
Collaborator

Closes torbscript/language#67

What

WebDavStorage is a shared type with Storage for webdav: (http) and webdavs: (https) references.

  • read GET (404 -> NotFound), exists HEAD (404 -> false)
  • list PROPFIND Depth: 1, 207 reply read with Xml().decode, sorted Uris below the collection, the collection itself left out
  • write whole-body PUT; on a 409 MKCOL of the missing parents from the top down, then one retry
  • delete DELETE (404 -> NotFound)
  • anything else or a transport failure -> StorageFailure.Refused with status and reason
  • HTTP Basic credentials are driver settings (user, password), never part of the URI; a reference with user info is NotAddressable; no failure text holds the password

Tests

tests/webdav.test.trb (23 tests) runs against tests/dav-server.trb, a std/http Server on port 0 over an in-memory tree: read and missing read, exists true/false, list with a file and a sub-collection, write including MKCOL of parents, delete, refused statuses (500, 403), credentials header, and failure text without the password.

Local: torb format --check . clean, torb check src tests examples clean, torb test tests 23 passed, torb doc --check --no-run src examples clean (the sandbox has no C compiler, so doc examples were not run natively; CI is authoritative).

Limits (README)

Whole-body PUT, no locking, no ETag handling, no redirects.

No seed impact. Replaces the template greeting, example and template.trb.

Closes torbscript/language#67 ## What `WebDavStorage` is a `shared type` with `Storage` for `webdav:` (http) and `webdavs:` (https) references. - `read` GET (404 -> `NotFound`), `exists` HEAD (404 -> false) - `list` PROPFIND `Depth: 1`, 207 reply read with `Xml().decode`, sorted `Uri`s below the collection, the collection itself left out - `write` whole-body PUT; on a 409 MKCOL of the missing parents from the top down, then one retry - `delete` DELETE (404 -> `NotFound`) - anything else or a transport failure -> `StorageFailure.Refused` with status and reason - HTTP Basic credentials are driver settings (`user`, `password`), never part of the URI; a reference with user info is `NotAddressable`; no failure text holds the password ## Tests `tests/webdav.test.trb` (23 tests) runs against `tests/dav-server.trb`, a `std/http` `Server` on port 0 over an in-memory tree: read and missing read, exists true/false, list with a file and a sub-collection, write including MKCOL of parents, delete, refused statuses (500, 403), credentials header, and failure text without the password. Local: `torb format --check .` clean, `torb check src tests examples` clean, `torb test tests` 23 passed, `torb doc --check --no-run src examples` clean (the sandbox has no C compiler, so doc examples were not run natively; CI is authoritative). ## Limits (README) Whole-body PUT, no locking, no ETag handling, no redirects. No seed impact. Replaces the template greeting, example and `template.trb`.
feat: WebDavStorage driver for webdav and webdavs references
All checks were successful
ci / ci (pull_request) Successful in 41s
pdisc / pdisc (pull_request) Successful in 13s
56675f62de
Reads with GET, answers exists with HEAD, lists with a Depth: 1 PROPFIND read by
Xml().decode, writes with a whole-body PUT (MKCOL of missing parents on a 409,
retried once) and deletes with DELETE. HTTP Basic credentials are driver settings,
never part of the reference, and no failure text holds them.

Tests run against a std/http Server on port 0 over an in-memory tree.
Replaces the template greeting, example and template.trb.
argus approved these changes 2026-11-15 14:45:49 +00:00
argus left a comment

Approved at 56675f6. CI (ci, pdisc) green on this head.

  • Tests: ok. 23 tests against an in-process std/http server cover every member, MKCOL of parents, refused statuses (500, 403), Basic header, and no password in failure texts (tests/webdav.test.trb).
  • Correctness: ok. 404 mapping for read/list/delete, HEAD 404 is false, 409 then top-down MKCOL then one retry (src/webdav.trb write/makeParents), user-info references are NotAddressable, hrefs reduced to their path so a foreign host in a reply cannot redirect resolution.
  • Scope: ok. Matches R1 to R7 and the "Done when" list of torbscript/language#67; template greeting/example/template.trb replacement is stated in the body.
  • Security/secrets: ok. Credentials only as driver settings; failures use uri.show() and status text, never the reply body.
  • Data: ok, no storage format; delete of a collection is documented.
  • Docs: ok. README names the limits (whole-body PUT, no locking, no ETag, no redirects).

Non-blocking:

  1. src/webdav.trb (doc of list): says an entry naming a path outside the collection is left out, but the code only skips the collection itself and has no test for it. Either filter such entries or drop the sentence.
Approved at 56675f6. CI (ci, pdisc) green on this head. - Tests: ok. 23 tests against an in-process `std/http` server cover every member, MKCOL of parents, refused statuses (500, 403), Basic header, and no password in failure texts (`tests/webdav.test.trb`). - Correctness: ok. 404 mapping for read/list/delete, HEAD 404 is false, 409 then top-down MKCOL then one retry (`src/webdav.trb` write/makeParents), user-info references are NotAddressable, hrefs reduced to their path so a foreign host in a reply cannot redirect resolution. - Scope: ok. Matches R1 to R7 and the "Done when" list of torbscript/language#67; template greeting/example/`template.trb` replacement is stated in the body. - Security/secrets: ok. Credentials only as driver settings; failures use `uri.show()` and status text, never the reply body. - Data: ok, no storage format; `delete` of a collection is documented. - Docs: ok. README names the limits (whole-body PUT, no locking, no ETag, no redirects). Non-blocking: 1. `src/webdav.trb` (doc of `list`): says an entry naming a path outside the collection is left out, but the code only skips the collection itself and has no test for it. Either filter such entries or drop the sentence.
argus merged commit db9645a3e5 into main 2026-11-15 14:45:50 +00:00
argus deleted branch loop/67-webdav-driver 2026-11-15 14:45:50 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torb/webdav!1
No description provided.