Commit Graph

7 Commits

Author SHA1 Message Date
Pascal Bleser
279f8a2ab9 groupware: upgrade Stalwart to 0.16.12 + fix modifying the VacationResponse
* fix jmap.SetVacationResponse: was using JMAP create instead of update
   with a patch; did so by using the modify template function as with
   most other JMAP APIs

 * better HTTP status code handling for the responses received from
   Stalwart

 * add support for not caching JMAP session retrieval failures in the
   Groupware backend, by setting the error TTL to 0
2026-07-09 14:30:14 +02:00
Pascal Bleser
17d4dd3a5b groupware: add better HTTP logging
* introduce configuration settings for TLS insecurity, tracing requests
   and responses

 * use more secure implementation when replacing JMAP placeholders in
   URL templates, path escaping them to avoid injection

 * add more efficient tracing of HTTP requests and responses between the
   Groupware backend and the JMAP server, with the possibility of
   specifying a maximum body size to trace, to avoid blowing up the logs

 * use more efficient string building for HTTP Authorization headers

 * change internal API to use streams (io.Reader) instead of reading
   JSON responses fully into memory before parsing them
2026-07-09 14:30:14 +02:00
Pascal Bleser
b26c6cadce groupware: refactoring for pagination and support for multiple query suppliers
* refactor APIs in JMAP and Groupware in order to implement pagination
   across multiple accountIds and multiple suppliers (currently
   implemented using a mock supplier for contacts)

 * requires go 1.26 due to use of self-reflecting generics type
   constraints

 * still missing: query criteria and sorting parameters

 * still missing: multi-accountId support for emails

 * errors are now all just 'error' in the APIs, instead of the
   specialized implementations, and are interpreted dynamically where
   necessary in order to transform them into HTTP responses

 * remove position, anchor, anchorOffset as individual query parameters
   as we now only support a 'next=...' token for subsequent pages
   (except in emails for now), and use jmap.QueryParams instead; those
   tokens have a header character for the format, followed by a JSON
   encoded QueryParams map, all wrapped into base62 to make it clearer
   that it is meant to be an opaque token, and not a parameter clients
   should tinker with or construct themselves

 * introduce QueryParamsSupplier as an interface to provide QueryParams
   for various scenarios (single supplier, multiple supplier, ...) per
   accountId

 * implement multi-supplier template methods slist and squery
2026-07-09 14:30:13 +02:00
Pascal Bleser
2fa8834f39 groupware: refactor responses to a jmap.Response object
* in the JMAP API as well as in several places in the Groupware
   framework, use a single jmap.Response[T] object to return the
   payload, the language, the session state and the etag/state instead
   of individual multi-valued return values
2026-07-09 14:30:13 +02:00
Pascal Bleser
fae384cedc groupware: improve tests
* jmap: add UpdateContactCard and UpdateCalendarEvent funcs
 * use JSON marshalling and unmarshalling into a map for toPatch()
   implementations
 * add updating ContactCards and CalendarEvents to tests
 * add deleting ContactCards and CalendarEvents to tests
 * make query response totals work when the value is 0
 * tests: use CreateContactCard and CreateCalendarEvent funcs to create
   objects in tests instead of using a different JMAP stack that works
   with untyped maps
2026-07-09 14:30:13 +02:00
Pascal Bleser
c921133c28 groupware: framework refactorings + add support for /changes + add /objects 2026-07-09 14:15:52 +02:00
Pascal Bleser
0fd87e7d9b groupware: as suggested in the review PR 1994, remove all filename prefixes that match the package (groupware_xyz.go -> xyz.go), for groupware, jmap, jscontact, jscalendar 2026-07-09 14:15:52 +02:00