@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
|
@@ -2,13 +2,16 @@ import '../assert_dev_env.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Cross-process **role-grant-offer lifecycle WS notification** suite — the
|
|
4
4
|
* machinery proof for the consentful-role-grants notification fan-out across
|
|
5
|
-
* any spine backend. Covers
|
|
5
|
+
* any spine backend. Covers every server-initiated notification of the
|
|
6
|
+
* lifecycle:
|
|
6
7
|
*
|
|
7
8
|
* - `role_grant_offer_received` → recipient (offer created)
|
|
8
9
|
* - `role_grant_offer_accepted` → grantor (recipient accepts)
|
|
9
10
|
* - `role_grant_offer_declined` → grantor (recipient declines)
|
|
10
11
|
* - `role_grant_offer_retracted` → recipient (grantor retracts)
|
|
11
|
-
* - `
|
|
12
|
+
* - `role_grant_revoked` (flat, omits `revoked_by`) → revokee (active grant
|
|
13
|
+
* revoked by the `role_grant_revoke` action), for a global grant and a
|
|
14
|
+
* scoped one unless `scope_kind` is `null`
|
|
12
15
|
* - `role_grant_offer_supersede` → each superseded sibling's grantor, fired on
|
|
13
16
|
* BOTH the accept-cascade (`reason: 'sibling_accepted'`) and the
|
|
14
17
|
* revoke-cascade (`reason: 'role_grant_revoked'`)
|
|
@@ -58,29 +61,36 @@ import '../assert_dev_env.js';
|
|
|
58
61
|
* @module
|
|
59
62
|
*/
|
|
60
63
|
import { assert, describe } from 'vitest';
|
|
64
|
+
import { parse_or_throw } from '@fuzdev/fuz_schema/schema.ts';
|
|
61
65
|
import { rpc_call } from '../rpc_helpers.js';
|
|
62
66
|
import { WS_ADMISSION_PROBE_ID } from '../transports/ws_transport.js';
|
|
63
67
|
import { is_notification_with, is_response_for } from '../transports/ws_client.js';
|
|
64
|
-
import { ROLE_ADMIN } from '../../auth/role_schema.js';
|
|
68
|
+
import { ROLE_ADMIN, is_builtin_role } from '../../auth/role_schema.js';
|
|
65
69
|
import { WS_CLOSE_PERMISSION_REVOKED } from '../../actions/transports.js';
|
|
66
|
-
import { ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_ACCEPTED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_RETRACTED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD,
|
|
70
|
+
import { ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_ACCEPTED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_RETRACTED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD, ROLE_GRANT_REVOKED_NOTIFICATION_METHOD, RoleGrantOfferReceivedParams, RoleGrantOfferAcceptedParams, RoleGrantOfferDeclinedParams, RoleGrantOfferRetractedParams, RoleGrantOfferSupersedeParams, RoleGrantRevokedParams } from '../../auth/role_grant_offer_notifications.js';
|
|
67
71
|
import { test_if } from './capabilities.js';
|
|
68
72
|
import { create_active_role_grant, create_pending_role_grant_offer } from './role_grant_cross_helpers.js';
|
|
69
|
-
import { SPINE_RPC_PATH } from './spine_surface_constants.js';
|
|
73
|
+
import { SPINE_PARTICIPANT_ROLE, SPINE_RPC_PATH } from './spine_surface_constants.js';
|
|
70
74
|
import { open_session_ws } from './ws_endpoint.js';
|
|
71
75
|
/** The request id the bystander's barrier `heartbeat` goes out under. */
|
|
72
76
|
const BYSTANDER_BARRIER_ID = 'bystander_barrier';
|
|
73
77
|
/**
|
|
74
|
-
* Register the role-grant-offer WS notification suite —
|
|
78
|
+
* Register the role-grant-offer WS notification suite — cases over a real
|
|
75
79
|
* upgrade, one per server-initiated notification (received / accepted /
|
|
76
|
-
* declined / retracted / revoke + supersede on both the
|
|
77
|
-
* cascades). Each opens the affected counterparty's socket, drives the
|
|
80
|
+
* declined / retracted / revoke, global and scoped, + supersede on both the
|
|
81
|
+
* accept and revoke cascades). Each opens the affected counterparty's socket, drives the
|
|
78
82
|
* lifecycle RPC, and strict-parses the delivered frame against its canonical
|
|
79
83
|
* params schema. Gated on `capabilities.ws`.
|
|
80
84
|
*/
|
|
81
85
|
export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
82
86
|
const { setup_test, capabilities, ws_required_roles = [] } = options;
|
|
83
87
|
const revoke_closes_the_socket = ws_required_roles.includes(ROLE_ADMIN);
|
|
88
|
+
const scoped_role = options.scoped_role ?? SPINE_PARTICIPANT_ROLE;
|
|
89
|
+
const scope_kind = options.scope_kind === undefined
|
|
90
|
+
? is_builtin_role(scoped_role)
|
|
91
|
+
? null
|
|
92
|
+
: 'space'
|
|
93
|
+
: options.scope_kind;
|
|
84
94
|
// -- shared helpers -------------------------------------------------------
|
|
85
95
|
/**
|
|
86
96
|
* Open a WS transport on an account's session, admitted before it resolves:
|
|
@@ -158,7 +168,7 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
158
168
|
const frame = await recipient_ws.wait_for(is_notification_with(ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD, (p) => p.offer.to_account_id === recipient.account.id), 5000);
|
|
159
169
|
// Params strict-parse against the canonical wire schema — guards
|
|
160
170
|
// the serialization against field/null/datetime drift.
|
|
161
|
-
const params = RoleGrantOfferReceivedParams
|
|
171
|
+
const params = parse_or_throw(RoleGrantOfferReceivedParams, frame.params);
|
|
162
172
|
assert.strictEqual(params.offer.to_account_id, recipient.account.id);
|
|
163
173
|
assert.strictEqual(params.offer.role, ROLE_ADMIN);
|
|
164
174
|
await assert_bystander_heard_nothing(bystander_ws);
|
|
@@ -183,7 +193,7 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
183
193
|
const accepted = await rpc(fixture, 'role_grant_offer_accept', { offer_id: offer.id }, recipient.create_session_headers());
|
|
184
194
|
assert.isTrue(accepted.ok, `accept failed: ${JSON.stringify(accepted)}`);
|
|
185
195
|
const frame = await grantor.wait_for(is_notification_with(ROLE_GRANT_OFFER_ACCEPTED_NOTIFICATION_METHOD, (p) => p.offer.id === offer.id), 5000);
|
|
186
|
-
const params = RoleGrantOfferAcceptedParams
|
|
196
|
+
const params = parse_or_throw(RoleGrantOfferAcceptedParams, frame.params);
|
|
187
197
|
assert.strictEqual(params.offer.id, offer.id);
|
|
188
198
|
assert.isNotNull(params.offer.accepted_at);
|
|
189
199
|
await assert_bystander_heard_nothing(bystander_ws);
|
|
@@ -207,7 +217,7 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
207
217
|
const declined = await rpc(fixture, 'role_grant_offer_decline', { offer_id: offer.id, reason: 'no thanks' }, recipient.create_session_headers());
|
|
208
218
|
assert.isTrue(declined.ok, `decline failed: ${JSON.stringify(declined)}`);
|
|
209
219
|
const frame = await grantor.wait_for(is_notification_with(ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD, (p) => p.offer.id === offer.id), 5000);
|
|
210
|
-
const params = RoleGrantOfferDeclinedParams
|
|
220
|
+
const params = parse_or_throw(RoleGrantOfferDeclinedParams, frame.params);
|
|
211
221
|
assert.strictEqual(params.offer.id, offer.id);
|
|
212
222
|
// Decline reason rides inside the offer row, not a sibling field.
|
|
213
223
|
assert.strictEqual(params.offer.decline_reason, 'no thanks');
|
|
@@ -233,7 +243,7 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
233
243
|
const retracted = await rpc(fixture, 'role_grant_offer_retract', { offer_id: offer.id }, fixture.create_session_headers());
|
|
234
244
|
assert.isTrue(retracted.ok, `retract failed: ${JSON.stringify(retracted)}`);
|
|
235
245
|
const frame = await recipient_ws.wait_for(is_notification_with(ROLE_GRANT_OFFER_RETRACTED_NOTIFICATION_METHOD, (p) => p.offer.id === offer.id), 5000);
|
|
236
|
-
const params = RoleGrantOfferRetractedParams
|
|
246
|
+
const params = parse_or_throw(RoleGrantOfferRetractedParams, frame.params);
|
|
237
247
|
assert.strictEqual(params.offer.id, offer.id);
|
|
238
248
|
assert.strictEqual(params.offer.to_account_id, recipient.account.id);
|
|
239
249
|
assert.isNotNull(params.offer.retracted_at);
|
|
@@ -249,7 +259,7 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
249
259
|
});
|
|
250
260
|
test_if(capabilities.ws, revoke_closes_the_socket
|
|
251
261
|
? 'revoke closes the revokee WS gated on the revoked role'
|
|
252
|
-
: 'revoke delivers a flat
|
|
262
|
+
: 'revoke delivers a flat role_grant_revoked to the revokee WS', async () => {
|
|
253
263
|
const fixture = await setup_test();
|
|
254
264
|
const revokee = await fixture.create_account({ roles: [ROLE_ADMIN] });
|
|
255
265
|
const role_grant_id = await create_active_role_grant(fixture, revokee, {
|
|
@@ -261,13 +271,15 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
261
271
|
try {
|
|
262
272
|
const revoked = await rpc(fixture, 'role_grant_revoke', { actor_id: revokee.actor.id, role_grant_id, reason: 'cleanup' }, fixture.create_session_headers());
|
|
263
273
|
assert.isTrue(revoked.ok, `revoke failed: ${JSON.stringify(revoked)}`);
|
|
264
|
-
const is_revoke_frame = is_notification_with(
|
|
274
|
+
const is_revoke_frame = is_notification_with(ROLE_GRANT_REVOKED_NOTIFICATION_METHOD, (p) => p.role_grant_id === role_grant_id);
|
|
265
275
|
// Flat params — guards the no-`offer`-wrapper, `revoked_by`-omitted
|
|
266
276
|
// shape against drift.
|
|
267
277
|
const assert_flat_revoke = (frame) => {
|
|
268
|
-
const params =
|
|
278
|
+
const params = parse_or_throw(RoleGrantRevokedParams, frame.params);
|
|
269
279
|
assert.strictEqual(params.role_grant_id, role_grant_id);
|
|
270
280
|
assert.strictEqual(params.role, ROLE_ADMIN);
|
|
281
|
+
assert.strictEqual(params.scope_kind, null);
|
|
282
|
+
assert.strictEqual(params.scope_id, null);
|
|
271
283
|
assert.strictEqual(params.reason, 'cleanup');
|
|
272
284
|
assert.notProperty(frame.params, 'revoked_by');
|
|
273
285
|
};
|
|
@@ -295,6 +307,37 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
295
307
|
await bystander_ws.close();
|
|
296
308
|
}
|
|
297
309
|
});
|
|
310
|
+
test_if(capabilities.ws && scope_kind !== null, 'a scoped revoke delivers its scope_kind and scope_id to the revokee WS', async () => {
|
|
311
|
+
const fixture = await setup_test();
|
|
312
|
+
// `ROLE_ADMIN` opens a socket gated on it; the scoped revoke below takes
|
|
313
|
+
// no global grant, so a gated socket stays open
|
|
314
|
+
const revokee = await fixture.create_account({ roles: [ROLE_ADMIN] });
|
|
315
|
+
const scope_id = '44444444-4444-4444-8444-444444444444';
|
|
316
|
+
const assigned = await rpc(fixture, 'role_grant_assign', { to_account_id: revokee.account.id, role: scoped_role, scope_kind, scope_id }, fixture.create_session_headers());
|
|
317
|
+
assert.isTrue(assigned.ok, `assign failed: ${JSON.stringify(assigned)}`);
|
|
318
|
+
const { role_grant_id } = assigned.result;
|
|
319
|
+
const bystander_ws = await open_bystander(fixture);
|
|
320
|
+
try {
|
|
321
|
+
const revokee_ws = await open_ws(revokee);
|
|
322
|
+
try {
|
|
323
|
+
const revoked = await rpc(fixture, 'role_grant_revoke', { actor_id: revokee.actor.id, role_grant_id }, fixture.create_session_headers());
|
|
324
|
+
assert.isTrue(revoked.ok, `revoke failed: ${JSON.stringify(revoked)}`);
|
|
325
|
+
const frame = await revokee_ws.wait_for(is_notification_with(ROLE_GRANT_REVOKED_NOTIFICATION_METHOD, (p) => p.role_grant_id === role_grant_id), 5000);
|
|
326
|
+
const params = parse_or_throw(RoleGrantRevokedParams, frame.params);
|
|
327
|
+
assert.strictEqual(params.role, scoped_role);
|
|
328
|
+
assert.strictEqual(params.scope_kind, scope_kind);
|
|
329
|
+
assert.strictEqual(params.scope_id, scope_id);
|
|
330
|
+
assert.strictEqual(params.reason, null);
|
|
331
|
+
await assert_bystander_heard_nothing(bystander_ws);
|
|
332
|
+
}
|
|
333
|
+
finally {
|
|
334
|
+
await revokee_ws.close();
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
finally {
|
|
338
|
+
await bystander_ws.close();
|
|
339
|
+
}
|
|
340
|
+
});
|
|
298
341
|
test_if(capabilities.ws, 'accept of a sibling delivers role_grant_offer_supersede to the other grantor WS', async () => {
|
|
299
342
|
const fixture = await setup_test();
|
|
300
343
|
// Three identities: keeper (grantor 1, socket), a second admin grantor
|
|
@@ -314,7 +357,7 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
314
357
|
const accepted = await rpc(fixture, 'role_grant_offer_accept', { offer_id: grantor2_offer.id }, recipient.create_session_headers());
|
|
315
358
|
assert.isTrue(accepted.ok, `accept failed: ${JSON.stringify(accepted)}`);
|
|
316
359
|
const frame = await grantor1_ws.wait_for(is_notification_with(ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD, (p) => p.offer.id === keeper_offer.id), 5000);
|
|
317
|
-
const params = RoleGrantOfferSupersedeParams
|
|
360
|
+
const params = parse_or_throw(RoleGrantOfferSupersedeParams, frame.params);
|
|
318
361
|
assert.strictEqual(params.offer.id, keeper_offer.id);
|
|
319
362
|
assert.strictEqual(params.reason, 'sibling_accepted');
|
|
320
363
|
// cause_id points at the accepted sibling (grantor 2's offer).
|
|
@@ -348,7 +391,7 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
348
391
|
const revoked = await rpc(fixture, 'role_grant_revoke', { actor_id: revokee.actor.id, role_grant_id }, fixture.create_session_headers());
|
|
349
392
|
assert.isTrue(revoked.ok, `revoke failed: ${JSON.stringify(revoked)}`);
|
|
350
393
|
const frame = await grantor_ws.wait_for(is_notification_with(ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD, (p) => p.offer.id === sibling_offer.id), 5000);
|
|
351
|
-
const params = RoleGrantOfferSupersedeParams
|
|
394
|
+
const params = parse_or_throw(RoleGrantOfferSupersedeParams, frame.params);
|
|
352
395
|
assert.strictEqual(params.offer.id, sibling_offer.id);
|
|
353
396
|
assert.strictEqual(params.reason, 'role_grant_revoked');
|
|
354
397
|
// cause_id points at the revoked role_grant.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role_grant_role_grammar.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/role_grant_role_grammar.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAiD9B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAG3D,8EAA8E;AAC9E,MAAM,MAAM,oCAAoC,GAAG,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"role_grant_role_grammar.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/role_grant_role_grammar.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAiD9B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAG3D,8EAA8E;AAC9E,MAAM,MAAM,oCAAoC,GAAG,wBAAwB,CAAC;AA4D5E,eAAO,MAAM,4CAA4C,GACxD,SAAS,oCAAoC,KAC3C,IAqKF,CAAC"}
|
|
@@ -47,14 +47,15 @@ import { cross_rpc_call, error_reason } from './cross_rpc.js';
|
|
|
47
47
|
import { SPINE_RPC_PATH } from './spine_surface_constants.js';
|
|
48
48
|
const NIL_UUID = '00000000-0000-0000-0000-000000000000';
|
|
49
49
|
/**
|
|
50
|
-
* The longest role name the grammar admits — an independent
|
|
51
|
-
* producers' `
|
|
50
|
+
* The longest role name or scope kind the grammar admits — an independent
|
|
51
|
+
* copy of the producers' `NAME_LENGTH_MAX`, so a cap moved on one spine fails
|
|
52
|
+
* here.
|
|
52
53
|
*/
|
|
53
|
-
const
|
|
54
|
+
const NAME_LENGTH_MAX = 64;
|
|
54
55
|
/** All lowercase letters, so only its length is off the grammar. */
|
|
55
|
-
const OVER_LENGTH_ROLE = 'a'.repeat(
|
|
56
|
+
const OVER_LENGTH_ROLE = 'a'.repeat(NAME_LENGTH_MAX + 1);
|
|
56
57
|
/** On the grammar at exactly the length cap, held by no registry. */
|
|
57
|
-
const AT_LENGTH_ROLE = 'a'.repeat(
|
|
58
|
+
const AT_LENGTH_ROLE = 'a'.repeat(NAME_LENGTH_MAX);
|
|
58
59
|
/** Each breaks one rule of the `RoleName` grammar. */
|
|
59
60
|
const OFF_GRAMMAR_ROLES = [
|
|
60
61
|
'Admin', // uppercase
|
|
@@ -70,11 +71,6 @@ const OFF_GRAMMAR_ROLES = [
|
|
|
70
71
|
];
|
|
71
72
|
/** On the grammar, held by no registry. */
|
|
72
73
|
const UNREGISTERED_ROLE = 'not_a_registered_role';
|
|
73
|
-
/**
|
|
74
|
-
* The longest scope kind the grammar admits — an independent copy of the
|
|
75
|
-
* producers' `SCOPE_KIND_LENGTH_MAX`.
|
|
76
|
-
*/
|
|
77
|
-
const SCOPE_KIND_LENGTH_MAX = 64;
|
|
78
74
|
/** Each breaks one rule of the `ScopeKindName` grammar. */
|
|
79
75
|
const OFF_GRAMMAR_SCOPE_KINDS = [
|
|
80
76
|
'GLOBAL', // the partial unique indexes' token for a global grant
|
|
@@ -84,13 +80,10 @@ const OFF_GRAMMAR_SCOPE_KINDS = [
|
|
|
84
80
|
'a_', // trailing underscore
|
|
85
81
|
'a1', // digit
|
|
86
82
|
'', // empty
|
|
87
|
-
'a'.repeat(
|
|
83
|
+
'a'.repeat(NAME_LENGTH_MAX + 1) // on the alphabet, one past the length cap
|
|
88
84
|
];
|
|
89
85
|
/** On the grammar, the second exactly at the length cap. */
|
|
90
|
-
const ON_GRAMMAR_SCOPE_KINDS = [
|
|
91
|
-
'classroom',
|
|
92
|
-
'a'.repeat(SCOPE_KIND_LENGTH_MAX)
|
|
93
|
-
];
|
|
86
|
+
const ON_GRAMMAR_SCOPE_KINDS = ['classroom', 'a'.repeat(NAME_LENGTH_MAX)];
|
|
94
87
|
const GRANT_METHODS = ['role_grant_assign', 'role_grant_offer_create'];
|
|
95
88
|
/** What each grant verb refuses an unregistered role with, past validation. */
|
|
96
89
|
const NOT_GRANTABLE_REASONS = {
|
|
@@ -165,10 +165,11 @@ export interface SpineSuiteRoles {
|
|
|
165
165
|
*/
|
|
166
166
|
readonly cell_grant?: string;
|
|
167
167
|
/**
|
|
168
|
-
* The admin-grantable role `role_grant_offer_lifecycle` offers
|
|
169
|
-
* `role_grant_participation` confers
|
|
168
|
+
* The admin-grantable role `role_grant_offer_lifecycle` offers,
|
|
169
|
+
* `role_grant_participation` confers, and `role_grant_offer_notification_ws`
|
|
170
|
+
* assigns in a scope and revokes. Default `SPINE_PARTICIPANT_ROLE`;
|
|
170
171
|
* `ROLE_ADMIN` serves a backend with only the builtin roles (the scoped
|
|
171
|
-
* assign
|
|
172
|
+
* assign and scoped revoke cases then skip, as a builtin is global-only).
|
|
172
173
|
*/
|
|
173
174
|
readonly conferral?: string;
|
|
174
175
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spine_suites.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/spine_suites.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAwF9B,OAAO,EAA2B,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,KAAK,EAAE,cAA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,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,KACpD,IAgBF,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,8BAA8B,GAC1C,eAAe,mBAAmB,EAClC,QAAQ,aAAa,CAAC,cAAc,CAAC,KACnC,IAiCF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,2BAA2B,GACvC,QAAQ,sCAAsC,EAC9C,SAAS,uBAAuB,KAC9B,IAoCF,CAAC"}
|
|
@@ -402,7 +402,8 @@ const SUITE_ENTRIES = {
|
|
|
402
402
|
capabilities: c.config.capabilities,
|
|
403
403
|
base_url: c.config.base_url,
|
|
404
404
|
ws_path: c.config.ws_path,
|
|
405
|
-
ws_required_roles: c.options.ws_required_roles
|
|
405
|
+
ws_required_roles: c.options.ws_required_roles,
|
|
406
|
+
scoped_role: c.options.suite_roles?.conferral
|
|
406
407
|
}),
|
|
407
408
|
describe: describe_role_grant_offer_notification_ws_tests,
|
|
408
409
|
required: { setup_test: true, capabilities: true, base_url: true, ws_path: true }
|
package/dist/ui/CLAUDE.md
CHANGED
|
@@ -60,8 +60,8 @@ because `$state.raw` expects reference swaps.
|
|
|
60
60
|
reducer — `subscribe(subscribe_fn)` is a thin subscription adapter over
|
|
61
61
|
it. Six methods land on the reducer: `role_grant_offer_received` /
|
|
62
62
|
`_retracted` / `_accepted` / `_declined` / `_supersede` all merge a
|
|
63
|
-
`{offer}` payload; `
|
|
64
|
-
lifecycle lives in auth/role_grants state). The
|
|
63
|
+
`{offer}` payload; `role_grant_revoked` is ignored at this layer (role_grant
|
|
64
|
+
lifecycle lives in auth/role_grants state). The notification specs and
|
|
65
65
|
their payload shapes are defined in `auth/role_grant_offer_notifications.ts`
|
|
66
66
|
(see `auth/CLAUDE.md` §WS notifications).
|
|
67
67
|
|
|
@@ -407,8 +407,8 @@ destructive actions.
|
|
|
407
407
|
`incoming` (recipient-side pending, soonest-expiry first),
|
|
408
408
|
`outgoing` (grantor-side pending, newest-created first), `history`
|
|
409
409
|
(all known, newest-created first). Reducer `apply_notification`
|
|
410
|
-
handles the
|
|
411
|
-
`
|
|
410
|
+
handles the role-grant-offer notification methods;
|
|
411
|
+
`role_grant_revoked` is deliberately ignored here (auth/role_grants
|
|
412
412
|
concern). `reset()` clears every slot + the Map.
|
|
413
413
|
|
|
414
414
|
## State primitives
|
|
@@ -101,22 +101,22 @@ export declare class AdminAccountsState {
|
|
|
101
101
|
#private;
|
|
102
102
|
readonly list: AsyncSlot<void, string>;
|
|
103
103
|
readonly grant: KeyedAsyncSlot<string, {
|
|
104
|
-
id: string & import("@fuzdev/fuz_schema/schema.js").Brand<"Uuid">;
|
|
105
|
-
from_actor_id: string & import("@fuzdev/fuz_schema/schema.js").Brand<"Uuid">;
|
|
106
|
-
to_account_id: string & import("@fuzdev/fuz_schema/schema.js").Brand<"Uuid">;
|
|
107
|
-
to_actor_id: (string & import("@fuzdev/fuz_schema/schema.js").Brand<"Uuid">) | null;
|
|
108
|
-
role: string;
|
|
109
|
-
scope_kind: string | null;
|
|
110
|
-
scope_id: (string & import("@fuzdev/fuz_schema/schema.js").Brand<"Uuid">) | null;
|
|
111
104
|
message: string | null;
|
|
105
|
+
id: import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid">;
|
|
112
106
|
created_at: string;
|
|
113
107
|
expires_at: string;
|
|
108
|
+
role: string;
|
|
109
|
+
scope_kind: string | null;
|
|
110
|
+
scope_id: import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid"> | null;
|
|
111
|
+
from_actor_id: import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid">;
|
|
112
|
+
to_account_id: import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid">;
|
|
113
|
+
to_actor_id: import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid"> | null;
|
|
114
114
|
accepted_at: string | null;
|
|
115
115
|
declined_at: string | null;
|
|
116
116
|
decline_reason: string | null;
|
|
117
117
|
retracted_at: string | null;
|
|
118
118
|
superseded_at: string | null;
|
|
119
|
-
resulting_role_grant_id:
|
|
119
|
+
resulting_role_grant_id: import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid"> | null;
|
|
120
120
|
}, string>;
|
|
121
121
|
readonly revoke: KeyedAsyncSlot<string & import("@fuzdev/fuz_schema/schema.js").Brand<"Uuid">, void, string>;
|
|
122
122
|
readonly retract: KeyedAsyncSlot<string & import("@fuzdev/fuz_schema/schema.js").Brand<"Uuid">, void, string>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Reactive state for the consentful-role-grants offer flow.
|
|
3
3
|
*
|
|
4
4
|
* Maintains one offer cache keyed by id, seeded by the RPC list/history
|
|
5
|
-
* actions and kept live by the
|
|
5
|
+
* actions and kept live by the role-grant-offer WebSocket notifications.
|
|
6
6
|
* `incoming` (recipient-side pending) and `outgoing` (grantor-side pending)
|
|
7
7
|
* are derived views; `history` is the full cache ordered newest-first for
|
|
8
8
|
* the grantor/admin history view.
|
|
@@ -99,22 +99,22 @@ export declare class RoleGrantOffersState {
|
|
|
99
99
|
readonly list: AsyncSlot<void, string>;
|
|
100
100
|
readonly list_history: AsyncSlot<void, string>;
|
|
101
101
|
readonly create: AsyncSlot<{
|
|
102
|
-
id: string & import("@fuzdev/fuz_schema/schema.js").Brand<"Uuid">;
|
|
103
|
-
from_actor_id: string & import("@fuzdev/fuz_schema/schema.js").Brand<"Uuid">;
|
|
104
|
-
to_account_id: string & import("@fuzdev/fuz_schema/schema.js").Brand<"Uuid">;
|
|
105
|
-
to_actor_id: (string & import("@fuzdev/fuz_schema/schema.js").Brand<"Uuid">) | null;
|
|
106
|
-
role: string;
|
|
107
|
-
scope_kind: string | null;
|
|
108
|
-
scope_id: (string & import("@fuzdev/fuz_schema/schema.js").Brand<"Uuid">) | null;
|
|
109
102
|
message: string | null;
|
|
103
|
+
id: import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid">;
|
|
110
104
|
created_at: string;
|
|
111
105
|
expires_at: string;
|
|
106
|
+
role: string;
|
|
107
|
+
scope_kind: string | null;
|
|
108
|
+
scope_id: import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid"> | null;
|
|
109
|
+
from_actor_id: import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid">;
|
|
110
|
+
to_account_id: import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid">;
|
|
111
|
+
to_actor_id: import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid"> | null;
|
|
112
112
|
accepted_at: string | null;
|
|
113
113
|
declined_at: string | null;
|
|
114
114
|
decline_reason: string | null;
|
|
115
115
|
retracted_at: string | null;
|
|
116
116
|
superseded_at: string | null;
|
|
117
|
-
resulting_role_grant_id:
|
|
117
|
+
resulting_role_grant_id: import("@fuzdev/fuz_schema/schema.js").Branded<string, "Uuid"> | null;
|
|
118
118
|
}, string>;
|
|
119
119
|
/** Per-offer accept, keyed by offer id. */
|
|
120
120
|
readonly accept: KeyedAsyncSlot<string, void, string>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Reactive state for the consentful-role-grants offer flow.
|
|
3
3
|
*
|
|
4
4
|
* Maintains one offer cache keyed by id, seeded by the RPC list/history
|
|
5
|
-
* actions and kept live by the
|
|
5
|
+
* actions and kept live by the role-grant-offer WebSocket notifications.
|
|
6
6
|
* `incoming` (recipient-side pending) and `outgoing` (grantor-side pending)
|
|
7
7
|
* are derived views; `history` is the full cache ordered newest-first for
|
|
8
8
|
* the grantor/admin history view.
|
|
@@ -33,7 +33,7 @@ import { AsyncSlot } from './async_slot.svelte.js';
|
|
|
33
33
|
import { KeyedAsyncSlot } from './keyed_async_slot.svelte.js';
|
|
34
34
|
import { is_iso8601_seconds_live } from '../timestamp.js';
|
|
35
35
|
import { GRANT_SCOPE_PAIRED_MESSAGE, is_grant_scope_paired } from '../auth/role_grant_offer_action_specs.js';
|
|
36
|
-
import { ROLE_GRANT_OFFER_ACCEPTED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_RETRACTED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD,
|
|
36
|
+
import { ROLE_GRANT_OFFER_ACCEPTED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_RETRACTED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD, ROLE_GRANT_REVOKED_NOTIFICATION_METHOD } from '../auth/role_grant_offer_notifications.js';
|
|
37
37
|
/**
|
|
38
38
|
* Svelte context for `RoleGrantOffersState`.
|
|
39
39
|
* Use `role_grant_offers_state_context.set(state)` in the provider and
|
|
@@ -203,8 +203,8 @@ export class RoleGrantOffersState {
|
|
|
203
203
|
this.#merge_offers([offer]);
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
|
-
case
|
|
207
|
-
//
|
|
206
|
+
case ROLE_GRANT_REVOKED_NOTIFICATION_METHOD:
|
|
207
|
+
// role_grant_revoked is a role-grant-lifecycle event — the offer cache
|
|
208
208
|
// is unaffected. Consumers handle it in an auth/role_grants state.
|
|
209
209
|
return;
|
|
210
210
|
default:
|