RequestContext¶
- class gafaelfawr.dependencies.context.RequestContext(request, ip_address, config, logger, events, session, factory)¶
Bases:
object
Holds the incoming request and its surrounding context.
The primary reason for the existence of this class is to allow the functions involved in request processing to repeated rebind the request logger to include more information, without having to pass both the request and the logger separately to every function.
- Parameters:
request (
Request
)ip_address (
str
)config (
Config
)logger (
BoundLogger
)events (
FrontendEvents
)session (
async_scoped_session
)factory (
Factory
)
Attributes Summary
Gafaelfawr's configuration.
Frontend events publishers.
The component factory.
IP address of client.
The request logger, rebound with discovered context.
The incoming request.
The database session.
User cookie state.
Methods Summary
rebind_logger
(**values)Add the given values to the logging context.
Attributes Documentation
-
events:
FrontendEvents
¶ Frontend events publishers.
-
logger:
BoundLogger
¶ The request logger, rebound with discovered context.
-
request:
Request
¶ The incoming request.
-
session:
async_scoped_session
¶ The database session.
- state¶
User cookie state.
Methods Documentation