Skip to content

Releases: tomwojcik/starlette-context

v0.3.6

16 Feb 22:08
Compare
Choose a tag to compare
  • fix for being unable to catch some exceptions with a try/except due to base exc inheriting from the BaseException (Thanks @soundstripe) #90
  • minimal Python version required is now 3.8

v0.3.5

26 Nov 15:30
Compare
Choose a tag to compare
  • fix for accessing the context in error handlers (Thanks @hhamana) #74

v0.3.4

22 Jun 07:48
Compare
Choose a tag to compare
  • 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

28 Jun 14:48
Compare
Choose a tag to compare
  • add support for custom error responses if error occurred in plugin / middleware -> fix for 500 (Thanks @hhamana)
  • better (custom) exceptions with a base StarletteContextError (Thanks @hhamana)

v0.3.2

22 Apr 19:45
Compare
Choose a tag to compare
  • ContextDoesNotExistError is raised when context object can't be accessed. Previously it was RuntimeError.
    For backwards compatibility, it inherits from RuntimeError so it shouldn't result in any regressions.
  • Added py.typed file so your mypy should never complain

v0.3.1

17 Oct 13:46
Compare
Choose a tag to compare
  • add ApiKeyPlugin plugin for X-API-Key header

v0.3.0

10 Oct 20:28
Compare
Choose a tag to compare
  • add RawContextMiddleware for Streaming and File responses
  • add flake8, isort, mypy
  • small refactor of the base plugin, moved directories and removed one redundant method (potentially breaking changes)

v0.2.3

27 Jul 18:56
Compare
Choose a tag to compare
  • add docs on read the docs
  • fix bug with force_new_uuid=True returning the same uuid constantly
  • due to ^ a lot of tests had to be refactored as well

0.2.2

26 Apr 16:12
92b2829
Compare
Choose a tag to compare
  • 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

18 Apr 17:20
79aa8ff
Compare
Choose a tag to compare
  • 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