@fuzdev/fuz_app 0.159.0 → 0.160.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/actions/CLAUDE.md +7 -2
  2. package/dist/actions/protocol.d.ts +7 -0
  3. package/dist/actions/protocol.d.ts.map +1 -1
  4. package/dist/actions/protocol.js +19 -4
  5. package/dist/auth/CLAUDE.md +32 -11
  6. package/dist/auth/account_schema.d.ts +2 -2
  7. package/dist/auth/account_schema.d.ts.map +1 -1
  8. package/dist/auth/account_schema.js +1 -1
  9. package/dist/auth/role_grant_offer_action_specs.d.ts +2257 -400
  10. package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
  11. package/dist/auth/role_grant_offer_action_specs.js +103 -99
  12. package/dist/auth/role_grant_offer_actions.d.ts +6 -3
  13. package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
  14. package/dist/auth/role_grant_offer_actions.js +15 -6
  15. package/dist/auth/role_grant_offer_notifications.d.ts +1364 -255
  16. package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
  17. package/dist/auth/role_grant_offer_notifications.js +100 -47
  18. package/dist/auth/role_grant_offer_schema.d.ts +90 -22
  19. package/dist/auth/role_grant_offer_schema.d.ts.map +1 -1
  20. package/dist/auth/role_grant_offer_schema.js +40 -39
  21. package/dist/auth/scope_kind_schema.d.ts +6 -1
  22. package/dist/auth/scope_kind_schema.d.ts.map +1 -1
  23. package/dist/auth/scope_kind_schema.js +8 -3
  24. package/dist/auth/scope_kind_schema_fuz.d.ts +30 -0
  25. package/dist/auth/scope_kind_schema_fuz.d.ts.map +1 -0
  26. package/dist/auth/scope_kind_schema_fuz.js +29 -0
  27. package/dist/testing/CLAUDE.md +15 -8
  28. package/dist/testing/cross_backend/default_spine_surface.d.ts +1 -1
  29. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts +15 -3
  30. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
  31. package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +60 -17
  32. package/dist/testing/cross_backend/spine_suites.d.ts +4 -3
  33. package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
  34. package/dist/testing/cross_backend/spine_suites.js +2 -1
  35. package/dist/ui/CLAUDE.md +4 -4
  36. package/dist/ui/admin_accounts_state.svelte.d.ts +8 -8
  37. package/dist/ui/role_grant_offers_state.svelte.d.ts +9 -9
  38. package/dist/ui/role_grant_offers_state.svelte.js +4 -4
  39. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"role_grant_offer_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_grant_offer_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAiB3E,oEAAoE;AACpE,eAAO,MAAM,kCAAkC,EAAG,8BAAuC,CAAC;AAC1F,kEAAkE;AAClE,eAAO,MAAM,+BAA+B,EAAG,2BAAoC,CAAC;AACpF,sDAAsD;AACtD,eAAO,MAAM,8BAA8B,EAAG,0BAAmC,CAAC;AAClF,wGAAwG;AACxG,eAAO,MAAM,gCAAgC,EAAG,4BAAqC,CAAC;AACtF,uIAAuI;AACvI,eAAO,MAAM,yCAAyC,EACrD,qCAA8C,CAAC;AAChD,gKAAgK;AAChK,eAAO,MAAM,qCAAqC,EAAG,iCAA0C,CAAC;AAChG,6FAA6F;AAC7F,eAAO,MAAM,qCAAqC,EAAG,iCAA0C,CAAC;AAChG,wHAAwH;AACxH,eAAO,MAAM,6CAA6C,EACzD,yCAAkD,CAAC;AACpD;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,EAAG,2BAAoC,CAAC;AACpF;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,EAAG,4BAAqC,CAAC;AAC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C;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBL,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,EAAE,KAAK,CAAC,yBAAyB,CAS9E,CAAC"}
@@ -3,9 +3,10 @@
3
3
  * consentful-role-grants surface (offer lifecycle + admin revoke + the
4
4
  * immediate admin-only `role_grant_assign`).
5
5
  *
6
- * Import this module for the specs, Input/Output schemas, `ERROR_ROLE_GRANT_OFFER_*`
7
- * reason constants, and the `all_role_grant_offer_action_specs` registry.
8
- * Handlers live in `auth/role_grant_offer_actions.ts`.
6
+ * Import this module for the specs, Input/Output schemas (`@fuzdev/fuz_schema`
7
+ * schemas), `ERROR_ROLE_GRANT_OFFER_*` reason constants, and the
8
+ * `all_role_grant_offer_action_specs` registry. Handlers live in
9
+ * `auth/role_grant_offer_actions.ts`.
9
10
  *
10
11
  * Authorization enforcement: offer-lifecycle specs declare account+actor
11
12
  * required (no roles) and rely on `query_*` IDOR guards or in-handler
@@ -20,14 +21,15 @@
20
21
  *
21
22
  * @module
22
23
  */
23
- import { z } from 'zod';
24
- import { Uuid, bounded_string } from '../primitive_schemas.js';
24
+ import { meta } from '@fuzdev/fuz_schema/meta.ts';
25
+ import { array, check, integer, literal, max_value, message, min_value, nullable, number, object, optional, pipe, with_default_fn } from '@fuzdev/fuz_schema/schema.ts';
26
+ import { ActingActor, Uuid, bounded_string } from '../primitive_schemas_fuz.js';
25
27
  import { ERROR_INSUFFICIENT_PERMISSIONS, ERROR_LIMIT_INVALID, ERROR_OFFSET_INVALID, ERROR_ROLE_GRANT_NOT_FOUND, ERROR_ROLE_NOT_WEB_GRANTABLE } from '../http/error_schemas.js';
26
- import { RoleName } from './role_schema.js';
27
- import { SCOPE_KIND_LENGTH_MAX, ScopeKindName } from './scope_kind_schema.js';
28
+ import { RoleName } from './role_schema_fuz.js';
29
+ import { SCOPE_KIND_LENGTH_MAX } from './scope_kind_schema.js';
30
+ import { ScopeKindName } from './scope_kind_schema_fuz.js';
28
31
  import { ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX, RoleGrantOfferJson } from './role_grant_offer_schema.js';
29
32
  import { ROLE_GRANT_REVOKED_REASON_LENGTH_MAX } from './account_schema.js';
30
- import { ActingActor } from '../http/auth_shape.js';
31
33
  /** Error reason — caller tried to offer themselves a role_grant. */
32
34
  export const ERROR_ROLE_GRANT_OFFER_SELF_TARGET = 'role_grant_offer_self_target';
33
35
  /** Error reason — offer is declined, retracted, or superseded. */
@@ -70,14 +72,17 @@ export const ERROR_CANNOT_REVOKE_LAST_ADMIN = 'cannot_revoke_last_admin';
70
72
  * Whether a grant input's `scope_kind` + `scope_id` are paired — both absent
71
73
  * (a global grant) or both present (a scoped one), the
72
74
  * `role_grant_scope_kind_paired` / `role_grant_offer_scope_kind_paired`
73
- * CHECKs. The grant inputs refine on it so a half-scoped call is a `-32602`
74
- * rather than a constraint-violation 500.
75
+ * CHECKs. The grant inputs end in a `check` of it so a half-scoped call is a
76
+ * `-32602` rather than a constraint-violation 500.
75
77
  *
76
78
  * @param input - the grant input's scope pair
77
79
  * @returns `true` when both are set or both are absent
78
80
  */
79
81
  export const is_grant_scope_paired = (input) => (input.scope_kind == null) === (input.scope_id == null);
80
- /** The message a half-scoped grant input fails with — the grant inputs' refine, and the UI's pre-RPC guard. */
82
+ /**
83
+ * The message a half-scoped grant input fails with — the grant inputs' check,
84
+ * and the UI's pre-RPC guard.
85
+ */
81
86
  export const GRANT_SCOPE_PAIRED_MESSAGE = "'scope_kind' and 'scope_id' must be given together (both for a scoped grant, neither for a global one)";
82
87
  /**
83
88
  * The `scope_kind` field both grant inputs share, paired with `scope_id`. A
@@ -85,12 +90,18 @@ export const GRANT_SCOPE_PAIRED_MESSAGE = "'scope_kind' and 'scope_id' must be g
85
90
  * index-side `'GLOBAL'` token among it, which with the all-zeros uuid would
86
91
  * otherwise equal a global grant's key in the partial unique indexes.
87
92
  */
88
- const GrantScopeKind = ScopeKindName.nullish().meta({
93
+ const GrantScopeKind = meta(optional(nullable(ScopeKindName)), {
89
94
  description: `Machine-readable kind tag for \`scope_id\` — paired-null with \`scope_id\` (both null for global, both non-null for scoped). Required iff \`scope_id\` is set. A scope-kind name: runs of lowercase letters (a-z) joined by single underscores, at most ${SCOPE_KIND_LENGTH_MAX} characters.`
90
95
  });
96
+ /**
97
+ * The step a grant input ends in, after its object: a half-scoped input fails
98
+ * it with `GRANT_SCOPE_PAIRED_MESSAGE`, as a `check` issue on the input. It
99
+ * runs only on an input whose fields all passed.
100
+ */
101
+ const GrantScopePaired = message(check(is_grant_scope_paired), GRANT_SCOPE_PAIRED_MESSAGE);
91
102
  // -- Input/output schemas ---------------------------------------------------
92
103
  /**
93
- * Input for `role_grant_offer_create`.
104
+ * Input for `role_grant_offer_create`, a `@fuzdev/fuz_schema` schema.
94
105
  *
95
106
  * `to_actor_id` (optional) narrows the offer to a specific actor on the
96
107
  * recipient account. When supplied, `role_grant_offer_accept` will only admit
@@ -100,61 +111,61 @@ const GrantScopeKind = ScopeKindName.nullish().meta({
100
111
  * events. Omit (or pass null) for the account-grain default — any actor
101
112
  * on `to_account_id` may accept.
102
113
  */
103
- export const RoleGrantOfferCreateInput = z
104
- .strictObject({
105
- to_account_id: Uuid.meta({ description: 'Account id of the recipient.' }),
106
- to_actor_id: Uuid.nullish().meta({
114
+ export const RoleGrantOfferCreateInput = pipe(object({
115
+ to_account_id: meta(Uuid, { description: 'Account id of the recipient.' }),
116
+ to_actor_id: meta(optional(nullable(Uuid)), {
107
117
  description: 'Optional actor-grain target on the recipient account. When set, only this actor may accept and the audit envelope carries it on offer-shape events. Must belong to `to_account_id`.'
108
118
  }),
109
- role: RoleName.meta({ description: 'Role being offered.' }),
119
+ role: meta(RoleName, { description: 'Role being offered.' }),
110
120
  scope_kind: GrantScopeKind,
111
- scope_id: Uuid.nullish().meta({
121
+ scope_id: meta(optional(nullable(Uuid)), {
112
122
  description: 'Scope id for resource-scoped grants (e.g. classroom id). `null` for global.'
113
123
  }),
114
- message: bounded_string({ max: ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX })
115
- .nullish()
116
- .meta({ description: 'Optional free-form note from the grantor.' }),
124
+ message: meta(optional(nullable(bounded_string({ max: ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX }))), {
125
+ description: 'Optional free-form note from the grantor.'
126
+ }),
117
127
  acting: ActingActor
118
- })
119
- .refine(is_grant_scope_paired, { message: GRANT_SCOPE_PAIRED_MESSAGE });
120
- /** Input for `role_grant_offer_accept`. */
121
- export const RoleGrantOfferAcceptInput = z.strictObject({
122
- offer_id: Uuid.meta({ description: 'The offer to accept.' }),
128
+ }), GrantScopePaired);
129
+ /** Input for `role_grant_offer_accept`, a `@fuzdev/fuz_schema` schema. */
130
+ export const RoleGrantOfferAcceptInput = object({
131
+ offer_id: meta(Uuid, { description: 'The offer to accept.' }),
123
132
  acting: ActingActor
124
133
  });
125
- /** Input for `role_grant_offer_decline`. */
126
- export const RoleGrantOfferDeclineInput = z.strictObject({
127
- offer_id: Uuid.meta({ description: 'The offer to decline.' }),
128
- reason: bounded_string({ max: ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX })
129
- .nullish()
130
- .meta({ description: 'Optional free-form reason given on decline.' }),
134
+ /** Input for `role_grant_offer_decline`, a `@fuzdev/fuz_schema` schema. */
135
+ export const RoleGrantOfferDeclineInput = object({
136
+ offer_id: meta(Uuid, { description: 'The offer to decline.' }),
137
+ reason: meta(optional(nullable(bounded_string({ max: ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX }))), {
138
+ description: 'Optional free-form reason given on decline.'
139
+ }),
131
140
  acting: ActingActor
132
141
  });
133
- /** Input for `role_grant_offer_retract`. */
134
- export const RoleGrantOfferRetractInput = z.strictObject({
135
- offer_id: Uuid.meta({ description: 'The offer to retract.' }),
142
+ /** Input for `role_grant_offer_retract`, a `@fuzdev/fuz_schema` schema. */
143
+ export const RoleGrantOfferRetractInput = object({
144
+ offer_id: meta(Uuid, { description: 'The offer to retract.' }),
136
145
  acting: ActingActor
137
146
  });
138
- /** Input for `role_grant_offer_list`. `account_id` is admin-only (inspect another account's inbox). */
139
- export const RoleGrantOfferListInput = z
140
- .strictObject({
141
- account_id: Uuid.nullish().meta({
147
+ /**
148
+ * Input for `role_grant_offer_list`, a `@fuzdev/fuz_schema` schema.
149
+ * `account_id` is admin-only (inspect another account's inbox). An omitted
150
+ * input reads as a fresh `{}`.
151
+ */
152
+ export const RoleGrantOfferListInput = with_default_fn(object({
153
+ account_id: meta(optional(nullable(Uuid)), {
142
154
  description: 'Admin-only — list offers for another account. Defaults to the caller.'
143
155
  }),
144
156
  acting: ActingActor
145
- })
146
- .default({});
157
+ }), () => ({}));
147
158
  /**
148
- * Input for `role_grant_revoke`. Admin-only mutation that revokes an active
149
- * role_grant on a target actor. `actor_id` is the natural key — role_grants are
150
- * actor-scoped, and the admin UI reads `row.actor.id` straight from the
151
- * listing. Deriving `actor_id` from `account_id` would collapse under
152
- * multi-actor accounts.
159
+ * Input for `role_grant_revoke`, a `@fuzdev/fuz_schema` schema. Admin-only
160
+ * mutation that revokes an active role_grant on a target actor. `actor_id` is
161
+ * the natural key — role_grants are actor-scoped, and the admin UI reads
162
+ * `row.actor.id` straight from the listing. Deriving `actor_id` from
163
+ * `account_id` would collapse under multi-actor accounts.
153
164
  */
154
- export const RoleGrantRevokeInput = z.strictObject({
155
- actor_id: Uuid.meta({ description: 'Actor whose role_grant to revoke.' }),
156
- role_grant_id: Uuid.meta({ description: 'The role_grant to revoke.' }),
157
- reason: bounded_string({ max: ROLE_GRANT_REVOKED_REASON_LENGTH_MAX }).nullish().meta({
165
+ export const RoleGrantRevokeInput = object({
166
+ actor_id: meta(Uuid, { description: 'Actor whose role_grant to revoke.' }),
167
+ role_grant_id: meta(Uuid, { description: 'The role_grant to revoke.' }),
168
+ reason: meta(optional(nullable(bounded_string({ max: ROLE_GRANT_REVOKED_REASON_LENGTH_MAX }))), {
158
169
  description: 'Optional free-form reason; stamped on `role_grant.revoked_reason` and surfaced on the revokee WS notification.'
159
170
  }),
160
171
  acting: ActingActor
@@ -162,76 +173,69 @@ export const RoleGrantRevokeInput = z.strictObject({
162
173
  /** Max `role_grant_offer_history` page size. */
163
174
  export const ROLE_GRANT_OFFER_HISTORY_LIMIT_MAX = 500;
164
175
  /**
165
- * Input for `role_grant_offer_history`. Returns every offer involving the account
166
- * in either direction (recipient or grantor), including terminal rows, newest
167
- * first. `account_id` is admin-only.
176
+ * Input for `role_grant_offer_history`, a `@fuzdev/fuz_schema` schema. Returns
177
+ * every offer involving the account in either direction (recipient or
178
+ * grantor), including terminal rows, newest first. `account_id` is
179
+ * admin-only. An omitted input reads as a fresh `{}`. `offset` is bounded by
180
+ * `Number.MAX_SAFE_INTEGER`, the integers every number holds exactly.
168
181
  */
169
- export const RoleGrantOfferHistoryInput = z
170
- .strictObject({
171
- account_id: Uuid.nullish().meta({
182
+ export const RoleGrantOfferHistoryInput = with_default_fn(object({
183
+ account_id: meta(optional(nullable(Uuid)), {
172
184
  description: 'Admin-only — history for another account. Defaults to the caller.'
173
185
  }),
174
- limit: z.number().int().min(1).max(ROLE_GRANT_OFFER_HISTORY_LIMIT_MAX).nullish().meta({
175
- description: 'Max rows to return (default 100).',
176
- invalid_reason: ERROR_LIMIT_INVALID
177
- }),
178
- offset: z.number().int().min(0).nullish().meta({
179
- description: 'Pagination offset (default 0).',
180
- invalid_reason: ERROR_OFFSET_INVALID
181
- }),
186
+ limit: meta(optional(nullable(pipe(number, integer, min_value(1), max_value(ROLE_GRANT_OFFER_HISTORY_LIMIT_MAX)))), { description: 'Max rows to return (default 100).', invalid_reason: ERROR_LIMIT_INVALID }),
187
+ offset: meta(optional(nullable(pipe(number, integer, min_value(0), max_value(Number.MAX_SAFE_INTEGER)))), { description: 'Pagination offset (default 0).', invalid_reason: ERROR_OFFSET_INVALID }),
182
188
  acting: ActingActor
183
- })
184
- .default({});
185
- /** Output for `role_grant_offer_create`. */
186
- export const RoleGrantOfferCreateOutput = z.strictObject({
189
+ }), () => ({}));
190
+ /** Output for `role_grant_offer_create`, a `@fuzdev/fuz_schema` schema. */
191
+ export const RoleGrantOfferCreateOutput = object({
187
192
  offer: RoleGrantOfferJson
188
193
  });
189
- /** Output for `role_grant_offer_accept`. */
190
- export const RoleGrantOfferAcceptOutput = z.strictObject({
194
+ /** Output for `role_grant_offer_accept`, a `@fuzdev/fuz_schema` schema. */
195
+ export const RoleGrantOfferAcceptOutput = object({
191
196
  role_grant_id: Uuid,
192
197
  offer: RoleGrantOfferJson,
193
- superseded_offer_ids: z.array(Uuid)
198
+ superseded_offer_ids: array(Uuid)
194
199
  });
195
200
  /** Output for `role_grant_offer_decline` — the declined offer, as `accept` answers its own. */
196
- export const RoleGrantOfferDeclineOutput = z.strictObject({ offer: RoleGrantOfferJson });
201
+ export const RoleGrantOfferDeclineOutput = object({ offer: RoleGrantOfferJson });
197
202
  /** Output for `role_grant_offer_retract` — the retracted offer, as `accept` answers its own. */
198
- export const RoleGrantOfferRetractOutput = z.strictObject({ offer: RoleGrantOfferJson });
199
- /** Output for `role_grant_offer_list`. */
200
- export const RoleGrantOfferListOutput = z.strictObject({ offers: z.array(RoleGrantOfferJson) });
201
- /** Output for `role_grant_offer_history`. */
202
- export const RoleGrantOfferHistoryOutput = z.strictObject({ offers: z.array(RoleGrantOfferJson) });
203
- /** Output for `role_grant_revoke`. */
204
- export const RoleGrantRevokeOutput = z.strictObject({
205
- ok: z.literal(true),
206
- revoked: z.literal(true)
203
+ export const RoleGrantOfferRetractOutput = object({ offer: RoleGrantOfferJson });
204
+ /** Output for `role_grant_offer_list`, a `@fuzdev/fuz_schema` schema. */
205
+ export const RoleGrantOfferListOutput = object({ offers: array(RoleGrantOfferJson) });
206
+ /** Output for `role_grant_offer_history`, a `@fuzdev/fuz_schema` schema. */
207
+ export const RoleGrantOfferHistoryOutput = object({ offers: array(RoleGrantOfferJson) });
208
+ /** Output for `role_grant_revoke`, a `@fuzdev/fuz_schema` schema. */
209
+ export const RoleGrantRevokeOutput = object({
210
+ ok: literal(true),
211
+ revoked: literal(true)
207
212
  });
208
213
  /**
209
- * Input for `role_grant_assign` — the immediate admin-only conferral path, the
210
- * consent-free sibling of `role_grant_offer_create`. An admin assigns a
211
- * role_grant straight onto the target actor; there is no offer for a grantee to
212
- * accept. No `message` (no offer to carry it on). `scope_kind` pairs with
213
- * `scope_id` exactly as on `role_grant_offer_create` — both or neither — and
214
- * the grant row carries the pair.
214
+ * Input for `role_grant_assign`, a `@fuzdev/fuz_schema` schema — the immediate
215
+ * admin-only conferral path, the consent-free sibling of
216
+ * `role_grant_offer_create`. An admin assigns a role_grant straight onto the
217
+ * target actor; there is no offer for a grantee to accept. No `message` (no
218
+ * offer to carry it on). `scope_kind` pairs with `scope_id` exactly as on
219
+ * `role_grant_offer_create` — both or neither — and the grant row carries the
220
+ * pair.
215
221
  */
216
- export const RoleGrantAssignInput = z
217
- .strictObject({
218
- to_account_id: Uuid.meta({ description: 'Account id of the grantee.' }),
219
- to_actor_id: Uuid.nullish().meta({
222
+ export const RoleGrantAssignInput = pipe(object({
223
+ to_account_id: meta(Uuid, { description: 'Account id of the grantee.' }),
224
+ to_actor_id: meta(optional(nullable(Uuid)), {
220
225
  description: "Optional actor-grain target on the grantee account. When set, must belong to `to_account_id`. Omit to resolve the account's sole active actor — a multi-actor account must name one."
221
226
  }),
222
- role: RoleName.meta({
227
+ role: meta(RoleName, {
223
228
  description: "Role to assign. Must be admin-grantable (its `grant_paths` includes `'admin'`)."
224
229
  }),
225
230
  scope_kind: GrantScopeKind,
226
- scope_id: Uuid.nullish().meta({
231
+ scope_id: meta(optional(nullable(Uuid)), {
227
232
  description: 'Scope id for resource-scoped grants. `null` for a global role_grant. Builtin roles are global-only.'
228
233
  }),
229
234
  acting: ActingActor
230
- })
231
- .refine(is_grant_scope_paired, { message: GRANT_SCOPE_PAIRED_MESSAGE });
232
- /** Output for `role_grant_assign`. */
233
- export const RoleGrantAssignOutput = z.strictObject({
234
- ok: z.literal(true),
235
+ }), GrantScopePaired);
236
+ /** Output for `role_grant_assign`, a `@fuzdev/fuz_schema` schema. */
237
+ export const RoleGrantAssignOutput = object({
238
+ ok: literal(true),
235
239
  role_grant_id: Uuid
236
240
  });
237
241
  // -- Action specs -----------------------------------------------------------
@@ -46,9 +46,12 @@
46
46
  *
47
47
  * WS notifications fan out post-commit via `emit_after_commit` when a
48
48
  * `notification_sender` is wired: offer lifecycle transitions notify the
49
- * counterparty, `role_grant_revoke` notifies the revokee plus each superseded
50
- * pending offer's grantor. `role_grant_revoke` of a global grant also closes
51
- * the revokee's connections gated on the role through
49
+ * counterparty, `role_grant_revoke` notifies the revokee (`role_grant_revoked`)
50
+ * plus each superseded
51
+ * pending offer's grantor. Under DEV each notification's params are checked
52
+ * against its spec's schema before it is sent, a mismatch logged
53
+ * (`create_validated_notification_sender`). `role_grant_revoke` of a global
54
+ * grant also closes the revokee's connections gated on the role through
52
55
  * `deps.connection_closer`, after the commit.
53
56
  *
54
57
  * @module
@@ -1 +1 @@
1
- {"version":3,"file":"role_grant_offer_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_grant_offer_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGN,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAMN,KAAK,gBAAgB,EACrB,MAAM,kBAAkB,CAAC;AAgC1B,OAAO,EAGN,KAAK,cAAc,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAE3D,OAAO,EAON,KAAK,kBAAkB,EACvB,MAAM,qCAAqC,CAAC;AA4C7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAC3C,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE;IACN,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,EACD,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EACrB,GAAG,EAAE,aAAa,KACd,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC,qDAAqD;AACrD,MAAM,WAAW,2BAA2B;IAC3C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,0FAA0F;IAC1F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,6BAA6B,CAAC;CAC1C;AA6CD;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,GAC3C,MAAM,yBAAyB,GAAG;IACjC,mBAAmB,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAChD,EACD,UAAS,2BAAgC,KACvC,KAAK,CAAC,SAAS,CAitBjB,CAAC"}
1
+ {"version":3,"file":"role_grant_offer_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_grant_offer_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGN,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAMN,KAAK,gBAAgB,EACrB,MAAM,kBAAkB,CAAC;AAgC1B,OAAO,EAGN,KAAK,cAAc,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAE3D,OAAO,EAQN,KAAK,kBAAkB,EACvB,MAAM,qCAAqC,CAAC;AA4C7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAC3C,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE;IACN,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,EACD,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EACrB,GAAG,EAAE,aAAa,KACd,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC,qDAAqD;AACrD,MAAM,WAAW,2BAA2B;IAC3C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,0FAA0F;IAC1F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,6BAA6B,CAAC;CAC1C;AA6CD;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,GAC3C,MAAM,yBAAyB,GAAG;IACjC,mBAAmB,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAChD,EACD,UAAS,2BAAgC,KACvC,KAAK,CAAC,SAAS,CAutBjB,CAAC"}
@@ -46,9 +46,12 @@
46
46
  *
47
47
  * WS notifications fan out post-commit via `emit_after_commit` when a
48
48
  * `notification_sender` is wired: offer lifecycle transitions notify the
49
- * counterparty, `role_grant_revoke` notifies the revokee plus each superseded
50
- * pending offer's grantor. `role_grant_revoke` of a global grant also closes
51
- * the revokee's connections gated on the role through
49
+ * counterparty, `role_grant_revoke` notifies the revokee (`role_grant_revoked`)
50
+ * plus each superseded
51
+ * pending offer's grantor. Under DEV each notification's params are checked
52
+ * against its spec's schema before it is sent, a mismatch logged
53
+ * (`create_validated_notification_sender`). `role_grant_revoke` of a global
54
+ * grant also closes the revokee's connections gated on the role through
52
55
  * `deps.connection_closer`, after the commit.
53
56
  *
54
57
  * @module
@@ -64,7 +67,7 @@ import { query_role_grant_offer_create, query_role_grant_offer_decline, query_ro
64
67
  import { query_account_has_active_global_role, query_account_has_global_role, query_count_active_accounts_with_global_role_for_update, query_create_role_grant, query_role_grant_find_active_role_for_actor, query_revoke_role_grant } from './role_grant_queries.js';
65
68
  import { query_actor_by_id, query_active_actors_by_account } from './account_queries.js';
66
69
  import { has_scoped_role } from './request_context.js';
67
- import { build_role_grant_offer_accepted_notification, build_role_grant_offer_declined_notification, build_role_grant_offer_received_notification, build_role_grant_offer_retracted_notification, build_role_grant_offer_supersede_notification, build_role_grant_revoke_notification } from './role_grant_offer_notifications.js';
70
+ import { build_role_grant_offer_accepted_notification, build_role_grant_offer_declined_notification, build_role_grant_offer_received_notification, build_role_grant_offer_retracted_notification, build_role_grant_offer_supersede_notification, build_role_grant_revoked_notification, create_validated_notification_sender } from './role_grant_offer_notifications.js';
68
71
  import { ERROR_INSUFFICIENT_PERMISSIONS, ERROR_ROLE_GRANT_NOT_FOUND, ERROR_ROLE_NOT_WEB_GRANTABLE } from '../http/error_schemas.js';
69
72
  import { ERROR_CANNOT_REVOKE_KEEPER_ADMIN, ERROR_CANNOT_REVOKE_LAST_ADMIN, ERROR_ROLE_GRANT_BUILTIN_SCOPED, ERROR_ROLE_GRANT_OFFER_ACTOR_ACCOUNT_MISMATCH, ERROR_ROLE_GRANT_OFFER_ACTOR_MISMATCH, ERROR_ROLE_GRANT_OFFER_EXPIRED, ERROR_ROLE_GRANT_OFFER_NOT_AUTHORIZED, ERROR_ROLE_GRANT_OFFER_NOT_FOUND, ERROR_ROLE_GRANT_OFFER_ROLE_NOT_GRANTABLE, ERROR_ROLE_GRANT_OFFER_SELF_TARGET, ERROR_ROLE_GRANT_OFFER_TERMINAL, role_grant_offer_create_action_spec, role_grant_offer_accept_action_spec, role_grant_offer_decline_action_spec, role_grant_offer_retract_action_spec, role_grant_offer_list_action_spec, role_grant_offer_history_action_spec, role_grant_revoke_action_spec, role_grant_assign_action_spec } from './role_grant_offer_action_specs.js';
70
73
  // -- Helpers ----------------------------------------------------------------
@@ -111,7 +114,12 @@ const default_authorize = async (auth, _input, _deps, _ctx) => {
111
114
  * @returns the `RpcAction` array to spread into a `create_rpc_endpoint` call
112
115
  */
113
116
  export const create_role_grant_offer_actions = (deps, options = {}) => {
114
- const { log, audit, connection_closer, notification_sender = null } = deps;
117
+ const { log, audit, connection_closer } = deps;
118
+ // under DEV each notification sent is checked against its spec's params
119
+ // schema, a mismatch logged, as DEV output validation does
120
+ const notification_sender = deps.notification_sender
121
+ ? create_validated_notification_sender(deps.notification_sender, log)
122
+ : null;
115
123
  const role_specs = options.roles?.role_specs ?? builtin_role_specs_by_name;
116
124
  const default_ttl_ms = options.default_ttl_ms ?? ROLE_GRANT_OFFER_DEFAULT_TTL_MS;
117
125
  const authorize = options.authorize ?? default_authorize;
@@ -563,9 +571,10 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
563
571
  const cause_id = result.id;
564
572
  const reason = input.reason ?? null;
565
573
  emit_after_commit(ctx, () => {
566
- notification_sender.send_to_account(target_account_id, build_role_grant_revoke_notification({
574
+ notification_sender.send_to_account(target_account_id, build_role_grant_revoked_notification({
567
575
  role_grant_id: result.id,
568
576
  role: result.role,
577
+ scope_kind: result.scope_kind,
569
578
  scope_id: result.scope_id,
570
579
  reason
571
580
  }));