Skip to content

POST /datasources/:name/external/validate introspects every federated datasource, not only :name — the route filters validateAll() output after the work is done #10537

Description

@os-elon

Found while implementing #10255 (out of scope there: that card is the capability gate only).

What is true at head

packages/rest/src/external-datasource-routes.ts — the validate route's handler calls svc.validateAll() and then filters the report to the URL's datasource:

  • validateAll() (packages/services/service-datasource/src/external-datasource-service.ts) lists every federated object across every datasource and validates each one, where per-object validation drives introspect(datasource) — a live remote-schema read against that datasource's remote.
  • The route then keeps only r.datasource === req.params.name rows and discards the rest.

So a request scoped by its URL to one datasource performs live remote introspection against all federated datasources, and throws away most of what it measured. The header comment's own words are validateAll (this ds) — the "this ds" half is done by post-filtering, not by scoping the work.

Why it is shaped this way

IExternalDatasourceService (packages/spec/src/contracts/external-datasource-service.ts) offers validateObject(objectName) and validateAll() — there is no per-datasource validate. The route does the best the contract offers.

Why it matters (and why it is not urgent)

Possible directions (triage's call)

  1. Add a per-datasource validate to the contract (e.g. validate objects whose datasource matches, reusing validateObject) and have the route call it. Contract change — needs the usual spec discipline.
  2. Compose in the route/service from existing primitives: listObjects → filter by datasource → validateObject each. No contract change; duplicates validateAll's parallelisation.
  3. Leave it and document the fan-out on the route — cheapest, keeps the wart.

Backlinks: #10255 (capability gate; where this was noticed) · #4264 (this family's failure-contract history).

Unassigned — filed for triage to level and route.


Generated by Claude Code

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions