Attention

You are looking at outdated documentation for version 1.x. A newer version is available.

5.2. WsgiDAV Modules

This document gives a brief introduction to the WsgiDAV application package (targeted to developers).

See also

WsgiDAV API Doc

5.2.1. DAV providers

DAV providers are abstractions layers that are used by the RequestServer to access and manipulate DAV resources.

All DAV providers must implement a common interface. This is usually done by deriving from the abstract base class dav_provider.DAVProvider.

WsgiDAV comes with a DAV provider for file systems, called fs_dav_provider.FilesystemProvider. That is why WsgiDAV is a WebDAV file server out-of-the-box.

There are also a few other modules that may serve as examples on how to plug-in your own custom DAV providers: Samples and addons for WsgiDAV. See also Writing custom providers.

5.2.2. FilesystemProvider

Implementation of a DAV provider that serves resource from a file system.

ReadOnlyFilesystemProvider implements a DAV resource provider that publishes a file system for read-only access. Write attempts will raise HTTP_FORBIDDEN.

FilesystemProvider inherits from ReadOnlyFilesystemProvider and implements the missing write access functionality.

See Developers info for more information about the WsgiDAV architecture.

5.2.3. Property Managers

DAV providers may use a property manager to support persistence for dead properties.

WsgiDAV comes with two default implementations, one based on a in-memory dictionary, and a persistent one based in shelve:

property_manager.PropertyManager
property_manager.ShelvePropertyManager

PropertyManager is used by default, but ShelvePropertyManager can be enabled by uncommenting two lines in the configuration file.

In addition, this may be replaced by a custom version, as long as the required interface is implemented.

Implements two property managers: one in-memory (dict-based), and one persistent low performance variant using shelve.

The properties dictionaray is built like:

{ ref-url1: {propname1: value1,
             propname2: value2,
             },
  ref-url2: {propname1: value1,
             propname2: value2,
             },
  }

See Developers info for more information about the WsgiDAV architecture.

5.2.4. Lock Managers

DAV providers may use a lock manager to support exclusive and shared write locking.

WsgiDAV comes with two default implementations, one based on a in-memory dictionary, and a persistent one based in shelve:

lock_manager.LockManager
lock_manager.ShelveLockManager

LockManager is used by default, but ShelveLockManager can be enabled by uncommenting two lines in the configuration file.

In addition, this may be replaced by a custom version, as long as the required interface is implemented.

Implements the LockManager object that provides the locking functionality.

The LockManager requires a LockStorage object to implement persistence. Two alternative lock storage classes are defined in the lock_storage module:

  • wsgidav.lock_storage.LockStorageDict
  • wsgidav.lock_storage.LockStorageShelve

The lock data model is a dictionary with these fields:

root:
Resource URL.
principal:
Name of the authenticated user that created the lock.
type:
Must be ‘write’.
scope:
Must be ‘shared’ or ‘exclusive’.
depth:
Must be ‘0’ or ‘infinity’.
owner:
String identifying the owner.
timeout:
Seconds remaining until lock expiration. This value is passed to create() and refresh()
expire:
Converted timeout for persistence: expire = time() + timeout.
token:
Automatically generated unique token.

See Developers info for more information about the WsgiDAV architecture.

5.2.5. Domain controllers

A domain controller provides user/password checking for a realm to the HTTPAuthenticator.

WsgiDAV comes with a default implementation that reads a user/password list from the config file.

However, this may be replaced by a custom version, as long as the required interface is implemented.

wsgidav.addons.nt_domain_controller is an example for such an extension.

5.2.6. Other objects

wsgidav.domain_controller.WsgiDAVDomainController
Default implementation of a domain controller as used by HTTPAuthenticator.