pub struct JmapServer;Expand description
JMAP server.
Construct routes with Self::routes_with_auth to wire a real
authentication backend. The bare Self::routes constructor returns a
router that 401s every request and exists primarily for tests that only
exercise the routing surface.
Implementations§
Source§impl JmapServer
impl JmapServer
Sourcepub fn routes_with_auth(auth: SharedAuth) -> Router
pub fn routes_with_auth(auth: SharedAuth) -> Router
Build the JMAP HTTP routes with a real AuthBackend.
Every route is wrapped by the authentication middleware so handlers
receive a guaranteed-present Principal in their extensions, and by the
connection-tracking middleware that maintains
rusmes_active_connections{protocol="jmap"} plus the TLS counter.
This mounts only the core JMAP API endpoints (session + method dispatch).
For blob and EventSource routes, use Self::routes_with_auth_and_state.
Sourcepub fn routes_with_auth_and_state(
auth: SharedAuth,
blob_storage: BlobStorage,
event_manager: EventSourceManager,
) -> Router
pub fn routes_with_auth_and_state( auth: SharedAuth, blob_storage: BlobStorage, event_manager: EventSourceManager, ) -> Router
Build the full JMAP HTTP routes including blob storage and EventSource push.
In addition to the core JMAP routes from Self::routes_with_auth, this
mounts the following endpoints behind the same require_auth middleware:
POST /upload/:account_id— blob upload (RFC 8620 §6.2)GET /download/:account_id/:blob_id/:name— blob download (RFC 8620 §6.2)GET /eventsource— Server-Sent Events push channel (RFC 8620 §7.3)
All routes enforce authentication via require_auth before dispatching
to their respective handlers.
Sourcepub fn routes() -> Router
pub fn routes() -> Router
Build the JMAP HTTP routes WITHOUT an auth backend.
Every request is rejected with 401. This exists so the public API
remains call-compatible during the transition window — callers that
previously relied on the unauthenticated dev path should migrate to
Self::routes_with_auth.
Auto Trait Implementations§
impl Freeze for JmapServer
impl RefUnwindSafe for JmapServer
impl Send for JmapServer
impl Sync for JmapServer
impl Unpin for JmapServer
impl UnsafeUnpin for JmapServer
impl UnwindSafe for JmapServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request