@fuzdev/fuz_app 0.158.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 (73) 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 +40 -15
  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/audit_log_route_schema.d.ts +18 -6
  10. package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
  11. package/dist/auth/audit_log_route_schema.js +7 -3
  12. package/dist/auth/credential_type_schema.d.ts +4 -4
  13. package/dist/auth/credential_type_schema.d.ts.map +1 -1
  14. package/dist/auth/credential_type_schema.js +6 -6
  15. package/dist/auth/grant_path_schema.d.ts +4 -4
  16. package/dist/auth/grant_path_schema.d.ts.map +1 -1
  17. package/dist/auth/grant_path_schema.js +6 -6
  18. package/dist/auth/request_context.js +1 -1
  19. package/dist/auth/role_grant_offer_action_specs.d.ts +2257 -400
  20. package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
  21. package/dist/auth/role_grant_offer_action_specs.js +109 -102
  22. package/dist/auth/role_grant_offer_actions.d.ts +6 -3
  23. package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
  24. package/dist/auth/role_grant_offer_actions.js +15 -6
  25. package/dist/auth/role_grant_offer_ddl.d.ts +5 -4
  26. package/dist/auth/role_grant_offer_ddl.d.ts.map +1 -1
  27. package/dist/auth/role_grant_offer_ddl.js +5 -4
  28. package/dist/auth/role_grant_offer_notifications.d.ts +1364 -255
  29. package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
  30. package/dist/auth/role_grant_offer_notifications.js +100 -47
  31. package/dist/auth/role_grant_offer_schema.d.ts +90 -22
  32. package/dist/auth/role_grant_offer_schema.d.ts.map +1 -1
  33. package/dist/auth/role_grant_offer_schema.js +40 -39
  34. package/dist/auth/role_schema.d.ts +15 -2
  35. package/dist/auth/role_schema.d.ts.map +1 -1
  36. package/dist/auth/role_schema.js +17 -4
  37. package/dist/auth/role_schema_fuz.d.ts +29 -0
  38. package/dist/auth/role_schema_fuz.d.ts.map +1 -0
  39. package/dist/auth/role_schema_fuz.js +28 -0
  40. package/dist/auth/scope_kind_schema.d.ts +27 -15
  41. package/dist/auth/scope_kind_schema.d.ts.map +1 -1
  42. package/dist/auth/scope_kind_schema.js +30 -18
  43. package/dist/auth/scope_kind_schema_fuz.d.ts +30 -0
  44. package/dist/auth/scope_kind_schema_fuz.d.ts.map +1 -0
  45. package/dist/auth/scope_kind_schema_fuz.js +29 -0
  46. package/dist/auth/self_service_role_action_specs.d.ts +70 -27
  47. package/dist/auth/self_service_role_action_specs.d.ts.map +1 -1
  48. package/dist/auth/self_service_role_action_specs.js +16 -14
  49. package/dist/auth/token_scope.d.ts +3 -2
  50. package/dist/auth/token_scope.d.ts.map +1 -1
  51. package/dist/auth/token_scope.js +4 -3
  52. package/dist/http/CLAUDE.md +6 -0
  53. package/dist/http/db_routes.d.ts.map +1 -1
  54. package/dist/http/db_routes.js +8 -3
  55. package/dist/server/serve_fact_route.d.ts.map +1 -1
  56. package/dist/server/serve_fact_route.js +3 -2
  57. package/dist/server/surface_route.d.ts.map +1 -1
  58. package/dist/server/surface_route.js +3 -2
  59. package/dist/testing/CLAUDE.md +27 -16
  60. package/dist/testing/cross_backend/default_spine_surface.d.ts +1 -1
  61. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts +15 -3
  62. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
  63. package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +60 -17
  64. package/dist/testing/cross_backend/role_grant_role_grammar.d.ts.map +1 -1
  65. package/dist/testing/cross_backend/role_grant_role_grammar.js +94 -6
  66. package/dist/testing/cross_backend/spine_suites.d.ts +4 -3
  67. package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
  68. package/dist/testing/cross_backend/spine_suites.js +2 -1
  69. package/dist/ui/CLAUDE.md +4 -4
  70. package/dist/ui/admin_accounts_state.svelte.d.ts +8 -8
  71. package/dist/ui/role_grant_offers_state.svelte.d.ts +9 -9
  72. package/dist/ui/role_grant_offers_state.svelte.js +4 -4
  73. 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;AACtF;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,EAAG,0BAAmC,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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';
28
+ import { RoleName } from './role_schema_fuz.js';
27
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,24 +72,36 @@ 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
- /** The `scope_kind` field both grant inputs share, paired with `scope_id`. */
83
- const GrantScopeKind = bounded_string({ max: SCOPE_KIND_LENGTH_MAX })
84
- .nullish()
85
- .meta({
86
- 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. At most ${SCOPE_KIND_LENGTH_MAX} characters.`
87
+ /**
88
+ * The `scope_kind` field both grant inputs share, paired with `scope_id`. A
89
+ * `ScopeKindName`, so off the grammar is refused at validation: the
90
+ * index-side `'GLOBAL'` token among it, which with the all-zeros uuid would
91
+ * otherwise equal a global grant's key in the partial unique indexes.
92
+ */
93
+ const GrantScopeKind = meta(optional(nullable(ScopeKindName)), {
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.`
87
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);
88
102
  // -- Input/output schemas ---------------------------------------------------
89
103
  /**
90
- * Input for `role_grant_offer_create`.
104
+ * Input for `role_grant_offer_create`, a `@fuzdev/fuz_schema` schema.
91
105
  *
92
106
  * `to_actor_id` (optional) narrows the offer to a specific actor on the
93
107
  * recipient account. When supplied, `role_grant_offer_accept` will only admit
@@ -97,61 +111,61 @@ const GrantScopeKind = bounded_string({ max: SCOPE_KIND_LENGTH_MAX })
97
111
  * events. Omit (or pass null) for the account-grain default — any actor
98
112
  * on `to_account_id` may accept.
99
113
  */
100
- export const RoleGrantOfferCreateInput = z
101
- .strictObject({
102
- to_account_id: Uuid.meta({ description: 'Account id of the recipient.' }),
103
- 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)), {
104
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`.'
105
118
  }),
106
- role: RoleName.meta({ description: 'Role being offered.' }),
119
+ role: meta(RoleName, { description: 'Role being offered.' }),
107
120
  scope_kind: GrantScopeKind,
108
- scope_id: Uuid.nullish().meta({
121
+ scope_id: meta(optional(nullable(Uuid)), {
109
122
  description: 'Scope id for resource-scoped grants (e.g. classroom id). `null` for global.'
110
123
  }),
111
- message: bounded_string({ max: ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX })
112
- .nullish()
113
- .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
+ }),
114
127
  acting: ActingActor
115
- })
116
- .refine(is_grant_scope_paired, { message: GRANT_SCOPE_PAIRED_MESSAGE });
117
- /** Input for `role_grant_offer_accept`. */
118
- export const RoleGrantOfferAcceptInput = z.strictObject({
119
- 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.' }),
120
132
  acting: ActingActor
121
133
  });
122
- /** Input for `role_grant_offer_decline`. */
123
- export const RoleGrantOfferDeclineInput = z.strictObject({
124
- offer_id: Uuid.meta({ description: 'The offer to decline.' }),
125
- reason: bounded_string({ max: ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX })
126
- .nullish()
127
- .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
+ }),
128
140
  acting: ActingActor
129
141
  });
130
- /** Input for `role_grant_offer_retract`. */
131
- export const RoleGrantOfferRetractInput = z.strictObject({
132
- 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.' }),
133
145
  acting: ActingActor
134
146
  });
135
- /** Input for `role_grant_offer_list`. `account_id` is admin-only (inspect another account's inbox). */
136
- export const RoleGrantOfferListInput = z
137
- .strictObject({
138
- 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)), {
139
154
  description: 'Admin-only — list offers for another account. Defaults to the caller.'
140
155
  }),
141
156
  acting: ActingActor
142
- })
143
- .default({});
157
+ }), () => ({}));
144
158
  /**
145
- * Input for `role_grant_revoke`. Admin-only mutation that revokes an active
146
- * role_grant on a target actor. `actor_id` is the natural key — role_grants are
147
- * actor-scoped, and the admin UI reads `row.actor.id` straight from the
148
- * listing. Deriving `actor_id` from `account_id` would collapse under
149
- * 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.
150
164
  */
151
- export const RoleGrantRevokeInput = z.strictObject({
152
- actor_id: Uuid.meta({ description: 'Actor whose role_grant to revoke.' }),
153
- role_grant_id: Uuid.meta({ description: 'The role_grant to revoke.' }),
154
- 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 }))), {
155
169
  description: 'Optional free-form reason; stamped on `role_grant.revoked_reason` and surfaced on the revokee WS notification.'
156
170
  }),
157
171
  acting: ActingActor
@@ -159,76 +173,69 @@ export const RoleGrantRevokeInput = z.strictObject({
159
173
  /** Max `role_grant_offer_history` page size. */
160
174
  export const ROLE_GRANT_OFFER_HISTORY_LIMIT_MAX = 500;
161
175
  /**
162
- * Input for `role_grant_offer_history`. Returns every offer involving the account
163
- * in either direction (recipient or grantor), including terminal rows, newest
164
- * 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.
165
181
  */
166
- export const RoleGrantOfferHistoryInput = z
167
- .strictObject({
168
- account_id: Uuid.nullish().meta({
182
+ export const RoleGrantOfferHistoryInput = with_default_fn(object({
183
+ account_id: meta(optional(nullable(Uuid)), {
169
184
  description: 'Admin-only — history for another account. Defaults to the caller.'
170
185
  }),
171
- limit: z.number().int().min(1).max(ROLE_GRANT_OFFER_HISTORY_LIMIT_MAX).nullish().meta({
172
- description: 'Max rows to return (default 100).',
173
- invalid_reason: ERROR_LIMIT_INVALID
174
- }),
175
- offset: z.number().int().min(0).nullish().meta({
176
- description: 'Pagination offset (default 0).',
177
- invalid_reason: ERROR_OFFSET_INVALID
178
- }),
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 }),
179
188
  acting: ActingActor
180
- })
181
- .default({});
182
- /** Output for `role_grant_offer_create`. */
183
- export const RoleGrantOfferCreateOutput = z.strictObject({
189
+ }), () => ({}));
190
+ /** Output for `role_grant_offer_create`, a `@fuzdev/fuz_schema` schema. */
191
+ export const RoleGrantOfferCreateOutput = object({
184
192
  offer: RoleGrantOfferJson
185
193
  });
186
- /** Output for `role_grant_offer_accept`. */
187
- export const RoleGrantOfferAcceptOutput = z.strictObject({
194
+ /** Output for `role_grant_offer_accept`, a `@fuzdev/fuz_schema` schema. */
195
+ export const RoleGrantOfferAcceptOutput = object({
188
196
  role_grant_id: Uuid,
189
197
  offer: RoleGrantOfferJson,
190
- superseded_offer_ids: z.array(Uuid)
198
+ superseded_offer_ids: array(Uuid)
191
199
  });
192
200
  /** Output for `role_grant_offer_decline` — the declined offer, as `accept` answers its own. */
193
- export const RoleGrantOfferDeclineOutput = z.strictObject({ offer: RoleGrantOfferJson });
201
+ export const RoleGrantOfferDeclineOutput = object({ offer: RoleGrantOfferJson });
194
202
  /** Output for `role_grant_offer_retract` — the retracted offer, as `accept` answers its own. */
195
- export const RoleGrantOfferRetractOutput = z.strictObject({ offer: RoleGrantOfferJson });
196
- /** Output for `role_grant_offer_list`. */
197
- export const RoleGrantOfferListOutput = z.strictObject({ offers: z.array(RoleGrantOfferJson) });
198
- /** Output for `role_grant_offer_history`. */
199
- export const RoleGrantOfferHistoryOutput = z.strictObject({ offers: z.array(RoleGrantOfferJson) });
200
- /** Output for `role_grant_revoke`. */
201
- export const RoleGrantRevokeOutput = z.strictObject({
202
- ok: z.literal(true),
203
- 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)
204
212
  });
205
213
  /**
206
- * Input for `role_grant_assign` — the immediate admin-only conferral path, the
207
- * consent-free sibling of `role_grant_offer_create`. An admin assigns a
208
- * role_grant straight onto the target actor; there is no offer for a grantee to
209
- * accept. No `message` (no offer to carry it on). `scope_kind` pairs with
210
- * `scope_id` exactly as on `role_grant_offer_create` — both or neither — and
211
- * 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.
212
221
  */
213
- export const RoleGrantAssignInput = z
214
- .strictObject({
215
- to_account_id: Uuid.meta({ description: 'Account id of the grantee.' }),
216
- 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)), {
217
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."
218
226
  }),
219
- role: RoleName.meta({
227
+ role: meta(RoleName, {
220
228
  description: "Role to assign. Must be admin-grantable (its `grant_paths` includes `'admin'`)."
221
229
  }),
222
230
  scope_kind: GrantScopeKind,
223
- scope_id: Uuid.nullish().meta({
231
+ scope_id: meta(optional(nullable(Uuid)), {
224
232
  description: 'Scope id for resource-scoped grants. `null` for a global role_grant. Builtin roles are global-only.'
225
233
  }),
226
234
  acting: ActingActor
227
- })
228
- .refine(is_grant_scope_paired, { message: GRANT_SCOPE_PAIRED_MESSAGE });
229
- /** Output for `role_grant_assign`. */
230
- export const RoleGrantAssignOutput = z.strictObject({
231
- 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),
232
239
  role_grant_id: Uuid
233
240
  });
234
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
  }));
@@ -17,10 +17,11 @@
17
17
  /** Sentinel UUID used inside the partial unique indexes to collapse `scope_id IS NULL` into a comparable value. */
18
18
  export declare const ROLE_GRANT_OFFER_SCOPE_SENTINEL_UUID = "00000000-0000-0000-0000-000000000000";
19
19
  /**
20
- * Index-side token for the global case in the partial unique index. Uppercase
21
- * so it cannot collide with consumer-declared `ScopeKindName` values (which
22
- * are lowercase by regex). Never appears as a column value — column-level
23
- * `scope_kind = NULL` and `scope_id = NULL` together encode the global case.
20
+ * Index-side token for the global case in the partial unique index.
21
+ * Uppercase, so it is off the `ScopeKindName` grammar: no registry declares
22
+ * it, and the grant inputs refuse it, so no row they write holds it.
23
+ * Column-level `scope_kind = NULL` and `scope_id = NULL` together encode the
24
+ * global case.
24
25
  */
25
26
  export declare const ROLE_GRANT_OFFER_SCOPE_KIND_GLOBAL_TOKEN = "GLOBAL";
26
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"role_grant_offer_ddl.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_grant_offer_ddl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,mHAAmH;AACnH,eAAO,MAAM,oCAAoC,yCAAyC,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,wCAAwC,WAAW,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,4QAkBmB,CAAC;AAEzD;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,8DAQhC,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,oCAAoC,QAMI,CAAC;AAKtD,eAAO,MAAM,uBAAuB,qzCAkClC,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qCAAqC,2XAYpB,CAAC;AAE/B,+EAA+E;AAC/E,eAAO,MAAM,4BAA4B,kOAMX,CAAC"}
1
+ {"version":3,"file":"role_grant_offer_ddl.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_grant_offer_ddl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,mHAAmH;AACnH,eAAO,MAAM,oCAAoC,yCAAyC,CAAC;AAE3F;;;;;;GAMG;AACH,eAAO,MAAM,wCAAwC,WAAW,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,4QAkBmB,CAAC;AAEzD;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,8DAQhC,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,oCAAoC,QAMI,CAAC;AAKtD,eAAO,MAAM,uBAAuB,qzCAkClC,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qCAAqC,2XAYpB,CAAC;AAE/B,+EAA+E;AAC/E,eAAO,MAAM,4BAA4B,kOAMX,CAAC"}
@@ -18,10 +18,11 @@ import { iso8601_timestamp_expr, qualify_columns } from '../db/sql_columns.js';
18
18
  /** Sentinel UUID used inside the partial unique indexes to collapse `scope_id IS NULL` into a comparable value. */
19
19
  export const ROLE_GRANT_OFFER_SCOPE_SENTINEL_UUID = '00000000-0000-0000-0000-000000000000';
20
20
  /**
21
- * Index-side token for the global case in the partial unique index. Uppercase
22
- * so it cannot collide with consumer-declared `ScopeKindName` values (which
23
- * are lowercase by regex). Never appears as a column value — column-level
24
- * `scope_kind = NULL` and `scope_id = NULL` together encode the global case.
21
+ * Index-side token for the global case in the partial unique index.
22
+ * Uppercase, so it is off the `ScopeKindName` grammar: no registry declares
23
+ * it, and the grant inputs refuse it, so no row they write holds it.
24
+ * Column-level `scope_kind = NULL` and `scope_id = NULL` together encode the
25
+ * global case.
25
26
  */
26
27
  export const ROLE_GRANT_OFFER_SCOPE_KIND_GLOBAL_TOKEN = 'GLOBAL';
27
28
  /**