RequestContext#
- class gafaelfawr.dependencies.context.RequestContext(request, ip_address, config, logger, 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
) –session (
async_scoped_session
) –factory (
Factory
) –
Attributes Summary
Gafaelfawr's configuration.
The component factory.
IP address of client.
The request logger, rebound with discovered context.
The incoming request.
The database session.
Attributes Documentation
-
logger:
BoundLogger
# The request logger, rebound with discovered context.
-
request:
Request
# The incoming request.
-
session:
async_scoped_session
# The database session.