Skip to content

finding: the two listRemoteTables route twins diverge on ?schema= — the admin spelling drops it #7955

Description

@hotlong

Symptom

IExternalDatasourceService.listRemoteTables is reachable through two live routes:

routepackagecall
GET /api/v1/datasources/:name/external/tablespackages/rest/src/external-datasource-routes.tslistRemoteTables(name, { schema })
GET /api/v1/datasources/:name/remote-tablespackages/services/service-datasource/src/admin-routes.tslistRemoteTables(name)

The federation spelling forwards ?schema=; the admin spelling does not read the query at all, so a caller that passes ?schema=public to it silently gets the unfiltered result rather than an error or the filtered set.

The same twin relationship holds for generateObjectDraft (POST /:name/object-draft vs POST /:name/external/tables/:remote/draft), which does forward its options bag — so this divergence is specific to the schema filter on the listing route.

Why this is a finding and not part of #7744

The twins are known and deliberate: #4249 reconciled their failure contract ("One operation, one failure contract now, on both paths", external-datasource-routes.ts) rather than removing either. #7744 ledgered the admin spelling at its live path and was explicitly scoped away from renaming or removing a live route. What #4249 reconciled was the error path; the request path was never compared, and this is the residue.

Options

  1. Forward req.query.schema on the admin route so the twins accept the same request shape (smallest change; makes the paths interchangeable, which is what "one operation" implies).
  2. Leave it, and record the divergence as intended — in which case the admin route arguably ought to refuse an unsupported query parameter rather than ignore it, since silently dropping a filter is the "declared ≠ enforced" shape (Prime Directive chore: version packages #10).

Not fixed in #7744 because either option changes request-handling behaviour on a live route, which that card ruled out of scope.

Reproduction

GET /api/v1/datasources/<name>/remote-tables?schema=public and GET /api/v1/datasources/<name>/external/tables?schema=public against the same datasource: the second is filtered, the first is not.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions