Commit Graph

9 Commits

Author SHA1 Message Date
Pascal Bleser
6aff360578 refactor(groupware): session cache and DNS autodiscovery
* move the logging of the username and session state away from pkg/jmap
   and into services/groupware

 * introduce more decoupling for the session cache, as well as moving
   the implementation into groupware_session.go
2026-04-30 10:51:41 +02:00
Pascal Bleser
d0c9358908 groupware: session handling improvements
* remove the baseurl from the JMAP client configuration, and pass it to
   the session retrieval functions instead, as that is really the only
   place where it is relevant, and we gain flexibility to discover that
   session URL differently in the future without having to touch the
   JMAP client

 * move the default account identifier handling from the JMAP package to
   the Groupware one, as it really has nothing to do with JMAP itself,
   and is an opinionated feature of the Groupware REST API instead

 * add an event listener interface for JMAP events to be more flexible
   and universal, typically for metrics that are defined on the API
   level that uses the JMAP client

 * add errors for when default accounts cannot be determined

 * split groupware_framework.go into groupware_framework.go,
   groupware_request.go and groupware_response.go

 * move the accountId logging into the Groupware level instead of JMAP
   since it can also be relevant to other operations that might be
   worthy of logging before the JMAP client is even invoked
2026-04-30 10:51:41 +02:00
Pascal Bleser
50d0cbe807 jmap: minor logging improvements 2026-04-30 10:51:41 +02:00
Pascal Bleser
45771e28e1 groupware: jmap: add metrics 2026-04-30 10:51:41 +02:00
Pascal Bleser
4a0dac0d96 Groupware: refactor jmap package, implement Email/set, EmailSubmission
* refactor the jmap package to split it into several files as the
   jmap.api.go file was becoming too unwieldy

 * refactor the Groupware handler function response to be a Response
   object, to be more future-proof and avoid adding more and more
   return parameters while handling "no content" response as well

 * more godoc for the JMAP model

 * add Email creation, updating, deleting (Email/set,
   EmailSubmission/set)

 * add endpoints
   - POST /accounts/{accountid}/messages
   - PATCH|PUT /accounts/{accountid}/messages/{messageid}
   - DELETE /accounts/{accountid}/messages/{messageid}
2026-04-30 10:51:40 +02:00
Pascal Bleser
3794008dc7 groupware: blob streaming (upload and download) 2026-04-30 10:51:40 +02:00
Pascal Bleser
26cbdb8f7e groupware: implement JSON:API's error response format, with a revamped error handling in jmap and services/groupware 2026-04-30 10:51:40 +02:00
Pascal Bleser
ad73661703 Groupware and jmap: cleanup and API documentation 2026-04-30 10:51:40 +02:00
Pascal Bleser
75e04f8f68 Groupware improvements: refactoring, k6 tests
* refactored the models to be strongly typed with structs and mapstruct
   to decompose the dynamic parts of the JMAP payloads

 * externalized large JSON strings for tests into .json files under
   testdata/

 * added a couple of fantasy Graph groupware APIs to explore further
   options

 * added k6 scripts to test those graph/me/messages APIs, with a setup
   program to set up users in LDAP, fill their IMAP inbox, activate them
   in Stalwart, cleaning things up, etc...
2026-04-30 10:51:40 +02:00