Commit Graph

11 Commits

Author SHA1 Message Date
Pascal Bleser
0bed356966 groupware: fix typos and minor issues
- fix a bunch of minor issues and typos that were found using GoLand
   and gosec

 - add a gosec Makefile target for Groupware related files, in
   services/groupware/Makefile

 - enable checking JMAP session capabilities for events and contacts,
   and only enable skipping that check for tasks until those are
   implemented in Stalwart as well

 - fix a CWE-190 (integer overflow or wraparound) found by gosec

 - consistently use struct references for methods of Groupware and
   Request, instead of mixing up references and copies

 - always log errors when unable to register a Prometheus metric
2026-06-16 16:51:37 +02:00
Pascal Bleser
55ca319180 refactor(groupware): logging and metrics improvements
* some minor code refactorings to improve logging and metrics

 * more code documentation
2026-06-16 16:48:31 +02:00
Pascal Bleser
d99412963b groupware: implement metrics
* implement a framework for metrics, with a few exemplary ones
2026-06-16 16:48:31 +02:00
Pascal Bleser
cc12f32346 groupware: Etag handling
* implement correct Etag and If-None-Match handling, responding with
   304 Not Modified if they match

 * introduce SessionState and State string type aliases to ensure we are
   using the correct fields for those, respectively

 * extract the SessionState from the JMAP response bodies in the
   groupware framework instead of having to do that in every single
   groupware API

 * use uint instead of int in some places to clarify that the values are
   >= 0

 * trace-log how long a Session was held in cache before being evicted

 * add Trace-Id header handling: add to response when specified in
   request, and implement a custom request logger to include it as a
   field

 * implement a more compact trace-logging of all the methods and URIs
   that are served, to put them into a single log entry instead of
   creating one log entry for every URI
2026-06-16 16:48:31 +02:00
Pascal Bleser
11b7b94468 Refactor groupware service after ADR decision on the Groupware API
* after having decided that the Groupware API should be a standalone
   independent custom REST API that is using JMAP data models as much as
   possible,
 * removed Groupware APIs from the Graph service
 * moved Groupware implementation to the Groupware service, and
   refactored a few things accordingly
2026-06-16 16:48:31 +02:00
Pascal Bleser
7199509130 Groupware and jmap: cleanup and API documentation 2026-06-16 16:48:31 +02:00
Pascal Bleser
b0e3a9ec89 groupware and jmap improvements and refactoring 2026-06-16 16:48:31 +02:00
Pascal Bleser
8e76649270 move services/groupware/pkg/jmap to pkg/jmap 2026-06-16 16:48:30 +02:00
Pascal Bleser
429880566c WIP: restructure the Jmap client, and implement the /me/messages Graph API endpoint with it 2026-06-16 16:48:30 +02:00
Pascal Bleser
f8328827a9 add missing routing for /groupware (currently unprotected for testing) 2026-06-16 16:48:30 +02:00
Pascal Bleser
91d2fb92e1 WIP: initial implementation of the groupware service 2026-06-16 16:48:30 +02:00