Repository navigation
Conversation
…tion columns (#14502) CollectionAllowlist::validate() rejects non-identifier relations, declared columns that fail is_usable_field_name, and unique_key entries outside the declared set. Translator::new enforces it as a debug assertion (documented construction contract for #13758 registration); resolve_projection refuses field_unsupported on any projection path when a declared column is unsafe, so no select parameter is ever emitted for such a query. Tests: 6 new unit tests (validate accepts/rejects, select-* refusal); withheld/unknown identical-bodies test unchanged and green.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 26 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Closing as superseded by PR #14541 (merged 2026-11-24T18:38:02Z, The two PRs were opened a minute apart by two lanes working the same queue task (23612). A §8 salvage diff of this PR against the merged one is recorded on #14502: Thank you for the parallel work — the record on #14502 carries the full comparison. |
Follow-up to #14391 (merged as dac3cb5, PR #14497).
Declared allowlist names were never validated: a declared column containing a comma, parenthesis, quote, or whitespace — or a reserved name like
or— was joined raw into the PostgRESTselectparameter byresolve_projection, changing the shape of the select list the source parses.Fix:
CollectionAllowlist::validate()inallowlist.rs(relation must be a plain identifier; every declared column must satisfyis_usable_field_name; everyunique_keyentry must be a declared column), with a doc comment stating what is rejected and why.Translator::newcarries it as a debug assertion plus a documented construction contract for the id: impl: Postgres HTTP adapter registration and owner config (from #5805) #13758 registration path (which owns the fallible path).resolve_projectionrefusesfield_unsupportedon every projection path (including*expansion) when any declared column is unsafe, so noselectparameter is emitted for the refused query.unchecked_translator), since they intentionally violate the construction contract.Proof:
cargo test -p id-pggreen — 16 unit (6 new), 2 property, 15 refusal-table (incl. unchangedwithheld_and_unknown_columns_produce_identical_bodies);cargo fmt --checkclean.Closes #14502.
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-24T18:36:58Z", "session_id": "ses_e5df148df67ffe6ESbnQcU7NC7", "lane": null, "host": "amd", "worktree": "/home/user/git/code-g-23612", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/user/git/code-g-23612", "repo": "developing-today/code", "branch": "lane/code-g/23612-id-pg-allowlist-validate", "sha": "461aacb43cd4eab533a9f2ff25bc2559a9924eec" }, "auth_subject": "oc-code-02", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.