omnigraph/crates/omnigraph-server/src
Ragnor Comerford d67b10fa6e
Add POST /queries/{name} stored-query invocation handler
Invoke a curated server-side stored query by name: source + name come from
the per-graph queries: registry, the client sends only runtime inputs
(params, branch, snapshot). Gated by the invoke_query Cedar action at the
boundary; the handler delegates to the existing run_query/run_mutate, whose
inner Read/Change enforce still runs — so a stored mutation is double-gated
(invoke_query to reach the tool, change for the write).

- InvokeStoredQueryRequest + an untagged InvokeStoredQueryResponse
  { Read(ReadOutput), Change(ChangeOutput) } → one Json<_> return type and a
  oneOf 200 schema (a correct contract, not a wrong-but-simple one).
- Route lives in per_graph_protected → single-mode /queries/{name} and
  multi-mode /graphs/{id}/queries/{name} for free.
- Deny == unknown: an invoke_query denial and a missing query both return the
  same 404, so the catalog can't be probed by an unauthorized caller.
- OpenAPI regenerated; tests cover read, mutation double-gate (403 vs 200),
  bad-param 400, and the identical-404 deny path.

Completes the MR-969 V1 invocation slice (registry + /queries/{name} + invoke_query).
2026-05-30 22:36:56 +02:00
..
api.rs Add POST /queries/{name} stored-query invocation handler 2026-05-30 22:36:56 +02:00
auth.rs (feat): multi-graph server mode (#119) 2026-05-28 16:19:31 +02:00
config.rs Route registry selection through one shared query_entries_for 2026-05-30 21:53:07 +02:00
graph_id.rs (feat): multi-graph server mode (#119) 2026-05-28 16:19:31 +02:00
identity.rs (feat): multi-graph server mode (#119) 2026-05-28 16:19:31 +02:00
lib.rs Add POST /queries/{name} stored-query invocation handler 2026-05-30 22:36:56 +02:00
main.rs Rename repo terminology to graph (#118) 2026-05-24 16:46:00 +01:00
policy.rs policy: chassis core — omnigraph-policy crate + Omnigraph::enforce() (MR-722) (#102) 2026-05-18 00:36:36 +03:00
queries.rs Refuse duplicate MCP tool names across exposed stored queries 2026-05-30 22:05:18 +02:00
registry.rs Add stored-query registry loader and GraphHandle wiring 2026-05-30 15:29:00 +02:00
workload.rs (feat): multi-graph server mode (#119) 2026-05-28 16:19:31 +02:00