A Go library for WebDAV, CalDAV and CardDAV
Go to file
Conrad Hoffmann 6887b6b812 Support custom user principal and home set paths
Currently, the user principal path and the home set path are both
hardcoded to "/", for both CalDAV and CardDAV. This poses a challenge if
one wishes to run a CardDAV and CalDAV server in the same server.

This commit introduces the concept of a UserPrincipalBackend. This
backend must provide the path of the current user's principal URL from
the given request context.

The CalDAV and CardDAV backends are extended to also function as
UserPrincipalBackend. In addition, they are required to supply the path
of the respective home set (`calendar-home-set` and
`addressbook-home-set`). The CardDAV and CalDAV servers act accordingly.

The individual servers will continue to work as before (including the
option of keeping everything at "/"). If one wishes to run CardDAV and
CalDAV in parallel, the new `webdav.ServeUserPrincipal()` can be used as
a convenience function to serve a common user principal URL for both
servers. The input for this function can be easily computed by the
application by getting the home set paths from the backends and using
`caldav.NewCalendarHomeSet()` and `carddav.NewAddressbookHomeSet()` to
create the home sets.

Note that the storage backend will have to know about these paths as
well. For any non-trivial use case, a storage backend should probably
have access to the same UserPrincipalBackend. That is, however, an
implementation detail and doesn't have to be reflected in the
interfaces.
2022-05-11 11:12:04 +02:00
caldav Support custom user principal and home set paths 2022-05-11 11:12:04 +02:00
carddav Support custom user principal and home set paths 2022-05-11 11:12:04 +02:00
cmd/webdav-server cmd/webdav-server: new command 2020-01-22 13:17:52 +01:00
internal internal: don't send an empty error element 2022-05-02 20:41:33 +02:00
.build.yml ci: add .build.yml 2020-04-02 16:50:41 +02:00
.gitignore Initial commit 2017-08-26 14:46:44 +02:00
client.go Include ModTime for directories if available 2021-08-11 11:08:03 +02:00
elements.go Support custom user principal and home set paths 2022-05-11 11:12:04 +02:00
fs_local.go webdav: add COPY support to server 2020-01-22 13:00:42 +01:00
go.mod caldav: upgrade to latest go-ical API 2020-02-24 21:16:45 +01:00
go.sum caldav: upgrade to latest go-ical API 2020-02-24 21:16:45 +01:00
LICENSE Start from scratch 2020-01-14 17:51:33 +01:00
README.md readme: update badges 2022-02-02 13:54:40 +01:00
server.go Support custom user principal and home set paths 2022-05-11 11:12:04 +02:00
webdav.go webdav: add support for ETag to client & server 2020-01-22 12:03:58 +01:00

go-webdav

godocs.io builds.sr.ht status

A Go library for WebDAV, CalDAV and CardDAV.

License

MIT