Web engine request pipleline
Contents
The runtime serves HTTP requests on port 8080 (customizable) via four purpose-specific endpoints (aka engines)
Engines
A core feature of the XP runtimes is http request handling. port 8080 (customizable) provides four purpose-specific endpoints (aka engines):
Each engine serves a specific purpose and has its own request processing and execution pipeline. However, they all share a common request pipeline:
Contextual API mounts
Universal APIs can be mounted contextually in any of the above HTTP endpoints. The underscore character \_ is reserved to facilitate this without conflicting with other URL patterns.
The special ID provider API, is always available on /_/idprovider/* across all engines, and facilities pluggable authentication and authorization across the board.
TODO reserved URL patterns: TODO: mount in API as well?
Common request pipeline
All web engines share a common request pipeline:
- Vhost filters
-
Request routing based on virtual hosts
- Java request filters
-
Optional system level request filters
- Autologin filter
-
The virtual host contextual ID provider will be invoked, unless a user already exists in the context
- Engine specific pipeline
-
Pipeline of the matching web engine will be executed
- Auth handler
-
Triggered if the pipeline returns a "401: Unauthorized" error code, the contextual ID Provider will be invoked, optionally handling the request
- Error handler
-
If the pipeline returns an unhandled error (everything but "200: OK") that was not handled by an ID Provider, the contextual error handler will kick in.
- Java response filters
-
Optional system level response filters
- Standard error handler
-
Finally, if the request fails with an error that is still unhandled, XP’s standard error handler will kick in