@fuzdev/fuz_app 0.162.0 → 0.163.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/auth/CLAUDE.md +38 -35
- package/dist/auth/account_action_specs.d.ts +441 -115
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_action_specs.js +47 -46
- package/dist/auth/account_route_schema.d.ts +120 -60
- package/dist/auth/account_route_schema.d.ts.map +1 -1
- package/dist/auth/account_route_schema.js +50 -36
- package/dist/auth/account_routes.js +1 -1
- package/dist/auth/account_schema.d.ts +54 -27
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +16 -18
- package/dist/auth/admin_action_specs.d.ts +20 -20
- package/dist/auth/admin_action_specs.js +2 -4
- package/dist/auth/admin_actions.d.ts +4 -4
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +3 -3
- package/dist/auth/all_cell_actions.d.ts +3 -3
- package/dist/auth/all_cell_actions.d.ts.map +1 -1
- package/dist/auth/all_cell_actions.js +1 -1
- package/dist/auth/api_token.d.ts +4 -4
- package/dist/auth/api_token.d.ts.map +1 -1
- package/dist/auth/api_token.js +3 -3
- package/dist/auth/audit_log_schema.d.ts +28 -48
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +34 -30
- package/dist/auth/bootstrap_route_schema.d.ts +173 -50
- package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
- package/dist/auth/bootstrap_route_schema.js +35 -16
- package/dist/auth/cell_grant_action_specs.d.ts +1 -1
- package/dist/auth/cell_grant_action_specs.js +1 -1
- package/dist/auth/cell_grant_actions.d.ts +4 -4
- package/dist/auth/cell_grant_actions.d.ts.map +1 -1
- package/dist/auth/cell_grant_actions.js +1 -1
- package/dist/auth/credential_type_schema.d.ts +16 -29
- package/dist/auth/credential_type_schema.d.ts.map +1 -1
- package/dist/auth/credential_type_schema.js +14 -18
- package/dist/auth/grant_path_schema.d.ts +15 -29
- package/dist/auth/grant_path_schema.d.ts.map +1 -1
- package/dist/auth/grant_path_schema.js +13 -17
- package/dist/auth/migrations.js +1 -1
- package/dist/auth/name_schema.d.ts +7 -6
- package/dist/auth/name_schema.d.ts.map +1 -1
- package/dist/auth/name_schema.js +8 -9
- package/dist/auth/password.d.ts +15 -7
- package/dist/auth/password.d.ts.map +1 -1
- package/dist/auth/password.js +16 -9
- package/dist/auth/role_grant_offer_action_specs.js +2 -2
- package/dist/auth/role_grant_offer_actions.d.ts +4 -4
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +3 -3
- package/dist/auth/role_grant_offer_notifications.js +2 -2
- package/dist/auth/role_grant_offer_schema.d.ts +2 -2
- package/dist/auth/role_grant_offer_schema.js +2 -2
- package/dist/auth/role_schema.d.ts +47 -55
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/role_schema.js +29 -35
- package/dist/auth/scope_kind_schema.d.ts +22 -26
- package/dist/auth/scope_kind_schema.d.ts.map +1 -1
- package/dist/auth/scope_kind_schema.js +19 -19
- package/dist/auth/self_service_role_action_specs.js +1 -1
- package/dist/auth/self_service_role_actions.d.ts +6 -6
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +7 -6
- package/dist/auth/signup_route_schema.d.ts +71 -21
- package/dist/auth/signup_route_schema.d.ts.map +1 -1
- package/dist/auth/signup_route_schema.js +18 -16
- package/dist/auth/standard_rpc_actions.d.ts +1 -1
- package/dist/auth/standard_rpc_actions.js +1 -1
- package/dist/auth/token_lifetime.d.ts +33 -9
- package/dist/auth/token_lifetime.d.ts.map +1 -1
- package/dist/auth/token_lifetime.js +8 -7
- package/dist/auth/token_scope.d.ts +99 -25
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/auth/token_scope.js +57 -35
- package/dist/primitive_schemas.d.ts +2 -19
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +2 -20
- package/dist/primitive_schemas_fuz.d.ts +22 -2
- package/dist/primitive_schemas_fuz.d.ts.map +1 -1
- package/dist/primitive_schemas_fuz.js +23 -4
- package/dist/testing/CLAUDE.md +22 -5
- package/dist/testing/admin_integration.d.ts +3 -3
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +1 -1
- package/dist/testing/cross_backend/default_spine_surface.d.ts +2 -2
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +2 -2
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.js +39 -6
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +3 -3
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.d.ts +1 -1
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +45 -42
- package/dist/testing/cross_backend/spine_suites.d.ts +3 -3
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.d.ts +4 -4
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_lifetime.js +34 -1
- package/dist/testing/integration.js +1 -1
- package/dist/testing/token_scope_fixtures.d.ts +24 -0
- package/dist/testing/token_scope_fixtures.d.ts.map +1 -0
- package/dist/testing/token_scope_fixtures.js +49 -0
- package/dist/testing/transports/bootstrap.d.ts +1 -1
- package/dist/testing/transports/bootstrap.d.ts.map +1 -1
- package/dist/testing/transports/bootstrap.js +13 -12
- package/dist/ui/BootstrapForm.svelte +4 -2
- package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
- package/dist/ui/SignupForm.svelte +4 -2
- package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/auth/audit_log_schema_fuz.d.ts +0 -53
- package/dist/auth/audit_log_schema_fuz.d.ts.map +0 -1
- package/dist/auth/audit_log_schema_fuz.js +0 -50
- package/dist/auth/role_schema_fuz.d.ts +0 -30
- package/dist/auth/role_schema_fuz.d.ts.map +0 -1
- package/dist/auth/role_schema_fuz.js +0 -30
- package/dist/auth/scope_kind_schema_fuz.d.ts +0 -31
- package/dist/auth/scope_kind_schema_fuz.d.ts.map +0 -1
- package/dist/auth/scope_kind_schema_fuz.js +0 -31
|
@@ -5,23 +5,21 @@
|
|
|
5
5
|
* `Account`, `Actor`, `RoleGrant`, `AuthSession`, and `ApiToken`.
|
|
6
6
|
*
|
|
7
7
|
* Identifier primitives (`Username`, `UsernameProvided`, `Email`) live
|
|
8
|
-
* in `primitive_schemas.ts` — they're general
|
|
9
|
-
* don't depend on the auth domain. The auth-shape request-contract
|
|
8
|
+
* in `primitive_schemas.ts` and `primitive_schemas_fuz.ts` — they're general
|
|
9
|
+
* validator shapes that don't depend on the auth domain. The auth-shape request-contract
|
|
10
10
|
* primitive `ActingActor` lives in `http/auth_shape.ts` next to
|
|
11
11
|
* `RouteAuth` (the two pair: `auth.actor !== 'none'` ⟺ input declares
|
|
12
12
|
* `acting?: ActingActor`).
|
|
13
13
|
*
|
|
14
|
-
* The wire schemas are `@fuzdev/fuz_schema` schemas, `SessionId` among them
|
|
15
|
-
* but for `ClientApiTokenJson`, which is Zod.
|
|
14
|
+
* The wire schemas are `@fuzdev/fuz_schema` schemas, `SessionId` among them.
|
|
16
15
|
*
|
|
17
16
|
* DDL lives in `auth/auth_ddl.ts`; role system in `auth/role_schema.ts`.
|
|
18
17
|
* See docs/identity.md for design rationale.
|
|
19
18
|
*
|
|
20
19
|
* @module
|
|
21
20
|
*/
|
|
22
|
-
import { z } from 'zod';
|
|
23
21
|
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
24
|
-
import {
|
|
22
|
+
import type { Username } from '../primitive_schemas.js';
|
|
25
23
|
import { Email, Uuid } from '../primitive_schemas_fuz.js';
|
|
26
24
|
/** Account — authentication identity. You log in as an account. */
|
|
27
25
|
export interface Account {
|
|
@@ -86,7 +84,7 @@ export interface RoleGrant {
|
|
|
86
84
|
* Machine-readable kind tag for the polymorphic `scope_id`. Paired-null
|
|
87
85
|
* with `scope_id` per the `role_grant_scope_kind_paired` CHECK: both null
|
|
88
86
|
* (global) or both non-null (scoped). Consumer-declared via
|
|
89
|
-
* `
|
|
87
|
+
* `create_scope_kind_registry(...)`; v1 keeps validation registry-membership
|
|
90
88
|
* only, with no INSERT-time `(role, scope_kind)` enforcement.
|
|
91
89
|
*/
|
|
92
90
|
scope_kind: string | null;
|
|
@@ -253,18 +251,47 @@ export declare const AuthSessionJson: import("@fuzdev/fuz_schema/schema.ts").Sch
|
|
|
253
251
|
is_current: import("@fuzdev/fuz_schema/schema.ts").Schema<boolean, boolean, "boolean", undefined>;
|
|
254
252
|
}>;
|
|
255
253
|
export type AuthSessionJson = Infer<typeof AuthSessionJson>;
|
|
256
|
-
/**
|
|
257
|
-
export declare const ClientApiTokenJson:
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
scope:
|
|
266
|
-
},
|
|
267
|
-
|
|
254
|
+
/** Client-safe API token listing (excludes `token_hash`), a `@fuzdev/fuz_schema` schema. */
|
|
255
|
+
export declare const ClientApiTokenJson: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
256
|
+
name: string;
|
|
257
|
+
id: string;
|
|
258
|
+
account_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
259
|
+
created_at: string;
|
|
260
|
+
expires_at: string | null;
|
|
261
|
+
last_used_at: string | null;
|
|
262
|
+
last_used_ip: string | null;
|
|
263
|
+
scope: string;
|
|
264
|
+
}, {
|
|
265
|
+
name: string;
|
|
266
|
+
id: string;
|
|
267
|
+
account_id: string;
|
|
268
|
+
created_at: string;
|
|
269
|
+
expires_at: string | null;
|
|
270
|
+
last_used_at: string | null;
|
|
271
|
+
last_used_ip: string | null;
|
|
272
|
+
scope: string;
|
|
273
|
+
}, "object", {
|
|
274
|
+
id: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
275
|
+
account_id: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
276
|
+
readonly '~types'?: {
|
|
277
|
+
readonly input: string;
|
|
278
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
279
|
+
} | undefined;
|
|
280
|
+
};
|
|
281
|
+
name: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
282
|
+
expires_at: import("@fuzdev/fuz_schema/schema.ts").Schema<string | null, string | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>>;
|
|
283
|
+
last_used_at: import("@fuzdev/fuz_schema/schema.ts").Schema<string | null, string | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>>;
|
|
284
|
+
last_used_ip: import("@fuzdev/fuz_schema/schema.ts").Schema<string | null, string | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
285
|
+
created_at: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
286
|
+
/**
|
|
287
|
+
* Human-readable scope label (`full` / `full (grandfathered)` /
|
|
288
|
+
* `N methods`). A label rather than the document so the list stays a display
|
|
289
|
+
* surface — nothing authorizes off this, and a grandfathered token reads
|
|
290
|
+
* differently from a deliberately-full one.
|
|
291
|
+
*/
|
|
292
|
+
scope: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
293
|
+
}>;
|
|
294
|
+
export type ClientApiTokenJson = Infer<typeof ClientApiTokenJson>;
|
|
268
295
|
/** The role_grant summary returned in admin account listings, a `@fuzdev/fuz_schema` schema. */
|
|
269
296
|
export declare const RoleGrantSummaryJson: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
270
297
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -309,11 +336,11 @@ export declare const RoleGrantSummaryJson: import("@fuzdev/fuz_schema/schema.ts"
|
|
|
309
336
|
export type RoleGrantSummaryJson = Infer<typeof RoleGrantSummaryJson>;
|
|
310
337
|
/** The actor summary returned in admin account listings, a `@fuzdev/fuz_schema` schema. */
|
|
311
338
|
export declare const ActorSummaryJson: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
312
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
313
339
|
name: string;
|
|
340
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
314
341
|
}, {
|
|
315
|
-
id: string;
|
|
316
342
|
name: string;
|
|
343
|
+
id: string;
|
|
317
344
|
}, "object", {
|
|
318
345
|
id: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
319
346
|
readonly '~types'?: {
|
|
@@ -447,8 +474,8 @@ export declare const AdminAccountEntryJson: import("@fuzdev/fuz_schema/schema.ts
|
|
|
447
474
|
deleted_at: string | null;
|
|
448
475
|
};
|
|
449
476
|
actor: {
|
|
450
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
451
477
|
name: string;
|
|
478
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
452
479
|
} | null;
|
|
453
480
|
role_grants: {
|
|
454
481
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -481,8 +508,8 @@ export declare const AdminAccountEntryJson: import("@fuzdev/fuz_schema/schema.ts
|
|
|
481
508
|
deleted_at: string | null;
|
|
482
509
|
};
|
|
483
510
|
actor: {
|
|
484
|
-
id: string;
|
|
485
511
|
name: string;
|
|
512
|
+
id: string;
|
|
486
513
|
} | null;
|
|
487
514
|
role_grants: {
|
|
488
515
|
id: string;
|
|
@@ -549,17 +576,17 @@ export declare const AdminAccountEntryJson: import("@fuzdev/fuz_schema/schema.ts
|
|
|
549
576
|
created_at: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
550
577
|
}>;
|
|
551
578
|
actor: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
552
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
553
579
|
name: string;
|
|
580
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
554
581
|
} | null, {
|
|
555
|
-
id: string;
|
|
556
582
|
name: string;
|
|
583
|
+
id: string;
|
|
557
584
|
} | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
558
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
559
585
|
name: string;
|
|
586
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
560
587
|
}, {
|
|
561
|
-
id: string;
|
|
562
588
|
name: string;
|
|
589
|
+
id: string;
|
|
563
590
|
}, "object", {
|
|
564
591
|
id: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
565
592
|
readonly '~types'?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/account_schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"account_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/account_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAON,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;A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AAI,CAAC;IACxB,0GAA0G;IAC1G,eAAe,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,OAAO,KAAG,cAMpD,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,OAAO,KAAG,gBAKlD,CAAC"}
|
|
@@ -5,27 +5,25 @@
|
|
|
5
5
|
* `Account`, `Actor`, `RoleGrant`, `AuthSession`, and `ApiToken`.
|
|
6
6
|
*
|
|
7
7
|
* Identifier primitives (`Username`, `UsernameProvided`, `Email`) live
|
|
8
|
-
* in `primitive_schemas.ts` — they're general
|
|
9
|
-
* don't depend on the auth domain. The auth-shape request-contract
|
|
8
|
+
* in `primitive_schemas.ts` and `primitive_schemas_fuz.ts` — they're general
|
|
9
|
+
* validator shapes that don't depend on the auth domain. The auth-shape request-contract
|
|
10
10
|
* primitive `ActingActor` lives in `http/auth_shape.ts` next to
|
|
11
11
|
* `RouteAuth` (the two pair: `auth.actor !== 'none'` ⟺ input declares
|
|
12
12
|
* `acting?: ActingActor`).
|
|
13
13
|
*
|
|
14
|
-
* The wire schemas are `@fuzdev/fuz_schema` schemas, `SessionId` among them
|
|
15
|
-
* but for `ClientApiTokenJson`, which is Zod.
|
|
14
|
+
* The wire schemas are `@fuzdev/fuz_schema` schemas, `SessionId` among them.
|
|
16
15
|
*
|
|
17
16
|
* DDL lives in `auth/auth_ddl.ts`; role system in `auth/role_schema.ts`.
|
|
18
17
|
* See docs/identity.md for design rationale.
|
|
19
18
|
*
|
|
20
19
|
* @module
|
|
21
20
|
*/
|
|
22
|
-
import { z } from 'zod';
|
|
23
21
|
import { meta } from '@fuzdev/fuz_schema/meta.ts';
|
|
24
22
|
import { array, boolean, brand, nullable, object, string } from '@fuzdev/fuz_schema/schema.ts';
|
|
25
|
-
import { Uuid as ZodUuid } from '../primitive_schemas.js';
|
|
26
23
|
import { Blake3Hash, Email, Timestamp, UsernameCanonical, Uuid } from '../primitive_schemas_fuz.js';
|
|
27
|
-
import { RoleName } from './
|
|
28
|
-
import { ScopeKindName } from './
|
|
24
|
+
import { RoleName } from './role_schema.js';
|
|
25
|
+
import { ScopeKindName } from './scope_kind_schema.js';
|
|
26
|
+
import { ApiTokenId } from './api_token.js';
|
|
29
27
|
import { is_iso8601_seconds_live } from '../timestamp.js';
|
|
30
28
|
/**
|
|
31
29
|
* Maximum length of the optional free-form `revoked_reason` attached to a
|
|
@@ -111,22 +109,22 @@ export const AuthSessionJson = object({
|
|
|
111
109
|
description: 'Whether this is the session the request authenticated with — `false` on every row for a non-session credential.'
|
|
112
110
|
})
|
|
113
111
|
});
|
|
114
|
-
/**
|
|
115
|
-
export const ClientApiTokenJson =
|
|
116
|
-
id:
|
|
117
|
-
account_id:
|
|
118
|
-
name:
|
|
119
|
-
expires_at:
|
|
120
|
-
last_used_at:
|
|
121
|
-
last_used_ip:
|
|
122
|
-
created_at:
|
|
112
|
+
/** Client-safe API token listing (excludes `token_hash`), a `@fuzdev/fuz_schema` schema. */
|
|
113
|
+
export const ClientApiTokenJson = object({
|
|
114
|
+
id: ApiTokenId,
|
|
115
|
+
account_id: Uuid,
|
|
116
|
+
name: string,
|
|
117
|
+
expires_at: nullable(Timestamp),
|
|
118
|
+
last_used_at: nullable(Timestamp),
|
|
119
|
+
last_used_ip: nullable(string),
|
|
120
|
+
created_at: Timestamp,
|
|
123
121
|
/**
|
|
124
122
|
* Human-readable scope label (`full` / `full (grandfathered)` /
|
|
125
123
|
* `N methods`). A label rather than the document so the list stays a display
|
|
126
124
|
* surface — nothing authorizes off this, and a grandfathered token reads
|
|
127
125
|
* differently from a deliberately-full one.
|
|
128
126
|
*/
|
|
129
|
-
scope:
|
|
127
|
+
scope: string
|
|
130
128
|
});
|
|
131
129
|
/** The role_grant summary returned in admin account listings, a `@fuzdev/fuz_schema` schema. */
|
|
132
130
|
export const RoleGrantSummaryJson = object({
|
|
@@ -74,8 +74,8 @@ export declare const AdminAccountListOutput: import("@fuzdev/fuz_schema/schema.t
|
|
|
74
74
|
deleted_at: string | null;
|
|
75
75
|
};
|
|
76
76
|
actor: {
|
|
77
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
78
77
|
name: string;
|
|
78
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
79
79
|
} | null;
|
|
80
80
|
role_grants: {
|
|
81
81
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -111,8 +111,8 @@ export declare const AdminAccountListOutput: import("@fuzdev/fuz_schema/schema.t
|
|
|
111
111
|
deleted_at: string | null;
|
|
112
112
|
};
|
|
113
113
|
actor: {
|
|
114
|
-
id: string;
|
|
115
114
|
name: string;
|
|
115
|
+
id: string;
|
|
116
116
|
} | null;
|
|
117
117
|
role_grants: {
|
|
118
118
|
id: string;
|
|
@@ -148,8 +148,8 @@ export declare const AdminAccountListOutput: import("@fuzdev/fuz_schema/schema.t
|
|
|
148
148
|
deleted_at: string | null;
|
|
149
149
|
};
|
|
150
150
|
actor: {
|
|
151
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
152
151
|
name: string;
|
|
152
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
153
153
|
} | null;
|
|
154
154
|
role_grants: {
|
|
155
155
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -182,8 +182,8 @@ export declare const AdminAccountListOutput: import("@fuzdev/fuz_schema/schema.t
|
|
|
182
182
|
deleted_at: string | null;
|
|
183
183
|
};
|
|
184
184
|
actor: {
|
|
185
|
-
id: string;
|
|
186
185
|
name: string;
|
|
186
|
+
id: string;
|
|
187
187
|
} | null;
|
|
188
188
|
role_grants: {
|
|
189
189
|
id: string;
|
|
@@ -216,8 +216,8 @@ export declare const AdminAccountListOutput: import("@fuzdev/fuz_schema/schema.t
|
|
|
216
216
|
deleted_at: string | null;
|
|
217
217
|
};
|
|
218
218
|
actor: {
|
|
219
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
220
219
|
name: string;
|
|
220
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
221
221
|
} | null;
|
|
222
222
|
role_grants: {
|
|
223
223
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -250,8 +250,8 @@ export declare const AdminAccountListOutput: import("@fuzdev/fuz_schema/schema.t
|
|
|
250
250
|
deleted_at: string | null;
|
|
251
251
|
};
|
|
252
252
|
actor: {
|
|
253
|
-
id: string;
|
|
254
253
|
name: string;
|
|
254
|
+
id: string;
|
|
255
255
|
} | null;
|
|
256
256
|
role_grants: {
|
|
257
257
|
id: string;
|
|
@@ -312,17 +312,17 @@ export declare const AdminAccountListOutput: import("@fuzdev/fuz_schema/schema.t
|
|
|
312
312
|
created_at: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
313
313
|
}>;
|
|
314
314
|
actor: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
315
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
316
315
|
name: string;
|
|
316
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
317
317
|
} | null, {
|
|
318
|
-
id: string;
|
|
319
318
|
name: string;
|
|
319
|
+
id: string;
|
|
320
320
|
} | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
321
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
322
321
|
name: string;
|
|
322
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
323
323
|
}, {
|
|
324
|
-
id: string;
|
|
325
324
|
name: string;
|
|
325
|
+
id: string;
|
|
326
326
|
}, "object", {
|
|
327
327
|
id: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
328
328
|
readonly '~types'?: {
|
|
@@ -1538,8 +1538,8 @@ export declare const admin_account_list_action_spec: {
|
|
|
1538
1538
|
deleted_at: string | null;
|
|
1539
1539
|
};
|
|
1540
1540
|
actor: {
|
|
1541
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
1542
1541
|
name: string;
|
|
1542
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
1543
1543
|
} | null;
|
|
1544
1544
|
role_grants: {
|
|
1545
1545
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -1575,8 +1575,8 @@ export declare const admin_account_list_action_spec: {
|
|
|
1575
1575
|
deleted_at: string | null;
|
|
1576
1576
|
};
|
|
1577
1577
|
actor: {
|
|
1578
|
-
id: string;
|
|
1579
1578
|
name: string;
|
|
1579
|
+
id: string;
|
|
1580
1580
|
} | null;
|
|
1581
1581
|
role_grants: {
|
|
1582
1582
|
id: string;
|
|
@@ -1612,8 +1612,8 @@ export declare const admin_account_list_action_spec: {
|
|
|
1612
1612
|
deleted_at: string | null;
|
|
1613
1613
|
};
|
|
1614
1614
|
actor: {
|
|
1615
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
1616
1615
|
name: string;
|
|
1616
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
1617
1617
|
} | null;
|
|
1618
1618
|
role_grants: {
|
|
1619
1619
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -1646,8 +1646,8 @@ export declare const admin_account_list_action_spec: {
|
|
|
1646
1646
|
deleted_at: string | null;
|
|
1647
1647
|
};
|
|
1648
1648
|
actor: {
|
|
1649
|
-
id: string;
|
|
1650
1649
|
name: string;
|
|
1650
|
+
id: string;
|
|
1651
1651
|
} | null;
|
|
1652
1652
|
role_grants: {
|
|
1653
1653
|
id: string;
|
|
@@ -1680,8 +1680,8 @@ export declare const admin_account_list_action_spec: {
|
|
|
1680
1680
|
deleted_at: string | null;
|
|
1681
1681
|
};
|
|
1682
1682
|
actor: {
|
|
1683
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
1684
1683
|
name: string;
|
|
1684
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
1685
1685
|
} | null;
|
|
1686
1686
|
role_grants: {
|
|
1687
1687
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -1714,8 +1714,8 @@ export declare const admin_account_list_action_spec: {
|
|
|
1714
1714
|
deleted_at: string | null;
|
|
1715
1715
|
};
|
|
1716
1716
|
actor: {
|
|
1717
|
-
id: string;
|
|
1718
1717
|
name: string;
|
|
1718
|
+
id: string;
|
|
1719
1719
|
} | null;
|
|
1720
1720
|
role_grants: {
|
|
1721
1721
|
id: string;
|
|
@@ -1776,17 +1776,17 @@ export declare const admin_account_list_action_spec: {
|
|
|
1776
1776
|
created_at: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
1777
1777
|
}>;
|
|
1778
1778
|
actor: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
1779
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
1780
1779
|
name: string;
|
|
1780
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
1781
1781
|
} | null, {
|
|
1782
|
-
id: string;
|
|
1783
1782
|
name: string;
|
|
1783
|
+
id: string;
|
|
1784
1784
|
} | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
1785
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
1786
1785
|
name: string;
|
|
1786
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
1787
1787
|
}, {
|
|
1788
|
-
id: string;
|
|
1789
1788
|
name: string;
|
|
1789
|
+
id: string;
|
|
1790
1790
|
}, "object", {
|
|
1791
1791
|
id: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
1792
1792
|
readonly '~types'?: {
|
|
@@ -17,13 +17,11 @@
|
|
|
17
17
|
import { meta } from '@fuzdev/fuz_schema/meta.ts';
|
|
18
18
|
import { array, boolean, check_at, integer, literal, max_value, message, min_value, nullable, number, object, optional, pipe, with_default_fn } from '@fuzdev/fuz_schema/schema.ts';
|
|
19
19
|
import { ActingActor, Email, Username, Uuid } from '../primitive_schemas_fuz.js';
|
|
20
|
-
import { ROLE_ADMIN, ROLE_KEEPER } from './role_schema.js';
|
|
21
|
-
import { RoleName } from './role_schema_fuz.js';
|
|
20
|
+
import { ROLE_ADMIN, ROLE_KEEPER, RoleName } from './role_schema.js';
|
|
22
21
|
import { CREDENTIAL_TYPE_DAEMON_TOKEN } from './credential_type_schema.js';
|
|
23
22
|
import { NAME_LENGTH_MAX } from './name_schema.js';
|
|
24
23
|
import { AdminAccountEntryJson } from './account_schema.js';
|
|
25
|
-
import { AdminSessionJson, AUDIT_LOG_DEFAULT_LIMIT, AuditLogEventWithUsernamesJson, RoleGrantHistoryEventJson } from './audit_log_schema.js';
|
|
26
|
-
import { AuditEventTypeName, AuditOutcome } from './audit_log_schema_fuz.js';
|
|
24
|
+
import { AdminSessionJson, AUDIT_LOG_DEFAULT_LIMIT, AuditEventTypeName, AuditLogEventWithUsernamesJson, AuditOutcome, RoleGrantHistoryEventJson } from './audit_log_schema.js';
|
|
27
25
|
import { InviteJson, InviteWithUsernamesJson } from './invite_schema.js';
|
|
28
26
|
import { AppSettingsWithUsernameJson } from './app_settings_schema.js';
|
|
29
27
|
import { ERROR_LIMIT_INVALID, ERROR_OFFSET_INVALID, ERROR_OUTCOME_INVALID, ERROR_SINCE_SEQ_INVALID } from '../http/error_schemas.js';
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
* @module
|
|
30
30
|
*/
|
|
31
31
|
import { type RpcAction } from '../actions/action_types.js';
|
|
32
|
-
import { type
|
|
32
|
+
import { type RoleRegistry } from './role_schema.js';
|
|
33
33
|
import type { RevokingActionFactoryDeps } from './deps.js';
|
|
34
34
|
/** Options for `create_admin_actions`. */
|
|
35
35
|
export interface AdminActionOptions {
|
|
36
36
|
/**
|
|
37
|
-
* Role
|
|
37
|
+
* Role registry from `create_role_registry()`. Defaults to builtin
|
|
38
38
|
* roles only. Used to derive `grantable_roles` (the subset whose
|
|
39
39
|
* `RoleSpec.grant_paths` includes `'admin'`) returned by
|
|
40
40
|
* `admin_account_list`.
|
|
41
41
|
*/
|
|
42
|
-
roles?:
|
|
42
|
+
roles?: RoleRegistry;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Create the admin-only RPC actions.
|
|
@@ -51,7 +51,7 @@ export interface AdminActionOptions {
|
|
|
51
51
|
* encapsulates listener fan-out and the optional `AuditLogConfig`.
|
|
52
52
|
* `connection_closer` closes the target account's live connections after a
|
|
53
53
|
* revoke-all, delete, or purge commits.
|
|
54
|
-
* @param options - role
|
|
54
|
+
* @param options - role registry for `grantable_roles` derivation
|
|
55
55
|
* @returns the `RpcAction` array to spread into a `create_rpc_endpoint` call
|
|
56
56
|
*/
|
|
57
57
|
export declare const create_admin_actions: (deps: RevokingActionFactoryDeps, options?: AdminActionOptions) => Array<RpcAction>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/admin_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAIjG,OAAO,EAKN,KAAK,
|
|
1
|
+
{"version":3,"file":"admin_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/admin_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAIjG,OAAO,EAKN,KAAK,YAAY,EACjB,MAAM,kBAAkB,CAAC;AA2C1B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AA0D3D,0CAA0C;AAC1C,MAAM,WAAW,kBAAkB;IAClC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB,GAChC,MAAM,yBAAyB,EAC/B,UAAS,kBAAuB,KAC9B,KAAK,CAAC,SAAS,CA6hBjB,CAAC"}
|
|
@@ -32,7 +32,7 @@ import { rpc_action } from '../actions/action_types.js';
|
|
|
32
32
|
import { queue_connection_close } from '../actions/connection_closer.js';
|
|
33
33
|
import { credential_type_required_error } from '../actions/perform_action.js';
|
|
34
34
|
import { jsonrpc_errors, ThrownJsonrpcError } from '../http/jsonrpc_errors.js';
|
|
35
|
-
import {
|
|
35
|
+
import { builtin_role_specs, list_roles_with_grant_path, ROLE_ADMIN, ROLE_KEEPER } from './role_schema.js';
|
|
36
36
|
import { has_scoped_role } from './request_context.js';
|
|
37
37
|
import { query_account_has_global_role, query_account_has_active_global_role, query_count_active_accounts_with_global_role_for_update } from './role_grant_queries.js';
|
|
38
38
|
import { GRANT_PATH_ADMIN } from './grant_path_schema.js';
|
|
@@ -57,11 +57,11 @@ import { admin_account_list_action_spec, admin_session_list_action_spec, admin_s
|
|
|
57
57
|
* encapsulates listener fan-out and the optional `AuditLogConfig`.
|
|
58
58
|
* `connection_closer` closes the target account's live connections after a
|
|
59
59
|
* revoke-all, delete, or purge commits.
|
|
60
|
-
* @param options - role
|
|
60
|
+
* @param options - role registry for `grantable_roles` derivation
|
|
61
61
|
* @returns the `RpcAction` array to spread into a `create_rpc_endpoint` call
|
|
62
62
|
*/
|
|
63
63
|
export const create_admin_actions = (deps, options = {}) => {
|
|
64
|
-
const role_specs = options.roles?.role_specs ??
|
|
64
|
+
const role_specs = options.roles?.role_specs ?? builtin_role_specs;
|
|
65
65
|
const grantable_roles = list_roles_with_grant_path(role_specs, GRANT_PATH_ADMIN);
|
|
66
66
|
const { connection_closer } = deps;
|
|
67
67
|
const account_list_handler = async (input, ctx) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RpcAction } from '../actions/action_types.js';
|
|
2
2
|
import { type CellActionDeps } from './cell_actions.js';
|
|
3
3
|
import { type CellGrantCreateAuthorize, type CellGrantRevokeAuthorize } from './cell_grant_actions.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { RoleRegistry } from './role_schema.js';
|
|
5
5
|
/**
|
|
6
6
|
* Dependencies for `create_all_cell_actions` — the CRUD factory's
|
|
7
7
|
* `CellActionDeps` plus the grant factory's optional `authorize_grant_create`
|
|
@@ -19,7 +19,7 @@ export type AllCellActionDeps = CellActionDeps & {
|
|
|
19
19
|
* schema (the same one `create_standard_rpc_actions` takes).
|
|
20
20
|
*/
|
|
21
21
|
export interface AllCellActionsOptions {
|
|
22
|
-
readonly roles:
|
|
22
|
+
readonly roles: RoleRegistry;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Build the full cell RPC action set — CRUD (`create_cell_actions`,
|
|
@@ -39,7 +39,7 @@ export interface AllCellActionsOptions {
|
|
|
39
39
|
*
|
|
40
40
|
* @param deps - `AllCellActionDeps` (`log`, `audit`, the optional `validate_data`,
|
|
41
41
|
* `authorize_create`, `authorize_grant_create`, and `authorize_grant_revoke`)
|
|
42
|
-
* @param options - the role
|
|
42
|
+
* @param options - the role registry for grant validation
|
|
43
43
|
* @returns every cell `RpcAction`, in mount order
|
|
44
44
|
*/
|
|
45
45
|
export declare const create_all_cell_actions: (deps: AllCellActionDeps, options: AllCellActionsOptions) => Array<RpcAction>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all_cell_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/all_cell_actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAEN,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"all_cell_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/all_cell_actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAEN,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG;IAChD,sBAAsB,CAAC,EAAE,wBAAwB,CAAC;IAClD,sBAAsB,CAAC,EAAE,wBAAwB,CAAC;CAClD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,uBAAuB,GACnC,MAAM,iBAAiB,EACvB,SAAS,qBAAqB,KAC5B,KAAK,CAAC,SAAS,CAMjB,CAAC"}
|
|
@@ -21,7 +21,7 @@ import { create_cell_audit_actions } from './cell_audit_actions.js';
|
|
|
21
21
|
*
|
|
22
22
|
* @param deps - `AllCellActionDeps` (`log`, `audit`, the optional `validate_data`,
|
|
23
23
|
* `authorize_create`, `authorize_grant_create`, and `authorize_grant_revoke`)
|
|
24
|
-
* @param options - the role
|
|
24
|
+
* @param options - the role registry for grant validation
|
|
25
25
|
* @returns every cell `RpcAction`, in mount order
|
|
26
26
|
*/
|
|
27
27
|
export const create_all_cell_actions = (deps, options) => [
|
package/dist/auth/api_token.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
12
12
|
/** Prefix for all fuz API tokens (enables secret scanning). */
|
|
13
13
|
export declare const API_TOKEN_PREFIX = "secret_fuz_token_";
|
|
14
14
|
/** Random bytes encoded into the raw token body (256 bits). */
|
|
@@ -37,9 +37,9 @@ export declare const is_api_token_shaped: (raw: string) => boolean;
|
|
|
37
37
|
* by `generate_api_token`.
|
|
38
38
|
*/
|
|
39
39
|
export declare const API_TOKEN_ID_REGEX: RegExp;
|
|
40
|
-
/**
|
|
41
|
-
export declare const ApiTokenId:
|
|
42
|
-
export type ApiTokenId =
|
|
40
|
+
/** The public API token id, `API_TOKEN_ID_REGEX`, a `@fuzdev/fuz_schema` schema. */
|
|
41
|
+
export declare const ApiTokenId: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
42
|
+
export type ApiTokenId = Infer<typeof ApiTokenId>;
|
|
43
43
|
/**
|
|
44
44
|
* Hash an API token for storage using blake3.
|
|
45
45
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_token.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/api_token.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"api_token.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/api_token.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAuB,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAK/E,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,sBAAsB,CAAC;AAEpD,+DAA+D;AAC/D,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,oFAAoF;AACpF,eAAO,MAAM,qBAAqB,QAA+C,CAAC;AAElF;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAE3B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,KAAG,OAAoC,CAAC;AAEvF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,QAA4B,CAAC;AAE5D,oFAAoF;AACpF,eAAO,MAAM,UAAU,+IAA0C,CAAC;AAClE,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,MAA4B,CAAC;AAE5E;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,QAAO;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAMpF,CAAC"}
|
package/dist/auth/api_token.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import { pipe, regex, string } from '@fuzdev/fuz_schema/schema.ts';
|
|
12
12
|
import { hash_blake3 } from '@fuzdev/fuz_util/hash_blake3.ts';
|
|
13
13
|
import { generate_random_base64url } from '../crypto.js';
|
|
14
14
|
/** Prefix for all fuz API tokens (enables secret scanning). */
|
|
@@ -39,8 +39,8 @@ export const is_api_token_shaped = (raw) => API_TOKEN_REGEX.test(raw);
|
|
|
39
39
|
* by `generate_api_token`.
|
|
40
40
|
*/
|
|
41
41
|
export const API_TOKEN_ID_REGEX = /^tok_[A-Za-z0-9_-]{12}$/;
|
|
42
|
-
/**
|
|
43
|
-
export const ApiTokenId =
|
|
42
|
+
/** The public API token id, `API_TOKEN_ID_REGEX`, a `@fuzdev/fuz_schema` schema. */
|
|
43
|
+
export const ApiTokenId = pipe(string, regex(API_TOKEN_ID_REGEX));
|
|
44
44
|
/**
|
|
45
45
|
* Hash an API token for storage using blake3.
|
|
46
46
|
*
|