Releases: tomwojcik/starlette-context
Releases · tomwojcik/starlette-context
v0.3.6
v0.3.5
v0.3.4
- add
request_cycle_context
. It’s a context manager that allows for easier testing and cleaner code (Thanks @hhamana) #46 - fix for accessing context during logging, outside of the request-response cycle. Technically it should raise an exception, but it makes sense to include the context by default (in logs) and if it’s not available, some logs are better than no logs. Now it will show context data if context is available, with a fallback to an empty dict (instead of raising an exc) #65
- add
ContextMiddleware
deprecation warning **context
context unpacking seems to be working now
v0.3.3
v0.3.2
ContextDoesNotExistError
is raised when context object can't be accessed. Previously it wasRuntimeError
.
For backwards compatibility, it inherits fromRuntimeError
so it shouldn't result in any regressions.- Added
py.typed
file so your mypy should never complain
v0.3.1
v0.3.0
v0.2.3
0.2.2
- for correlation id and request id plugins, add support for enforcing the generation of a new value
- for ^ plugins add support for validating uuid. It's a default behavior so will break things for people who don't use uuid4 there. If you don't want this validation, you need to pass
validate=False
to the plugin - thanks to @VukW you can now check if context is available
0.2.1
- dropped
with_plugins
from the middleware as Starlette has it's own way of doing this - due to ^ this change some tests are simplified
- if context is not available no LookupError will be raised, instead there will be RuntimeError, because this error might mean one of two things: user either didn't use ContextMiddleware or is trying to access
context
object outside of request-response cycle