Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
c

LiveMountAspect

class LiveMountAspect[R, A, -In, Claims, Ctx]

Produces context immediately before both disconnected and connected LiveView mount.

The disconnected callback runs before the initial HTTP LiveView is built and mounted. Its Claims are JSON-encoded into the signed root LiveView session token, then decoded for the connected callback before a fresh connected LiveView is built and mounted. The two Ctx values are computed independently; only Claims cross the phase boundary.

Claims are authenticated by the session signature but are not encrypted. They are visible to the client and must not contain passwords, session cookie values, private access tokens, or other secrets. Prefer a minimal public identifier, and revalidate revocation and authorization in connected mount. Claim encoding and transport are framework internals, not a stable wire format.

A disconnected failure is the Response returned for the HTTP request. A connected failure is mapped from LiveMountFailure to the socket reply. JSON encoding failure produces an HTTP 500; missing or undecodable claims reject connected mount as unauthorized.

Type parameters

R

the ZIO environment required by the callbacks

A

the route's decoded path-parameter type

In

context supplied by the preceding aspect, or Any for the first aspect

Claims

JSON-serializable data transferred from disconnected to connected mount

Ctx

context produced independently for each mount phase

Defined by scalive.LiveMountAspect. View source (scalive/api/src/scalive/LiveMountAspect.scala:111-155)

Methods2

++

def ++[R1, Claims2, Ctx2, Result](that: LiveMountAspect[R1, A, Ctx, Claims2, Ctx2])(using x$2: zio.json.JsonCodec[(Claims, Claims2)], x$3: ContextAppend.Aux[Ctx, Ctx2, Result]): LiveMountAspect[&[R, R1], A, In, (Claims, Claims2), Result]

Composes two aspects from left to right in both mount phases.

that runs only after this aspect succeeds and receives this aspect's phase-specific Ctx as its input. Both claim values cross the disconnected-to-connected boundary. The resulting context is selected by ContextAppend: the built-in instances discard an initial Any identity context and otherwise produce (Ctx, Ctx2). Existing tuples are not recursively flattened; use map or a custom ContextAppend when another shape is required.

Parameters

that

the aspect to run after this one

Defined by scalive.LiveMountAspect.++. View source (scalive/api/src/scalive/LiveMountAspect.scala:135-153)

map

def map[Ctx2](f: Ctx => Ctx2): LiveMountAspect[R, A, In, Claims, Ctx2]

Transforms this aspect's context in both mount phases without changing its claims or input.

Defined by scalive.LiveMountAspect.map. View source (scalive/api/src/scalive/LiveMountAspect.scala:117-122)