Repository navigation
Conversation
… interceptors winter.web.WebApplication(modules, injector, interceptors) replaces winter.application.Application: the code of a web application, its injector and the classes of its interceptors, in the order they run. The injector of each request creates the interceptors, so their dependencies go to __init__, and the URL patterns check their arguments on startup. The process-global interceptor_registry is gone. winter.application keeps find_definitions(modules), which WebApplication uses; modules have no default any more. Adapters and winter.openapi take a WebApplication. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #345.
What
winter.web.WebApplication(modules, injector, interceptors)replaceswinter.application.Application: the code of a web application, its injector and the classes of its interceptors, in the order they run.add(definition)anddefinitionsstay as they were.__init__;create_urlschecks the arguments of theirpre_handleon startup. An instance or a class that is not anInterceptorfails construction.winter.web.interceptor_registryandInterceptorRegistryare gone.winter.applicationkeeps the scan asfind_definitions(modules).moduleshas no default any more: the frame-based "caller directory" broke once the scan is called from inside Winter, and its__main__special case goes with it.winter.django.create_urls,winter.openapi.generate_openapi,serve_specandserve_swagger_uitake aWebApplication.Why
The consumer has three global interceptors. Their order matters in two places and comes from
INSTALLED_APPS, and two of them limit themselves to one service's endpoints by matching the path. A per-application ordered list states the order and removes the path filters.Tests
tests/test_application_scope.py: an interceptor of one application does not run in another.tests/web/test_interceptors.py: interceptors run in the given order, with dependencies from the injector.tests/application/test_definitions.pyandtests/web/test_web_application.pysplit the oldApplicationtests.🤖 Generated with Claude Code