mud_server.api.routes.lab_support
Shared helpers for lab route preconditions and response assembly.
This module keeps the lab router focused on HTTP registration while
centralising repeated session, world, and translation-layer checks.
Functions
|
Raise 403 if the role's hierarchy level is below admin. |
|
Validate one session id and enforce the minimum lab role. |
|
Return an active world or raise a 404 lab-style error. |
|
Return one world's translation service or raise an HTTP error. |
|
Return the world root directory or raise a 404 with route-specific detail. |
|
Construct the stable lab-facing world config payload. |
|
Return the resolved |
|
Persist one |
Module Contents
- mud_server.api.routes.lab_support.require_lab_role(role)[source]
Raise 403 if the role’s hierarchy level is below admin.
- mud_server.api.routes.lab_support.require_lab_session(session_id)[source]
Validate one session id and enforce the minimum lab role.
- Returns:
The validated role string for the current session.
- Return type:
- mud_server.api.routes.lab_support.get_lab_world(engine, world_id)[source]
Return an active world or raise a 404 lab-style error.
- mud_server.api.routes.lab_support.require_translation_world(world, world_id, *, status_code=404)[source]
Return one world’s translation service or raise an HTTP error.
- mud_server.api.routes.lab_support.require_world_root(world, *, unavailable_detail)[source]
Return the world root directory or raise a 404 with route-specific detail.
- mud_server.api.routes.lab_support.build_lab_world_config(world_id, service)[source]
Construct the stable lab-facing world config payload.