Manage App Grant Links
grantsA v2 app's grant links (M5). A grant link is a capability URL that confers a declared custom role (x-homespun-manifest.roles) on a stable per-holder anonymous identity, so a holder's own rows are isolated by author/:own scoping. A grant does not escalate to owner, member or agent. Actions: mint creates a link and returns a grant_url carrying the token in its #g= fragment, shown once and not recoverable afterwards; list returns the app's links and never a token; revoke is idempotent. mode 'once' is one-time, claimed by the first browser to open it; 'multi' is shared, capped by max_uses within expiry. An optional pin (pin_row_key or pin_where) narrows a holder to specific rows and never widens their access. One consequence worth knowing when minting: a write-only grant pinned to a single row key can still read that row's existing data back through create dedup, so such a grant exposes that row's current contents to the holder.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | mint only. once: one-time link, claimed by the first browser that opens it (a real per-person link; later opens by others are inert). multi (default): a shared link, capped by max_uses within expiry. | |
| role | No | mint only. A declared custom role for the app (an x-homespun-manifest.roles key). A built-in role (owner/member/agent/anyone) is rejected: a grant can never escalate. | |
| label | No | mint only. Optional owner label shown in the grant list. | |
| action | Yes | mint: create a grant link carrying a declared custom role (app_id+role). list: the app's grant links (app_id). revoke: revoke one link (app_id+grant_id). | |
| app_id | Yes | The app id. | |
| grant_id | No | revoke only. The grant link id (see list's `id` field). | |
| max_uses | No | mint only (multi mode). Cap total claims; omit for unlimited within expiry. Ignored for once (forced to 1). | |
| pin_where | No | mint only. Optional narrowing pin as Wave C2 where conditions ({field, op, value}[]). Narrows within the role (never widens). Mutually exclusive with pin_row_key. | |
| pin_row_key | No | mint only. Optional narrowing pin to a single row key. Narrows within the role (never widens). Mutually exclusive with pin_where. | |
| ttl_seconds | No | mint only. Grant lifetime in seconds; defaults to the server default (30 days) and is clamped to the server max. |