You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(cli): add worked manifest example with views + rpcs slices
The RPC entry shape (signature regex, grant_to roles) was only visible
in the JSON Schema — every worked example in llms-cli.txt showed
tables-only manifests. Adds a full example next to the policy table
and spells out the signature regex constraint and role enumeration in
prose, so agents don't have to fetch the schema to author RPC grants.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: cli/llms-cli.txt
+22Lines changed: 22 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -672,6 +672,28 @@ Built-in policies (one per table):
672
672
673
673
`—` = denied. `service_key` bypasses all policies. **Views** are always created with `security_invoker=true` — they inherit the underlying table's RLS. **RPCs** require an entry in `rpcs[*]` with `grant_to` to be callable as `/rest/v1/rpc/<fn>` (since v1.30, `CREATE FUNCTION` revokes PUBLIC EXECUTE automatically).
674
674
675
+
Worked example covering all three slices (drop in as `manifest.json` or under `database.expose` in a deploy manifest):
`rpcs[*].signature` is the parenthesized argument list — `"()"` for no-arg functions, `"(arg_name type, ...)"` otherwise. The schema regex is `^\([^;]*\)$` (no semicolons, parentheses required). `grant_to` is a non-empty array of Postgres roles — typically `anon`, `authenticated`, `service_role`, or `project_admin`. The function must already exist in your migration SQL with a matching signature; the manifest only grants EXECUTE. Views require `base` plus a non-empty `select`; they are always created `security_invoker=true` and inherit the base table's RLS.
696
+
675
697
**Imperative escape hatch:** for ad-hoc changes outside a deploy, use `run402 projects apply-expose <project_id> --file manifest.json`. Inspect current state with `run402 projects get-expose <project_id>` — `source: "applied"` means it came from a prior apply; `"introspected"` means it was reconstructed from live DB state.
676
698
677
699
The manifest is **convergent**: applying the same manifest twice is a no-op; items removed between applies have their policies revoked, grants revoked, triggers dropped, views dropped. Include everything you want exposed in every apply.
0 commit comments