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 was extracted into its own library. See <> 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.


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

Return type