This commit introduces a new, high-performance, and extensible WebDAV submodule, implemented natively without external dependencies.
The submodule includes:
- A core WebDAV handler that supports essential methods: PROPFIND, MKCOL, GET, PUT, DELETE, COPY, MOVE, LOCK, and UNLOCK.
- An extensible design using a `FileSystem` interface to decouple the protocol logic from the storage backend.
- Two `FileSystem` implementations:
- `MemFS`: An in-memory, tree-based filesystem for testing and ephemeral storage. It correctly handles path segments like `.` and `..`.
- `OSFS`: A secure, OS-based filesystem that interacts with the local disk. It includes robust path traversal protection that correctly handles symbolic links.
- A `LockSystem` interface with an in-memory implementation (`MemLock`) to support resource locking (DAV Class 2). It includes a graceful shutdown mechanism to prevent goroutine leaks.
- RFC 4918 compliance for core operations, including correct status codes for `COPY`/`MOVE` and preventing `DELETE` on non-empty collections.
- Comprehensive unit tests covering all major functionalities.
- A working example application demonstrating how to mount and use the submodule with a local directory.
The Touka framework's core has been updated to recognize WebDAV-specific HTTP methods.
This implementation addresses numerous points from detailed code reviews, including security vulnerabilities, memory leaks, RFC compliance issues, and path handling bugs.
This commit introduces a new, high-performance, and extensible WebDAV submodule, implemented natively without external dependencies.
The submodule includes:
- A core WebDAV handler that supports essential methods: PROPFIND, MKCOL, GET, PUT, DELETE, COPY, MOVE, LOCK, and UNLOCK.
- An extensible design using a `FileSystem` interface to decouple the protocol logic from the storage backend.
- Two `FileSystem` implementations:
- `MemFS`: An in-memory, tree-based filesystem for testing and ephemeral storage.
- `OSFS`: A secure, OS-based filesystem that interacts with the local disk and includes path traversal protection.
- A `LockSystem` interface with an in-memory implementation (`MemLock`) to support resource locking (DAV Class 2).
- Comprehensive unit tests covering all major functionalities.
- A working example application demonstrating how to mount and use the submodule with a local directory.
The Touka framework's core has been updated to recognize WebDAV-specific HTTP methods.
This commit introduces a new, high-performance, and extensible WebDAV submodule, implemented natively without external dependencies.
The submodule includes:
- A core WebDAV handler that supports essential methods: PROPFIND, MKCOL, GET, PUT, DELETE, COPY, MOVE, LOCK, and UNLOCK.
- An extensible design using a `FileSystem` interface to decouple the protocol logic from the storage backend.
- Two `FileSystem` implementations:
- `MemFS`: An in-memory, tree-based filesystem for testing and ephemeral storage.
- `OSFS`: A secure, OS-based filesystem that interacts with the local disk and includes path traversal protection.
- A `LockSystem` interface with an in-memory implementation (`MemLock`) to support resource locking (DAV Class 2).
- Comprehensive unit tests covering all major functionalities.
- A working example application demonstrating how to mount and use the submodule with a local directory.
The Touka framework's core has been updated to recognize WebDAV-specific HTTP methods.
This commit introduces a new, high-performance, and extensible WebDAV submodule, implemented natively without external dependencies.
The submodule includes:
- A core WebDAV handler that supports essential methods: PROPFIND, MKCOL, GET, PUT, DELETE, COPY, MOVE, LOCK, and UNLOCK.
- An extensible design using a `FileSystem` interface to decouple the protocol logic from the storage backend.
- Two `FileSystem` implementations:
- `MemFS`: An in-memory, tree-based filesystem for testing and ephemeral storage.
- `OSFS`: A secure, OS-based filesystem that interacts with the local disk and includes path traversal protection.
- A `LockSystem` interface with an in-memory implementation (`MemLock`) to support resource locking (DAV Class 2).
- Comprehensive unit tests covering all major functionalities.
- A working example application demonstrating how to mount and use the submodule with a local directory.
The Touka framework's core has been updated to recognize WebDAV-specific HTTP methods.
This commit introduces a new, high-performance, and extensible WebDAV submodule, implemented natively without external dependencies.
The submodule includes:
- A core WebDAV handler that supports essential methods: PROPFIND, MKCOL, GET, PUT, DELETE, COPY, MOVE, LOCK, and UNLOCK.
- An extensible design using a `FileSystem` interface to decouple the protocol logic from the storage backend.
- Two `FileSystem` implementations:
- `MemFS`: An in-memory, tree-based filesystem for testing and ephemeral storage.
- `OSFS`: A secure, OS-based filesystem that interacts with the local disk and includes path traversal protection.
- A `LockSystem` interface with an in-memory implementation (`MemLock`) to support resource locking (DAV Class 2).
- Comprehensive unit tests covering all major functionalities.
- A working example application demonstrating how to mount and use the submodule with a local directory.
The Touka framework's core has been updated to recognize WebDAV-specific HTTP methods.
This commit introduces a new, high-performance, and extensible WebDAV submodule, implemented natively without external dependencies.
The submodule includes:
- A core WebDAV handler that supports essential methods: PROPFIND, MKCOL, GET, PUT, DELETE, COPY, MOVE, LOCK, and UNLOCK.
- An extensible design using a `FileSystem` interface to decouple the protocol logic from the storage backend.
- Two `FileSystem` implementations:
- `MemFS`: An in-memory, tree-based filesystem for testing and ephemeral storage.
- `OSFS`: A secure, OS-based filesystem that interacts with the local disk and includes path traversal protection.
- A `LockSystem` interface with an in-memory implementation (`MemLock`) to support resource locking (DAV Class 2).
- Comprehensive unit tests covering all major functionalities.
- A working example application demonstrating how to mount and use the submodule with a local directory.
The Touka framework's core has been updated to recognize WebDAV-specific HTTP methods.
The router could panic with a 'slice bounds out of range' error when handling requests that trigger its backtracking logic.
The root cause was a shallow copy of the node's `children` slice when creating a `skippedNode` for backtracking. This could lead to a corrupted state if the router needed to backtrack and then proceed down a wildcard path.
This commit fixes the issue by introducing a `copyChildren` method on the `node` struct, which creates a safe copy of the children slice. This method is now used when creating a `skippedNode`, ensuring that the backtracking logic is isolated and robust.