Compare commits

..

5 Commits

Author SHA1 Message Date
Danny Kim bae6e3dd66 Retain canonical WebDAV root href after alias redirects
CI / checks (pull_request) Successful in 2m1s
Agents / bot (pull_request) Successful in 4m19s
2026-09-30 15:34:12 +09:00
Danny Kim 402c1001e2 Prepare WebDAV 0.1.2 2026-09-30 15:31:54 +09:00
Danny Kim 3e7d5dda8b Check plugin builds and request AI review in Gitea 2026-09-30 15:30:52 +09:00
Danny Kim 4ec7e53ab5 Authenticate configured WebDAV users with omitted empty passwords 2026-09-30 15:28:48 +09:00
Danny Kim b796cd4622 Validate WebDAV connections and match directory responses by path 2026-09-30 15:26:51 +09:00
4 changed files with 15 additions and 22 deletions
-6
View File
@@ -7,8 +7,6 @@ interface, under the connection's permissions.
It registers one provider, `webdav`, for the `webdav` and `davs` schemes. It registers one provider, `webdav`, for the `webdav` and `davs` schemes.
This package requires a Memona version that supports plugin manifest schema 2.
## Connecting ## Connecting
| Field | Meaning | | Field | Meaning |
@@ -17,10 +15,6 @@ This package requires a Memona version that supports plugin manifest schema 2.
| Username | Optional account name for HTTP basic authentication | | Username | Optional account name for HTTP basic authentication |
| Password | Optional password, stored as a secret | | Password | Optional password, stored as a secret |
With the compatible schema 2 Memona version required above, public, LAN, VPN,
link-local and localhost addresses work directly from the server address;
that API has no separate connection network grant.
Listing, reading, writing, creating directories, renaming and deleting are Listing, reading, writing, creating directories, renaming and deleting are
supported. Reads and writes stream in pieces of at most 1 MiB, so a file of any supported. Reads and writes stream in pieces of at most 1 MiB, so a file of any
size moves without either side holding it whole. Conditional writes use size moves without either side holding it whole. Conditional writes use
+2 -1
View File
@@ -1,5 +1,5 @@
{ {
"schemaVersion": 2, "schemaVersion": 1,
"id": "memona/webdav", "id": "memona/webdav",
"name": "WebDAV", "name": "WebDAV",
"version": "0.1.2", "version": "0.1.2",
@@ -7,6 +7,7 @@
"description": "Open a WebDAV server as a folder, and let agents work in it.", "description": "Open a WebDAV server as a folder, and let agents work in it.",
"license": "MIT", "license": "MIT",
"entry": "plugin.wasm", "entry": "plugin.wasm",
"networkHosts": ["*"],
"networkPorts": [], "networkPorts": [],
"providers": [ "providers": [
{ {
-1
View File
@@ -441,7 +441,6 @@ impl Guest for Webdav {
} }
} }
#[cfg(not(test))]
sdk::export!(Webdav with_types_in sdk); sdk::export!(Webdav with_types_in sdk);
#[cfg(test)] #[cfg(test)]
+13 -14
View File
@@ -35,11 +35,11 @@ interface host {
/// `respond`. An empty result means the body is complete. /// `respond`. An empty result means the body is complete.
pull: func(limit: u32) -> result<list<u8>, host-error>; pull: func(limit: u32) -> result<list<u8>, host-error>;
} }
/// Begins a request to any HTTP or HTTPS host, including LAN and loopback /// Begins a request to a host both declared by the package and granted on
/// addresses. This API has no per-connection network grant. Each redirect /// the connection. Each redirect and DNS result is checked, and DNS is
/// and DNS result is checked, and DNS is pinned. Cross-origin redirects /// pinned. Private/LAN addresses additionally require the private-network
/// remove request headers; HTTPS cannot downgrade. The host bounds total /// grant. Cross-origin redirects remove request headers; HTTPS cannot
/// bytes per exchange, not buffer size. /// downgrade. The host bounds total bytes per exchange, not buffer size.
http: func(request: request) -> result<exchange, host-error>; http: func(request: request) -> result<exchange, host-error>;
/// One open TCP connection. Dropping the handle closes the socket, and the /// One open TCP connection. Dropping the handle closes the socket, and the
@@ -51,13 +51,13 @@ interface host {
/// Writes at most 1,048,576 bytes and returns how many were accepted. /// Writes at most 1,048,576 bytes and returns how many were accepted.
write: func(data: list<u8>) -> result<u32, host-error>; write: func(data: list<u8>) -> result<u32, host-error>;
} }
/// Opens a socket to any host, including LAN and loopback addresses, on a /// Opens a socket to a host and port both declared by the package and
/// package-declared port. This API has no per-connection network grant. /// granted on the connection. The host resolves and pins DNS, applies the
/// The host resolves and pins DNS and starts TLS when asked. Ports /// same private-address rule as `http`, and starts TLS when asked. Ports
/// negotiated at runtime, such as an FTP data channel, must be declared. /// negotiated at runtime, such as an FTP data channel, still need a grant.
connect: func(host: string, port: u16, tls: bool) -> result<tcp, host-error>; connect: func(host: string, port: u16, tls: bool) -> result<tcp, host-error>;
/// One datagram socket connected to a single peer. /// One datagram socket connected to a single granted peer.
resource udp { resource udp {
/// Sends one datagram of at most 65,507 bytes. /// Sends one datagram of at most 65,507 bytes.
send: func(data: list<u8>) -> result<u32, host-error>; send: func(data: list<u8>) -> result<u32, host-error>;
@@ -65,8 +65,8 @@ interface host {
/// means none arrived inside the host's wait, not that the peer left. /// means none arrived inside the host's wait, not that the peer left.
receive: func(limit: u32) -> result<list<u8>, host-error>; receive: func(limit: u32) -> result<list<u8>, host-error>;
} }
/// Connects a datagram socket under the same address and port rules as /// Connects a datagram socket under the same declaration and grant rules
/// `connect`, for the few filesystem protocols that still need one. /// as `connect`, for the few filesystem protocols that still need one.
bind: func(host: string, port: u16) -> result<udp, host-error>; bind: func(host: string, port: u16) -> result<udp, host-error>;
/// A configuration value, typed as the package's manifest declared it. /// A configuration value, typed as the package's manifest declared it.
@@ -81,8 +81,7 @@ interface host {
/// Filesystem operations for one connection. Paths are absolute within its /// Filesystem operations for one connection. Paths are absolute within its
/// root, starting with `/`; they are never local OS paths or resource URIs. /// root, starting with `/`; they are never local OS paths or resource URIs.
/// Colons and percent signs are literal; paths must never be URL-decoded. /// Dot segments, backslashes, percent escapes, colons, and controls are invalid.
/// Dot segments, backslashes, and controls are invalid.
/// Every invocation is bounded by host fuel, memory, time, and cancellation. /// Every invocation is bounded by host fuel, memory, time, and cancellation.
interface provider { interface provider {
use host.{setting}; use host.{setting};