baseplate.lib.edgecontext

Services deep within the backend often need to know information about the client that originated the request, such as what user is authenticated or what country they’re in. Baseplate services can get this information from the edge context which is automatically propagated along with calls between services.

Changed in version 2.0: The implementation built into Baseplate.py was extracted into its own library. See <https://reddit-edgecontext.readthedocs.io/en/latest/> for an example implementation.

class baseplate.lib.edgecontext.EdgeContextFactory[source]

Abstract base for a factory that parses edge context data.

abstract from_upstream(header_value)[source]

Parse a serialized edge context header from an inbound request.

Parameters

header_value (Optional[bytes, None]) – The raw bytes of the header payload.

Return type

Any