@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.
- 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 +40 -15
- 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/audit_log_route_schema.d.ts +18 -6
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_route_schema.js +7 -3
- package/dist/auth/credential_type_schema.d.ts +4 -4
- package/dist/auth/credential_type_schema.d.ts.map +1 -1
- package/dist/auth/credential_type_schema.js +6 -6
- package/dist/auth/grant_path_schema.d.ts +4 -4
- package/dist/auth/grant_path_schema.d.ts.map +1 -1
- package/dist/auth/grant_path_schema.js +6 -6
- package/dist/auth/request_context.js +1 -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 +109 -102
- 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_ddl.d.ts +5 -4
- package/dist/auth/role_grant_offer_ddl.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_ddl.js +5 -4
- 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 +15 -2
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/role_schema.js +17 -4
- package/dist/auth/role_schema_fuz.d.ts +29 -0
- package/dist/auth/role_schema_fuz.d.ts.map +1 -0
- package/dist/auth/role_schema_fuz.js +28 -0
- package/dist/auth/scope_kind_schema.d.ts +27 -15
- package/dist/auth/scope_kind_schema.d.ts.map +1 -1
- package/dist/auth/scope_kind_schema.js +30 -18
- package/dist/auth/scope_kind_schema_fuz.d.ts +30 -0
- package/dist/auth/scope_kind_schema_fuz.d.ts.map +1 -0
- package/dist/auth/scope_kind_schema_fuz.js +29 -0
- package/dist/auth/self_service_role_action_specs.d.ts +70 -27
- package/dist/auth/self_service_role_action_specs.d.ts.map +1 -1
- package/dist/auth/self_service_role_action_specs.js +16 -14
- package/dist/auth/token_scope.d.ts +3 -2
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/auth/token_scope.js +4 -3
- package/dist/http/CLAUDE.md +6 -0
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +8 -3
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +3 -2
- package/dist/server/surface_route.d.ts.map +1 -1
- package/dist/server/surface_route.js +3 -2
- package/dist/testing/CLAUDE.md +27 -16
- package/dist/testing/cross_backend/default_spine_surface.d.ts +1 -1
- 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 +94 -6
- 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,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;AAElF;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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 { RoleName } from './
|
|
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
|
|
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
|
-
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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 =
|
|
101
|
-
|
|
102
|
-
|
|
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:
|
|
119
|
+
role: meta(RoleName, { description: 'Role being offered.' }),
|
|
107
120
|
scope_kind: GrantScopeKind,
|
|
108
|
-
scope_id: Uuid
|
|
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
|
-
.
|
|
113
|
-
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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 =
|
|
124
|
-
offer_id:
|
|
125
|
-
reason: bounded_string({ max: ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX })
|
|
126
|
-
.
|
|
127
|
-
|
|
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 =
|
|
132
|
-
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.' }),
|
|
133
145
|
acting: ActingActor
|
|
134
146
|
});
|
|
135
|
-
/**
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
|
146
|
-
* role_grant on a target actor. `actor_id` is
|
|
147
|
-
* actor-scoped, and the admin UI reads
|
|
148
|
-
* listing. Deriving `actor_id` from
|
|
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 =
|
|
152
|
-
actor_id:
|
|
153
|
-
role_grant_id:
|
|
154
|
-
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 }))), {
|
|
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
|
|
163
|
-
* in either direction (recipient or
|
|
164
|
-
* 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.
|
|
165
181
|
*/
|
|
166
|
-
export const RoleGrantOfferHistoryInput =
|
|
167
|
-
|
|
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:
|
|
172
|
-
|
|
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
|
-
|
|
182
|
-
|
|
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 =
|
|
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:
|
|
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 =
|
|
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 =
|
|
196
|
-
/** Output for `role_grant_offer_list
|
|
197
|
-
export const RoleGrantOfferListOutput =
|
|
198
|
-
/** Output for `role_grant_offer_history
|
|
199
|
-
export const RoleGrantOfferHistoryOutput =
|
|
200
|
-
/** Output for `role_grant_revoke
|
|
201
|
-
export const RoleGrantRevokeOutput =
|
|
202
|
-
ok:
|
|
203
|
-
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)
|
|
204
212
|
});
|
|
205
213
|
/**
|
|
206
|
-
* Input for `role_grant_assign` — the immediate
|
|
207
|
-
* consent-free sibling of
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
* 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.
|
|
212
221
|
*/
|
|
213
|
-
export const RoleGrantAssignInput =
|
|
214
|
-
|
|
215
|
-
|
|
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:
|
|
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
|
|
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
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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
|
|
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","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
|
|
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
|
}));
|
|
@@ -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.
|
|
21
|
-
* so it
|
|
22
|
-
*
|
|
23
|
-
* `scope_kind = NULL` and `scope_id = NULL` together encode the
|
|
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
|
|
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.
|
|
22
|
-
* so it
|
|
23
|
-
*
|
|
24
|
-
* `scope_kind = NULL` and `scope_id = NULL` together encode the
|
|
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
|
/**
|