You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(utils): read the request via accessors #718
Part of #634. Blocked by the accessors (child A) and by the decisions below.
Switch the remaining modules to the accessors: utils/urls.py (script_root, endpoint, blueprint), utils/logging.py, utils/pagination.py, api/validation.py, errors/exceptions.py (request.endpoint), and the body-size check in factories/connexion_app.py.
Open design questions
Does the snapshot get query, or do query values come only from injected arguments? Pagination needs the raw query to build links.
Does the snapshot carry the operation_id (for URLs and errors), and how does the base-path lookup work without Flask blueprints?
Does the body-size limit (it rewrites wsgi.input at WSGI level) count as server or middleware code, outside the "no request reads" rule?
Acceptance criteria
foca/ reads no request data from flask.request, request_ctx or connexion.request outside the accessor module, apart from what the answers above exempt.
The request snapshot includes the raw query string as a read-only query mapping, so pagination can build its links without reading Flask's request.
The snapshot carries the OpenAPI operation_id. The base path is resolved from FOCA's own spec registry, with no dependency on Flask blueprints.
The body-size limit, which rewrites wsgi.input, counts as middleware and is exempt from the "no direct request reads" rule. It is documented as the one place that touches the raw input and will move to ASGI middleware later.
Activity
uniqueg commentedon Nov 6, 2026
Decisions:
querymapping, so pagination can build its links without reading Flask's request.operation_id. The base path is resolved from FOCA's own spec registry, with no dependency on Flask blueprints.wsgi.input, counts as middleware and is exempt from the "no direct request reads" rule. It is documented as the one place that touches the raw input and will move to ASGI middleware later.fix(utils): take a request's API from its route