Skip to main content

Module handlers

Module handlers 

Source
Expand description

Generic JMAP method handlers shared across all server crates.

Each function handles one RFC 8620 operation type for any object type O and any backend B: JmapBackend. Domain crates call these for types that have no domain-specific logic beyond the standard wire protocol.

§Backend-error leak policy (bd:JMAP-wlip.2)

Every handler in this module that maps a JmapBackend::Error to a wire-format JmapError::server_fail MUST use the static description SERVER_FAIL_INTERNAL_DESC rather than interpolating the backend error’s Display output. The backend-error contract on JmapBackend::Error (crate::backend::JmapBackend’s associated-type doc comment) forbids credential / blob / PII in Display, but a single accidental violation by a backend implementor would land the leaked text in serverFail.description on every affected response. Stripping the description at the handler layer changes that from a wire-format security incident into a server-side diagnostic gap that the operator can close with its own structured logger wrapping the backend call.

Extension *-server crates with their own per-method handlers SHOULD follow the same pattern; the helper server_fail_from_backend exists so each call site is one line and reviewable at a glance.

Constants§

SERVER_FAIL_INTERNAL_DESC
Static description used for every serverFail invocation that wraps a JmapBackend::Error (bd:JMAP-wlip.2).

Functions§

handle_changes
Generic */changes handler (RFC 8620 §5.2).
handle_get
Generic */get handler (RFC 8620 §5.1).
handle_query
Generic */query handler (RFC 8620 §5.5).
handle_query_changes
Generic */queryChanges handler (RFC 8620 §5.6).
server_fail_from_backend
Construct a JmapError::server_fail for a backend-originated error without echoing the backend error’s Display output onto the wire (bd:JMAP-wlip.2).
server_fail_value_from_backend
Construct the per-id serverFail Value used inside the notCreated/notUpdated/notDestroyed maps of /set responses (bd:JMAP-ic0j.68), without echoing the backend error’s Display output onto the wire.