Repository navigation
Closed
Labels
priority: highHigh prioritystatus: in progressCurrently being worked ontype flag: breaking changeProposed change breaks current APItype: maintenanceRelated to general repository maintenancetype: securityRelated to securityworkload: daysLikely takes days to resolve
Description
Part of #321: steps 2 "Engine", 3 "Routing and forwarding", 5 "Config" (plugins section, custom.middlewares refused), 7 "Tags", 8 "Deleted", 9 "Errors", 11 "Docs" and 12 "Tests", as decided there. Provenance and the chart's plugins values are separate children.
Problem
proTES runs its own middleware engine (pro_tes/middleware/), and the routing result travels inside the task body (tes_urls).
Proposal
As in #321:
- proTES declares itself a gateway (
Foca(..., gateway=GatewayApp(api="tes", validate=..., sanitize=..., backends=...)), shared with the Celery worker module);POST /tasksbuilds the inbound request and principal withfoca.plugins.adapterin the controller and passes them toTaskRuns.create_task(), which stays free of Flask;_apply_middlewares()is replaced byrun = get_host().start(...),run.request()andrun.route(...);validate=TesTaskandtes.Task,sanitize= URL credential stripping and the inline content limit; order of the security checks unchanged. - The forward loop runs over
run.attempts(candidates);TesClientsends eachOutboundRequestand adds the backend's credentials after the plugins; outcomes map as in refactor!: run task plugins with FOCA #321 (not accepted → next; outcome unknown → stop,SYSTEM_ERROR;ForwardTimeout/NoBackendAvailable→503). - Default pipeline
foca.routing.ordered;custom.middlewaresrefused by FOCA with its hint. - Tags: client tags kept in the stored task; no
gateway.*key in the relayed task (strip_for_forwarding); other clientgateway.*keys →400. - Deleted:
pro_tes/middleware/,pro_tes/plugins/middlewares/,MiddlewareException,InvalidMiddleware,geopyand its mypy override, thetes_urlshandling. - FOCA's problem types in
exceptions.mapping. - Docs:
docs/middleware.mdbecomesdocs/plugins.md(operator view); API, access control, operations pages; "Upgrading" (routing change: ordered failover instead of distance-then-random, no third-party lookups by default; random and distance routing in foca-plugins). - Tests with fake plugins via FOCA's
fake_plugin_entry_pointsfixture; every forward outcome; 100% coverage; ast-grep: no Flask, Werkzeug or Connexion import inpro_tes/outsideapp.py,server.pyandexceptions.py.
Acceptance criteria
The acceptance criteria of #321 except provenance and the chart's plugins values.
Metadata
Metadata
Assignees
Labels
priority: highHigh prioritystatus: in progressCurrently being worked ontype flag: breaking changeProposed change breaks current APItype: maintenanceRelated to general repository maintenancetype: securityRelated to securityworkload: daysLikely takes days to resolve
Activity