Repository navigation
FastAPI next - #249
Draft
amotl wants to merge 4 commits into
Draft
FastAPI next#249amotl wants to merge 4 commits into
amotl wants to merge 4 commits into
Conversation
added 4 commits
November 26, 2026 23:47
Introduce `patzilla.web`, mapping the concepts of the former Pyramid and Cornice implementation onto FastAPI. - `WebSettings`: Typed settings from the INI file, retaining its format - `AppState`: Application-wide objects, created within the lifespan, replacing the registry and its ZCA utilities - Dependencies for the current user, runtime settings, opaque link parameters, and the upstream clients, replacing request subscribers - `SessionAuthMiddleware`: Session cookie and `X-User-Id` authentication, including sliding session renewal - Exception handlers rendering `ServiceError`, HTTP, and validation errors using the JSON error envelope the frontend expects - Mako templates with page globals, replacing `pyramid_mako` - `client_cache_region`: Beaker cache decorator excluding the upstream client from the cache key, keeping cache keys stable - `patzilla serve`, running the application using uvicorn
Remove the access layer's dependency on the current request. - Upstream clients (EPO OPS, IFI CLAIMS, depa.tech, SIP) are passed as first argument, instead of being acquired from the current request - Client pools are created by factory functions, credentials are resolved from explicit user, vendor, and data source settings - Upstream errors raise `ServiceError` instead of accumulating `request.errors` - HTTP errors use Starlette's `HTTPException` - `RuntimeSettings`, the email submission, and usage metrics receive request, user, and settings explicitly
- Navigator pages, office redirects, and all API services are `APIRouter`s with typed parameters, retaining paths, HTTP methods, parameter names, and response formats - Search endpoints accepting GET and POST read query and form parameters - JSON or XML responses are selected by the `Accept` header - Identity and magic link endpoints use the session middleware and the error envelope; cookie helpers work on Starlette responses - Remove Pyramid subscribers, renderers, and the Cornice patch
- Command line programs bootstrap the application state without an HTTP server, and pass upstream clients explicitly - Tests use FastAPI's `TestClient`, including a comparison of the route table with the former Pyramid application, and the magic link sign-in flow over HTTP - Replace `pserve` and waitress with `patzilla serve` (uvicorn) - Remove Pyramid, Cornice, Akhet, waitress, and Paste dependencies - Update configuration templates, Docker Compose, Makefile, and docs
Contributor
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
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.
Better than GH-248?