webstation-broker
DeveloperPython reference

api

REST endpoints for the session lifecycle and the room frontend's bootstrap.

REST endpoints for the session lifecycle and the room frontend's bootstrap.

Covers activate, join, invite, exit and status, the save-state, disc-swap and memory-card routes, the save archive import and export routes, and the context endpoint the room frontend bootstraps from. All endpoints live under the SUBFOLDER prefix; the RomM-facing ones require X-Broker-Secret when BROKER_SECRET is set.

attributelog
= logging.getLogger(__name__)
attributerouter
= APIRouter()

Routes with their own credential: health, and those the room frontend calls with a seat token.

attributesecret_router
= APIRouter(dependencies=[Depends(_require_secret)])

Every RomM-facing route. The secret is checked before any route's own parameters are, so a new route here is gated without having to remember to be.

attributeTOKEN_CLEAR_GRACE_SECONDS
= 1.5

Seconds the room gets between being told the session ended and losing its tokens.

Selkies errors on a connected client whose token vanished, so browsers are given this long to tear the stream iframe down before the token set empties.

attributeKNOWN_SAVE_TARGET_LAYOUTS
= frozenset({'folder-exact', 'folder-prefix', 'file-exact', 'file-prefix', 'folder-split'})

The save_target_layout values RomM is known to send.

Any other value is logged and passed through: RomM may add layouts before the broker learns them, and a launch must never fail over a hint.