Account-level capabilities, typed HTTP errors, URL override #1

Open
opened 2026-10-24 09:54:44 +00:00 by mikluko · 0 comments
Owner

Stalwart v0.16.27 cannot be driven through the client as released in 0.27.0. Needed by mikluko/stalwart-operator#11.

Required:

  • Client.Do accepts using URIs the session lists in primaryAccounts or accountCapabilities, not only in capabilities. Stalwart lists urn:stalwart:jmap only per account, so every x:* call is refused before it is sent; the same call POSTed directly gets a 200.
  • An exported HTTP error type carrying the status code, returned by Do and Authenticate, decoding application/problem+json and application/json with parameters. Today only an exact application/json is decoded, and Stalwart's errors come back as untyped strings with no status.

Recommended:

  • An option overriding the API, upload and download URLs. Stalwart's session advertises apiUrl on its configured hostname, which an in-cluster client cannot reach.
  • (*SetError).Error(), so a SetError can be returned as an error.

Findings against a live v0.16.27 container

Stalwart v0.16.27 cannot be driven through the client as released in 0.27.0. Needed by [mikluko/stalwart-operator#11](https://forge.sarak.sh/mikluko/stalwart-operator/issues/11). Required: - `Client.Do` accepts `using` URIs the session lists in `primaryAccounts` or `accountCapabilities`, not only in `capabilities`. Stalwart lists `urn:stalwart:jmap` only per account, so every `x:*` call is refused before it is sent; the same call POSTed directly gets a 200. - An exported HTTP error type carrying the status code, returned by `Do` and `Authenticate`, decoding `application/problem+json` and `application/json` with parameters. Today only an exact `application/json` is decoded, and Stalwart's errors come back as untyped strings with no status. Recommended: - An option overriding the API, upload and download URLs. Stalwart's session advertises `apiUrl` on its configured hostname, which an in-cluster client cannot reach. - `(*SetError).Error()`, so a `SetError` can be returned as an `error`. [Findings against a live v0.16.27 container](https://forge.sarak.sh/mikluko/stalwart-operator/src/branch/research/jmap-client-contract/docs/research/jmap-client-contract.md)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mikluko/jmap#1
No description provided.