webdav

package
v0.2.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package webdav is the chassis's `webdav` personality: a WebDAV server over the drive store (chassis/drive), mounted on the web head under a reserved path prefix (--drive-path-prefix, default /drive) on every hostname the head serves. It is a stateful personality: every request is answered from the drive index and object store and never runs a stack — mutations reach stacks as `_scheduled` events the store emits (see docs/advanced/drive.md).

The mount URL is https://<host>/drive/. A Basic-auth account (minted by txco://drive/account) is bound to ONE collection, and that collection is the root the client sees — there is no username segment in the URL, no discovery and no principal: WebDAV has none of that, and a login that resolves to exactly one tree needs none.

The head owns what the library (go-webdav v0.7.0) does not: Basic auth over the account table, OPTIONS (class 2 must be advertised or macOS Finder mounts read-only), LOCK/UNLOCK (a stateless shim — see lock.go), streaming PUT with a size-scaled read deadline, and the prefix the library's hrefs must carry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller owns the head's shared state: the store, the verified-login cache and the throttles. It binds no listener of its own — the web head mounts Handler().

func NewController

func NewController(ctx context.Context, pu *processor.Unit, store *chdrive.Store, resolver HostResolver) *Controller

NewController constructs (but does not start) the head. A nil store (webdav personality off) yields an inert controller whose Handler answers 404 and whose Start is a no-op.

func (*Controller) Enabled

func (c *Controller) Enabled() bool

Enabled reports whether the head serves anything: the personality is on and the store opened.

func (*Controller) Handler

func (c *Controller) Handler() http.Handler

Handler is the http.Handler the web head mounts on Prefix()/.

func (*Controller) Prefix

func (c *Controller) Prefix() string

Prefix is the reserved path prefix (no trailing slash).

func (*Controller) ServeHTTP

func (c *Controller) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is the whole request flow. Every branch is answered from the store, here or by the WebDAV library over fs.go; none touches the bus.

func (*Controller) SetAuth added in v0.2.31

func (c *Controller) SetAuth(r *authn.Resolver)

SetAuth hands the head the login resolver (chassis/authn).

func (*Controller) Start

func (c *Controller) Start()

Start logs the mount. The head itself is served by the web head, so a `webdav` personality without `web` serves nothing — say so.

func (*Controller) Stop

func (c *Controller) Stop()

Stop is a no-op: the head holds no goroutines of its own.

type HostResolver

type HostResolver interface {
	ResolveErr(key ingress.RouteKey) (ingress.RouteTarget, bool, error)
}

HostResolver maps a request's Host to its tenant — the same routing every web request uses (ingress.DBResolver.ResolveErr). Tests inject.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL