ExDav.CardDav.Plug (ExDav v0.4.10)

Copy Markdown View Source

Top-level Plug that handles CardDAV requests under the /dav prefix.

Resource layout (relative to mount point):

/principals/{user}/               principal resource
/addressbooks/{user}/             addressbook-home-set
/addressbooks/{user}/{book}/      addressbook collection
/addressbooks/{user}/{book}/{r}   vCard resource (.vcf)

Can be mounted at any path via forward in a Phoenix router. All <href> elements in responses are prefixed with conn.script_name so they remain valid behind a prefix-routing proxy.

Required opts:

Optional opts:

  • :prefix — first path segment the plug claims (default "dav"). Use "carddav" if you want autodiscovery and request URLs to live under /carddav/... rather than the historical /dav/....

Example:

plug ExDav.CardDav.Plug,
  storage: ExDav.Storage.Postgres,
  authenticator: {ExDav.Authenticator.Basic,
                  verify: {ExDav.Storage.Postgres, :authenticate}}