@fuzdev/fuz_app 0.159.0 → 0.161.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.
- package/dist/actions/CLAUDE.md +7 -2
- package/dist/actions/protocol.d.ts +7 -0
- package/dist/actions/protocol.d.ts.map +1 -1
- package/dist/actions/protocol.js +19 -4
- package/dist/auth/CLAUDE.md +47 -24
- package/dist/auth/account_schema.d.ts +2 -2
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +1 -1
- package/dist/auth/actor_lookup_action_specs.d.ts +7 -7
- package/dist/auth/actor_search_action_specs.d.ts +6 -6
- package/dist/auth/admin_action_specs.d.ts +1051 -321
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +150 -166
- package/dist/auth/app_settings_schema.d.ts +46 -23
- package/dist/auth/app_settings_schema.d.ts.map +1 -1
- package/dist/auth/app_settings_schema.js +12 -15
- package/dist/auth/audit_log_route_schema.d.ts +1 -1
- package/dist/auth/audit_log_schema.d.ts +14 -3
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +20 -7
- package/dist/auth/audit_log_schema_fuz.d.ts +39 -0
- package/dist/auth/audit_log_schema_fuz.d.ts.map +1 -0
- package/dist/auth/audit_log_schema_fuz.js +37 -0
- package/dist/auth/credential_type_schema.d.ts +4 -7
- package/dist/auth/credential_type_schema.d.ts.map +1 -1
- package/dist/auth/credential_type_schema.js +6 -10
- package/dist/auth/grant_path_schema.d.ts +4 -7
- package/dist/auth/grant_path_schema.d.ts.map +1 -1
- package/dist/auth/grant_path_schema.js +6 -10
- package/dist/auth/name_schema.d.ts +63 -0
- package/dist/auth/name_schema.d.ts.map +1 -0
- package/dist/auth/name_schema.js +65 -0
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +2 -1
- package/dist/auth/role_grant_offer_action_specs.d.ts +2257 -400
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +104 -100
- package/dist/auth/role_grant_offer_actions.d.ts +6 -3
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +15 -6
- package/dist/auth/role_grant_offer_notifications.d.ts +1364 -255
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +100 -47
- package/dist/auth/role_grant_offer_schema.d.ts +90 -22
- package/dist/auth/role_grant_offer_schema.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_schema.js +40 -39
- package/dist/auth/role_schema.d.ts +14 -25
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/role_schema.js +15 -29
- package/dist/auth/role_schema_fuz.d.ts +4 -3
- package/dist/auth/role_schema_fuz.d.ts.map +1 -1
- package/dist/auth/role_schema_fuz.js +7 -5
- package/dist/auth/scope_kind_schema.d.ts +13 -21
- package/dist/auth/scope_kind_schema.d.ts.map +1 -1
- package/dist/auth/scope_kind_schema.js +15 -26
- package/dist/auth/scope_kind_schema_fuz.d.ts +31 -0
- package/dist/auth/scope_kind_schema_fuz.d.ts.map +1 -0
- package/dist/auth/scope_kind_schema_fuz.js +31 -0
- package/dist/auth/self_service_role_action_specs.d.ts +2 -2
- package/dist/auth/token_scope.d.ts +7 -13
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/auth/token_scope.js +9 -14
- package/dist/primitive_schemas.d.ts +46 -0
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +39 -14
- package/dist/primitive_schemas_fuz.d.ts +35 -7
- package/dist/primitive_schemas_fuz.d.ts.map +1 -1
- package/dist/primitive_schemas_fuz.js +30 -6
- package/dist/testing/CLAUDE.md +19 -11
- package/dist/testing/cross_backend/default_spine_surface.d.ts +1 -1
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.js +20 -11
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts +15 -3
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +60 -17
- package/dist/testing/cross_backend/role_grant_role_grammar.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_role_grammar.js +8 -15
- package/dist/testing/cross_backend/spine_suites.d.ts +4 -3
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +2 -1
- package/dist/ui/CLAUDE.md +4 -4
- package/dist/ui/admin_accounts_state.svelte.d.ts +8 -8
- package/dist/ui/role_grant_offers_state.svelte.d.ts +9 -9
- package/dist/ui/role_grant_offers_state.svelte.js +4 -4
- 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
|
|
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;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAcN,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAGtC,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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWZ,CAAC;AAEtC,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWT,CAAC;AAEtC,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWZ,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBL,CAAC;AAEtC;;;;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
|
|
7
|
-
* reason constants, and the
|
|
8
|
-
* Handlers live in
|
|
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 {
|
|
24
|
-
import {
|
|
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 {
|
|
27
|
-
import {
|
|
28
|
+
import { NAME_LENGTH_MAX } from './name_schema.js';
|
|
29
|
+
import { RoleName } from './role_schema_fuz.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
|
|
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
|
-
/**
|
|
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
|
|
89
|
-
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 ${
|
|
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 ${NAME_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 =
|
|
104
|
-
|
|
105
|
-
|
|
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:
|
|
119
|
+
role: meta(RoleName, { description: 'Role being offered.' }),
|
|
110
120
|
scope_kind: GrantScopeKind,
|
|
111
|
-
scope_id: Uuid
|
|
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
|
-
.
|
|
116
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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 =
|
|
127
|
-
offer_id:
|
|
128
|
-
reason: bounded_string({ max: ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX })
|
|
129
|
-
.
|
|
130
|
-
|
|
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 =
|
|
135
|
-
offer_id:
|
|
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
|
-
/**
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
|
149
|
-
* role_grant on a target actor. `actor_id` is
|
|
150
|
-
* actor-scoped, and the admin UI reads
|
|
151
|
-
* listing. Deriving `actor_id` from
|
|
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 =
|
|
155
|
-
actor_id:
|
|
156
|
-
role_grant_id:
|
|
157
|
-
reason: bounded_string({ max: ROLE_GRANT_REVOKED_REASON_LENGTH_MAX })
|
|
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
|
|
166
|
-
* in either direction (recipient or
|
|
167
|
-
* first. `account_id` is
|
|
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 =
|
|
170
|
-
|
|
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:
|
|
175
|
-
|
|
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
|
-
|
|
185
|
-
|
|
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 =
|
|
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:
|
|
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 =
|
|
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 =
|
|
199
|
-
/** Output for `role_grant_offer_list
|
|
200
|
-
export const RoleGrantOfferListOutput =
|
|
201
|
-
/** Output for `role_grant_offer_history
|
|
202
|
-
export const RoleGrantOfferHistoryOutput =
|
|
203
|
-
/** Output for `role_grant_revoke
|
|
204
|
-
export const RoleGrantRevokeOutput =
|
|
205
|
-
ok:
|
|
206
|
-
revoked:
|
|
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
|
|
210
|
-
* consent-free sibling of
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
* the grant row carries the
|
|
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 =
|
|
217
|
-
|
|
218
|
-
|
|
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:
|
|
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
|
|
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
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
|
50
|
-
*
|
|
51
|
-
*
|
|
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
|
|
1
|
+
{"version":3,"file":"role_grant_offer_actions.d.ts","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I,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
|
|
50
|
-
*
|
|
51
|
-
*
|
|
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,
|
|
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
|
|
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,
|
|
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
|
}));
|