├── .codecov.yml ├── .dockerignore ├── .github ├── FUNDING.yml ├── dependabot.yml └── workflows │ ├── publish_pypi.yml │ ├── publish_test_pypi.yml │ └── test-suite.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .python-version ├── .readthedocs.yml ├── AUTHORS ├── LICENSE ├── Makefile ├── README.md ├── docs ├── Makefile ├── make.bat └── source │ ├── changelog.md │ ├── conf.py │ ├── context.md │ ├── contributing.md │ ├── errors.md │ ├── example.md │ ├── fastapi.md │ ├── index.md │ ├── license.md │ ├── middleware.md │ ├── plugins.md │ ├── quickstart.md │ └── testing.md ├── example ├── Makefile ├── README.md ├── app.py ├── mypy.ini ├── requirements.txt └── setup_logging.py ├── poetry.lock ├── pyproject.toml ├── scripts ├── clean ├── init ├── install └── test ├── starlette_context ├── __init__.py ├── ctx.py ├── errors.py ├── header_keys.py ├── middleware │ ├── __init__.py │ ├── context_middleware.py │ └── raw_middleware.py ├── plugins │ ├── __init__.py │ ├── api_key.py │ ├── base.py │ ├── correlation_id.py │ ├── date_header.py │ ├── forwarded_for.py │ ├── request_id.py │ └── user_agent.py └── py.typed └── tests ├── __init__.py ├── conftest.py ├── test_context ├── __init__.py ├── test_context_existence.py ├── test_context_no_middleware.py ├── test_context_object.py ├── test_context_on_unhandled_exception.py ├── test_context_persistance.py ├── test_context_with_middleware.py ├── test_manager.py └── test_mocked_context_object.py ├── test_middleware ├── __init__.py ├── test_context_middleware.py └── test_pure_asgi_middleware.py ├── test_plugins ├── __init__.py ├── test_api_key.py ├── test_correlation_id.py ├── test_date.py ├── test_error_responses.py ├── test_exceptions.py ├── test_forwarded_for.py ├── test_plugin.py ├── test_request_id.py ├── test_user_agent.py └── test_wrong_plugin.py └── test_starlette_compatibility.py /.codecov.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/.codecov.yml -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | venv 2 | .github 3 | docs 4 | example 5 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [tomwojcik] 4 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/.github/dependabot.yml -------------------------------------------------------------------------------- /.github/workflows/publish_pypi.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/.github/workflows/publish_pypi.yml -------------------------------------------------------------------------------- /.github/workflows/publish_test_pypi.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/.github/workflows/publish_test_pypi.yml -------------------------------------------------------------------------------- /.github/workflows/test-suite.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/.github/workflows/test-suite.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/.gitignore -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/.pre-commit-config.yaml -------------------------------------------------------------------------------- /.python-version: -------------------------------------------------------------------------------- 1 | 3.9.0 2 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/.readthedocs.yml -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/AUTHORS -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/LICENSE -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/Makefile -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/README.md -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/Makefile -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/make.bat -------------------------------------------------------------------------------- /docs/source/changelog.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/source/changelog.md -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/source/conf.py -------------------------------------------------------------------------------- /docs/source/context.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/source/context.md -------------------------------------------------------------------------------- /docs/source/contributing.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/source/contributing.md -------------------------------------------------------------------------------- /docs/source/errors.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/source/errors.md -------------------------------------------------------------------------------- /docs/source/example.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/source/example.md -------------------------------------------------------------------------------- /docs/source/fastapi.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/source/fastapi.md -------------------------------------------------------------------------------- /docs/source/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/source/index.md -------------------------------------------------------------------------------- /docs/source/license.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/source/license.md -------------------------------------------------------------------------------- /docs/source/middleware.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/source/middleware.md -------------------------------------------------------------------------------- /docs/source/plugins.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/source/plugins.md -------------------------------------------------------------------------------- /docs/source/quickstart.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/source/quickstart.md -------------------------------------------------------------------------------- /docs/source/testing.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/docs/source/testing.md -------------------------------------------------------------------------------- /example/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/example/Makefile -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/example/README.md -------------------------------------------------------------------------------- /example/app.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/example/app.py -------------------------------------------------------------------------------- /example/mypy.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/example/mypy.ini -------------------------------------------------------------------------------- /example/requirements.txt: -------------------------------------------------------------------------------- 1 | starlette 2 | uvicorn 3 | structlog 4 | mypy 5 | -------------------------------------------------------------------------------- /example/setup_logging.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/example/setup_logging.py -------------------------------------------------------------------------------- /poetry.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/poetry.lock -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/pyproject.toml -------------------------------------------------------------------------------- /scripts/clean: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/scripts/clean -------------------------------------------------------------------------------- /scripts/init: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/scripts/init -------------------------------------------------------------------------------- /scripts/install: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/scripts/install -------------------------------------------------------------------------------- /scripts/test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/scripts/test -------------------------------------------------------------------------------- /starlette_context/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/__init__.py -------------------------------------------------------------------------------- /starlette_context/ctx.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/ctx.py -------------------------------------------------------------------------------- /starlette_context/errors.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/errors.py -------------------------------------------------------------------------------- /starlette_context/header_keys.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/header_keys.py -------------------------------------------------------------------------------- /starlette_context/middleware/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/middleware/__init__.py -------------------------------------------------------------------------------- /starlette_context/middleware/context_middleware.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/middleware/context_middleware.py -------------------------------------------------------------------------------- /starlette_context/middleware/raw_middleware.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/middleware/raw_middleware.py -------------------------------------------------------------------------------- /starlette_context/plugins/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/plugins/__init__.py -------------------------------------------------------------------------------- /starlette_context/plugins/api_key.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/plugins/api_key.py -------------------------------------------------------------------------------- /starlette_context/plugins/base.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/plugins/base.py -------------------------------------------------------------------------------- /starlette_context/plugins/correlation_id.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/plugins/correlation_id.py -------------------------------------------------------------------------------- /starlette_context/plugins/date_header.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/plugins/date_header.py -------------------------------------------------------------------------------- /starlette_context/plugins/forwarded_for.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/plugins/forwarded_for.py -------------------------------------------------------------------------------- /starlette_context/plugins/request_id.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/plugins/request_id.py -------------------------------------------------------------------------------- /starlette_context/plugins/user_agent.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/starlette_context/plugins/user_agent.py -------------------------------------------------------------------------------- /starlette_context/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/conftest.py -------------------------------------------------------------------------------- /tests/test_context/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test_context/test_context_existence.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_context/test_context_existence.py -------------------------------------------------------------------------------- /tests/test_context/test_context_no_middleware.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_context/test_context_no_middleware.py -------------------------------------------------------------------------------- /tests/test_context/test_context_object.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_context/test_context_object.py -------------------------------------------------------------------------------- /tests/test_context/test_context_on_unhandled_exception.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_context/test_context_on_unhandled_exception.py -------------------------------------------------------------------------------- /tests/test_context/test_context_persistance.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_context/test_context_persistance.py -------------------------------------------------------------------------------- /tests/test_context/test_context_with_middleware.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_context/test_context_with_middleware.py -------------------------------------------------------------------------------- /tests/test_context/test_manager.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_context/test_manager.py -------------------------------------------------------------------------------- /tests/test_context/test_mocked_context_object.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_context/test_mocked_context_object.py -------------------------------------------------------------------------------- /tests/test_middleware/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test_middleware/test_context_middleware.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_middleware/test_context_middleware.py -------------------------------------------------------------------------------- /tests/test_middleware/test_pure_asgi_middleware.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_middleware/test_pure_asgi_middleware.py -------------------------------------------------------------------------------- /tests/test_plugins/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test_plugins/test_api_key.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_plugins/test_api_key.py -------------------------------------------------------------------------------- /tests/test_plugins/test_correlation_id.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_plugins/test_correlation_id.py -------------------------------------------------------------------------------- /tests/test_plugins/test_date.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_plugins/test_date.py -------------------------------------------------------------------------------- /tests/test_plugins/test_error_responses.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_plugins/test_error_responses.py -------------------------------------------------------------------------------- /tests/test_plugins/test_exceptions.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_plugins/test_exceptions.py -------------------------------------------------------------------------------- /tests/test_plugins/test_forwarded_for.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_plugins/test_forwarded_for.py -------------------------------------------------------------------------------- /tests/test_plugins/test_plugin.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_plugins/test_plugin.py -------------------------------------------------------------------------------- /tests/test_plugins/test_request_id.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_plugins/test_request_id.py -------------------------------------------------------------------------------- /tests/test_plugins/test_user_agent.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_plugins/test_user_agent.py -------------------------------------------------------------------------------- /tests/test_plugins/test_wrong_plugin.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_plugins/test_wrong_plugin.py -------------------------------------------------------------------------------- /tests/test_starlette_compatibility.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomwojcik/starlette-context/HEAD/tests/test_starlette_compatibility.py --------------------------------------------------------------------------------