Commit Graph

243 Commits

Author SHA1 Message Date
Pascal Bleser
9af1c81bbd 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-06-03 18:39:08 +02:00
Pascal Bleser
9c6b397014 jmap: minor logging improvements 2026-06-03 18:39:08 +02:00
Pascal Bleser
dac49f4ce7 groupware: jmap: add metrics 2026-06-03 18:39:08 +02:00
Pascal Bleser
b6fc9d6e22 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-03 18:39:08 +02:00
Pascal Bleser
c8f2493fcf groupware: initial related emails implementation with SSE 2026-06-03 18:39:08 +02:00
Pascal Bleser
8399a3ee5e groupware: add /bootstrap
* add a GET /accounts/{a}/boostrap URI that delivers the same as GET /
   but also mailboxes for a given account, in case the UI remembers the
   last used account identifier, to avoid an additional roundtrip

 * streamline the use of simpleError()

 * add logging of errors at the calling site

 * add logging of evictions of Sessions from the cache

 * change default Session cache TTL to 5min instead of 30sec
2026-06-03 18:39:08 +02:00
Pascal Bleser
a76d40e493 groupware: swagger API documentation improvements
* add more documentation for properties

 * fixes after a bit of trial-and-error with go-swagger

 * fix email filter marshalling when there are no search criteria

 * introduce an apidoc.yml that contains Swagger data and is merged when
   generating the swagger.yml from sources
2026-06-03 18:39:08 +02:00
Pascal Bleser
37094d9db5 Groupware improvements
* ensure that all the jmap responses contain the SessionState

 * implement missing errors that were marked as TODO

 * moved common functions from pkg/jmap and pkg/services/groupware to
   pkg/log and pkg/structs to commonalize them across both source trees

 * implement error handling for SetError occurences

 * Email: replace anonymous map[string]bool for mailbox rights with a
   MailboxRights struct, as the keys are well-defined, which allows for
   properly documenting them

 * introduce ObjectType as an "enum"

 * fix JSON marshalling and unmarshalling of EmailBodyStructure

 * move the swagger documentation structs from groupware_api.go to
   groupware_docs.go

 * fix: change verb for /groupware/accounts/*/vacation from POST to PUT
2026-06-03 18:39:08 +02:00
Pascal Bleser
e81a325b56 groupware: minor email searching response improvements + started implementing vacation response setting API 2026-06-03 18:39:07 +02:00
Pascal Bleser
32992098b7 groupware: add identities of all accounts to the index resource 2026-06-03 18:39:07 +02:00
Pascal Bleser
051d975c55 groupware: fix email search, add variant that includes the full emails 2026-06-03 18:39:07 +02:00
Pascal Bleser
70c92c7866 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-06-03 18:39:07 +02:00
Pascal Bleser
4b3b7ca412 groupware: implement message search with snippets 2026-06-03 18:39:07 +02:00
Pascal Bleser
0bcf25516f groupware: blob streaming (upload and download) 2026-06-03 18:39:07 +02:00
Pascal Bleser
22dca9fe89 groupware: more JMAP operations implementation 2026-06-03 18:39:07 +02:00
Pascal Bleser
0dc59f3786 groupware: further implementation and improvements 2026-06-03 18:39:07 +02:00
Pascal Bleser
6e23f5fe8f refactored the Session object, refactored the services/groupware directory, and started Swagger documentation implementation 2026-06-03 18:39:07 +02:00
Pascal Bleser
b3e678db47 groupware: refactoring the API mechanisms 2026-06-03 18:39:07 +02:00
Pascal Bleser
b414b8b233 groupware: implement JSON:API's error response format, with a revamped error handling in jmap and services/groupware 2026-06-03 18:39:07 +02:00
Pascal Bleser
0c4540bb4d 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-03 18:39:07 +02:00
Pascal Bleser
90a36d6797 Groupware and jmap: cleanup and API documentation 2026-06-03 18:39:07 +02:00
Pascal Bleser
4379fa27e4 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-06-03 18:39:07 +02:00
Pascal Bleser
e1bd777ed0 groupware and jmap improvements and refactoring 2026-06-03 18:39:07 +02:00
Pascal Bleser
f422448f68 add an auth-api service to make an exemplary implementation of an external authentication API for third party services such as Stalwart 2026-06-03 18:39:07 +02:00
Pascal Bleser
fda5c95b85 move services/groupware/pkg/jmap to pkg/jmap 2026-06-03 18:39:07 +02:00
Pascal Bleser
4ca6a0d74c WIP: initial implementation of the groupware service 2026-06-03 18:39:07 +02:00
Michael Barz
1b8393e9d3 chore: bump minor version 2026-06-01 17:06:47 +02:00
Ralf Haferkamp
719bb2123c fix: translations for activities and others
This fixes the server-side translations for "activties" and e.g. the
default space description. We need to bump "leonelquinteros/gotext"
to latest master for that as even the latest release still contains
and issue that cause `go vet` to complain about non-constant
format strings.

Fixes: #2833, #2835
2026-05-27 11:22:26 +02:00
Viktor Scharf
594c9bb2b6 [decomposed] chore: bump web to v7.0.1 (#2791) 2026-05-20 11:35:17 +02:00
Dominik Schmidt
0ad6112dd2 chore(debug): remove leftover commented-out probeHandler 2026-05-19 11:13:59 +02:00
Dominik Schmidt
46a8dee126 fix(debug): drop duplicate service field from probe fallback log
The base logger created by log.Configure already attaches a "service"
field via its context. handleProbe added it a second time, producing
JSON log entries with two "service" keys. Remove the redundant
Str("service", name) and the now-unused name parameter.
2026-05-19 11:04:23 +02:00
Viktor Scharf
cf0ec50da9 [full-ci] chore: bump reva to v2.44.0 update opencloud version 6.2.0 (#2734) 2026-05-11 17:08:39 +02:00
André Duffeck
544968a4de Set new defaults for caches and stores
See https://github.com/opencloud-eu/opencloud/issues/2681 for more
details.
2026-04-30 11:00:12 +02:00
Florian Schade
d0e3f14539 chore: remove loop var references 2026-04-23 17:11:55 +02:00
Florian Schade
288e67cc39 chore: replace interface with any 2026-04-23 09:31:11 +02:00
Florian Schade
68b356292b Merge pull request #2632 from opencloud-eu/feat/kql-dotted-keys
feat(kql): support dotted keys in property restrictions
2026-04-22 09:45:59 +02:00
Dominik Schmidt
1c58888497 test(kql): capitalise Kleene in dotted-key test comment
Stephen Kleene is a proper noun, so "Kleene star" / "Kleene
closure" is the correct spelling.
2026-04-20 16:42:37 +02:00
Viktor Scharf
6099ca3658 [full-ci] chore: bump reva to v2.43.0 (#2630) 2026-04-20 16:05:48 +02:00
Dominik Schmidt
c7a2ab8d02 test(kql): cover dotted keys in property restrictions
Four cases covering the distinct grammar paths touched by the
new Key rule: dotted key in a TextPropertyRestrictionNode,
multi-level key (stressing the Kleene part), dotted key in a
GroupNode (the k:Key? branch), and a dot on the value side
that must stay a literal character.
2026-04-20 16:05:07 +02:00
Dominik Schmidt
ed1353d161 feat(kql): support dotted keys in property restrictions
Introduce a dedicated Key rule (Char+ ("." Char+)*) so property
restriction keys can contain dots. Queries like
audio.artist:Motörhead or photo.cameraMake:Apple now parse.

Goal: keep the data structure aligned with the query namespace.
A driveItem exposes nested fields as dotted paths in its API
response (photo.cameraMake, location.latitude); users should be
able to query with the same path, without admin-configured slot
mappings or alias tables like Microsoft requires.

Both bleve and OpenSearch already treat dots as the nesting
separator for field paths and pass unknown keys through
unchanged — only the KQL grammar blocked dotted keys via
Char <- [A-Za-z]. The new Key rule lifts that restriction; no
compiler changes or field-alias maintenance is needed.

Values are unaffected — dots in values still parse as literal
characters.
2026-04-20 15:52:14 +02:00
Viktor Scharf
0c8829c15d set version placeholder (#2547) 2026-03-30 14:51:00 +02:00
Viktor Scharf
8f939b93c6 chore: bump reva to v2.42.5 (#2543) 2026-03-30 12:29:40 +02:00
Viktor Scharf
bd649d02ac chore: bump reva to v2.42.5 2026-03-09 12:36:50 +01:00
André Duffeck
2043dee745 Bump opencloud version 2026-02-16 11:02:50 +01:00
Viktor Scharf
2bf70a6f70 reva-bump-2.42.2 2026-02-05 12:29:10 +01:00
Viktor Scharf
e7c14d2ee4 reva-bump-2.42.1 (#2225) 2026-01-28 15:51:15 +01:00
Viktor Scharf
6cefc94493 bump-web-5.0.0 (#2216) 2026-01-26 15:33:43 +01:00
Michael Barz
3654897f60 fix: markdown links formatting (#2143) 2026-01-14 16:19:32 +01:00
Christian Richter
0bada429d3 fix typo in shared_types
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
2026-01-08 15:32:10 +01:00
Christian Richter
cb9815acb1 fix yaml mappings
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
2026-01-08 14:16:31 +01:00