Commit Graph

11 Commits

Author SHA1 Message Date
Simon Ser
a346d42f42 caldav: only call CurrentUserPrincipal when necessary 2022-05-13 15:29:55 +02:00
Conrad Hoffmann
303aef52f3 caldav: implement handleMultiget()
The implementation has feature parity with the CardDAV one.
2022-05-12 17:32:30 +02:00
Conrad Hoffmann
585b01a7a8 Implement GET/HEAD/PUT for calendar objects
Still missing a few features, but works to a certain extend. Requires
an update to the backend interface to support the operations
2022-05-12 14:50:26 +02:00
Conrad Hoffmann
cdb0de3b99 Return calendar description in PROPFIND 2022-05-12 14:50:26 +02:00
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
Conrad Hoffmann
8931e14cf6 caldav: use Calendar.Path in PROPFIND response 2022-05-02 20:56:38 +02:00
Simon Ser
4e8c5effe3 Replace DAVError with HTTPError + Error
That way we can avoid having different ways of representing the
same error value.
2022-05-02 15:43:43 +02:00
Conrad Hoffmann
6401d9ed45 caldav: extend query filter types
The basic types related to queries and filtering are missing some
features specified in the RFC (as also noted in the TODO comments). This
adds several of the missing elements, working towards being able to
handle all RFC-compliant queries.

The work is not fully done, e.g. the collation for text-match is still
not handled, but it's getting pretty close.
2022-04-01 18:29:58 +02:00
Conrad Hoffmann
7dafedd290 Add type-safe precondition errors for CalDAV 2022-04-01 16:22:04 +02:00
Conrad Hoffmann
52215c1690 Pass request context to backend interface
This aligns the caldav interface with the carddav one (see #53).
2022-03-16 20:11:00 +01:00
Simon Ser
106d4e1c88 caldav: add basic server
A lot of features a still missing, but basic discovery works.

Co-authored-by: Conrad Hoffmann <ch@bitfehler.net>
2022-03-16 16:47:29 +01:00