RequestContext#

class controller.dependencies.context.RequestContext(request, logger, factory, image_service, lab_manager, _fileserver_manager)#

Bases: object

Holds the incoming request and its surrounding context.

This object is provided to every route handler via a dependency and contains the factory to create service objects, any global singletons that route handlers need to use, and other per-request information that is needed by route handlers.

Parameters:

Attributes Summary

factory

Component factory.

fileserver_manager

File server manager, if file servers are configured.

image_service

Global image service.

lab_manager

User lab state.

logger

Request logger, rebound with discovered context.

request

Incoming request.

Methods Summary

rebind_logger(**values)

Add the given values to the logging context.

Attributes Documentation

factory: Factory#

Component factory.

fileserver_manager#

File server manager, if file servers are configured.

image_service: ImageService#

Global image service.

lab_manager: LabManager#

User lab state.

logger: BoundLogger#

Request logger, rebound with discovered context.

request: Request#

Incoming request.

Methods Documentation

rebind_logger(**values)#

Add the given values to the logging context.

Parameters:

**values (Any) – Additional values that should be added to the logging context.

Return type:

None