@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/account_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"account_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/account_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAaN,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAMtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAW3E,kGAAkG;AAClG,eAAO,MAAM,WAAW,iFAAW,CAAC;AACpC,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEpD,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,iFAAW,CAAC;AACzC,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE9D,wEAAwE;AACxE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;EAE7B,CAAC;AACH,MAAM,MAA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
@@ -7,19 +7,18 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
|
-
import { z } from 'zod';
|
|
11
10
|
import { meta } from '@fuzdev/fuz_schema/meta.ts';
|
|
12
|
-
import { array, boolean, literal, object, pipe,
|
|
13
|
-
import { bounded_string } from '../
|
|
11
|
+
import { array, boolean, integer, literal, min_value, nullable, number, object, pipe, string, void as fuz_void, with_default } from '@fuzdev/fuz_schema/schema.ts';
|
|
12
|
+
import { bounded_string, Timestamp } from '../primitive_schemas_fuz.js';
|
|
14
13
|
import { TokenScopeInput } from './token_scope.js';
|
|
15
14
|
import { TokenLifetimeInput } from './token_lifetime.js';
|
|
16
15
|
import { AuthSessionJson, ClientApiTokenJson, SessionAccountJson, SessionId } from './account_schema.js';
|
|
17
|
-
import {
|
|
16
|
+
import { ApiTokenId } from './api_token.js';
|
|
18
17
|
// -- Input/output schemas ---------------------------------------------------
|
|
19
|
-
/** Input for `account_verify`. No parameters — the caller is the subject. */
|
|
20
|
-
export const VerifyInput =
|
|
21
|
-
/** Input for `account_session_list`. No parameters. */
|
|
22
|
-
export const SessionListInput =
|
|
18
|
+
/** Input for `account_verify`, fuz_schema's `void`. No parameters — the caller is the subject. */
|
|
19
|
+
export const VerifyInput = fuz_void;
|
|
20
|
+
/** Input for `account_session_list`, fuz_schema's `void`. No parameters. */
|
|
21
|
+
export const SessionListInput = fuz_void;
|
|
23
22
|
/** Output for `account_session_list`, a `@fuzdev/fuz_schema` schema. */
|
|
24
23
|
export const SessionListOutput = object({
|
|
25
24
|
sessions: array(AuthSessionJson)
|
|
@@ -31,17 +30,23 @@ export const SessionListOutput = object({
|
|
|
31
30
|
export const SessionRevokeInput = object({
|
|
32
31
|
session_id: meta(SessionId, { description: 'Session id (blake3 hash) to revoke.' })
|
|
33
32
|
});
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Output for `account_session_revoke`, a `@fuzdev/fuz_schema` schema.
|
|
35
|
+
* `revoked` is `false` for IDOR misses.
|
|
36
|
+
*/
|
|
37
|
+
export const SessionRevokeOutput = object({
|
|
38
|
+
ok: literal(true),
|
|
39
|
+
revoked: boolean
|
|
38
40
|
});
|
|
39
|
-
/** Input for `account_session_revoke_all`. No parameters. */
|
|
40
|
-
export const SessionRevokeAllInput =
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
/** Input for `account_session_revoke_all`, fuz_schema's `void`. No parameters. */
|
|
42
|
+
export const SessionRevokeAllInput = fuz_void;
|
|
43
|
+
/**
|
|
44
|
+
* Output for `account_session_revoke_all`, a `@fuzdev/fuz_schema` schema.
|
|
45
|
+
* `count` is the number of sessions revoked.
|
|
46
|
+
*/
|
|
47
|
+
export const SessionRevokeAllOutput = object({
|
|
48
|
+
ok: literal(true),
|
|
49
|
+
count: pipe(number, integer, min_value(0))
|
|
45
50
|
});
|
|
46
51
|
/**
|
|
47
52
|
* Maximum length of an API token's `name`, in UTF-16 code units (what
|
|
@@ -63,61 +68,57 @@ export const ERROR_TOKEN_SCOPE_INVALID = 'token_scope_invalid';
|
|
|
63
68
|
*/
|
|
64
69
|
export const ERROR_TOKEN_LIFETIME_INVALID = 'token_lifetime_invalid';
|
|
65
70
|
/**
|
|
66
|
-
* Input for `account_token_create
|
|
71
|
+
* Input for `account_token_create`, a `@fuzdev/fuz_schema` schema.
|
|
67
72
|
*
|
|
68
73
|
* `scope` is **required** — default-deny at mint. There is deliberately no
|
|
69
74
|
* permissive default: a caller who wants full authority spells
|
|
70
75
|
* `{kind: 'full'}`, and the stored document records that they did. That is the
|
|
71
76
|
* reversal of the 2026-02 design, where the field existed but nothing depended
|
|
72
|
-
* on it. Because `scope` has no default, the object as a whole
|
|
73
|
-
* carries `.prefault({})`.
|
|
77
|
+
* on it. Because `scope` has no default, the object as a whole has none.
|
|
74
78
|
*
|
|
75
79
|
* `lifetime` follows the same rule — a never-expiring token is
|
|
76
80
|
* `{kind: 'eternal'}`, spelled out, so `expires_at IS NULL` always means
|
|
77
81
|
* "deliberately eternal" (see `auth/token_lifetime.ts`).
|
|
78
82
|
*/
|
|
79
|
-
export const TokenCreateInput =
|
|
80
|
-
name: bounded_string({ max: API_TOKEN_NAME_LENGTH_MAX })
|
|
81
|
-
.default('CLI token')
|
|
82
|
-
.meta({
|
|
83
|
+
export const TokenCreateInput = object({
|
|
84
|
+
name: meta(with_default(bounded_string({ max: API_TOKEN_NAME_LENGTH_MAX }), 'CLI token'), {
|
|
83
85
|
description: `Human-friendly label; shown in the token list. At most ${API_TOKEN_NAME_LENGTH_MAX} characters.`
|
|
84
86
|
}),
|
|
85
|
-
scope:
|
|
87
|
+
scope: meta(TokenScopeInput, {
|
|
86
88
|
description: "What the token may do. `{kind:'full'}` for full account authority, or " +
|
|
87
89
|
"`{kind:'methods',methods:[…]}` to narrow it to named RPC methods — a " +
|
|
88
90
|
'narrowed token is RPC-only and reaches no non-RPC surface that reads ' +
|
|
89
91
|
'account data or carries authority.',
|
|
90
92
|
invalid_reason: ERROR_TOKEN_SCOPE_INVALID
|
|
91
93
|
}),
|
|
92
|
-
lifetime:
|
|
94
|
+
lifetime: meta(TokenLifetimeInput, {
|
|
93
95
|
description: "How long the token lives. `{kind:'eternal'}` never expires; " +
|
|
94
96
|
"`{kind:'ttl',days:N}` expires N days from mint.",
|
|
95
97
|
invalid_reason: ERROR_TOKEN_LIFETIME_INVALID
|
|
96
98
|
})
|
|
97
99
|
});
|
|
98
|
-
/**
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
/**
|
|
101
|
+
* Output for `account_token_create`, a `@fuzdev/fuz_schema` schema. `token`
|
|
102
|
+
* is returned exactly once.
|
|
103
|
+
*/
|
|
104
|
+
export const TokenCreateOutput = object({
|
|
105
|
+
ok: literal(true),
|
|
106
|
+
token: meta(string, { description: 'Raw token — shown once, store securely.' }),
|
|
102
107
|
id: ApiTokenId,
|
|
103
|
-
name:
|
|
104
|
-
expires_at:
|
|
105
|
-
.
|
|
106
|
-
|
|
107
|
-
.meta({ description: 'ISO 8601 expiry, or `null` for an eternal token.' })
|
|
108
|
+
name: string,
|
|
109
|
+
expires_at: meta(nullable(Timestamp), {
|
|
110
|
+
description: 'ISO 8601 expiry, or `null` for an eternal token.'
|
|
111
|
+
})
|
|
108
112
|
});
|
|
109
|
-
/** Input for `account_token_list`. No parameters. */
|
|
110
|
-
export const TokenListInput =
|
|
111
|
-
/** Output for `account_token_list
|
|
112
|
-
export const TokenListOutput =
|
|
113
|
-
tokens:
|
|
113
|
+
/** Input for `account_token_list`, fuz_schema's `void`. No parameters. */
|
|
114
|
+
export const TokenListInput = fuz_void;
|
|
115
|
+
/** Output for `account_token_list`, a `@fuzdev/fuz_schema` schema. Hashes are excluded. */
|
|
116
|
+
export const TokenListOutput = object({
|
|
117
|
+
tokens: array(ClientApiTokenJson)
|
|
114
118
|
});
|
|
115
|
-
/**
|
|
116
|
-
* Input for `account_token_revoke`, a `@fuzdev/fuz_schema` schema. Its
|
|
117
|
-
* `token_id` is `ApiTokenId`'s check written inline, as `ApiTokenId` is Zod.
|
|
118
|
-
*/
|
|
119
|
+
/** Input for `account_token_revoke`, a `@fuzdev/fuz_schema` schema. */
|
|
119
120
|
export const TokenRevokeInput = object({
|
|
120
|
-
token_id: meta(
|
|
121
|
+
token_id: meta(ApiTokenId, {
|
|
121
122
|
description: 'Public API token id (e.g. `tok_<12 chars>`).'
|
|
122
123
|
})
|
|
123
124
|
});
|
|
@@ -11,12 +11,11 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
|
-
import { z } from 'zod';
|
|
15
14
|
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
16
15
|
import type { RouteSpec } from '../http/route_spec.js';
|
|
17
|
-
/** Input for `GET /api/account/status`. No parameters — caller is the subject. */
|
|
18
|
-
export declare const AccountStatusInput:
|
|
19
|
-
export type AccountStatusInput =
|
|
16
|
+
/** Input for `GET /api/account/status`, `literal(null)`. No parameters — caller is the subject. */
|
|
17
|
+
export declare const AccountStatusInput: import("@fuzdev/fuz_schema/schema.ts").Schema<null, null, "literal", null>;
|
|
18
|
+
export type AccountStatusInput = Infer<typeof AccountStatusInput>;
|
|
20
19
|
/** Output for `GET /api/account/status`, a `@fuzdev/fuz_schema` schema. */
|
|
21
20
|
export declare const AccountStatusOutput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
22
21
|
account: {
|
|
@@ -27,8 +26,8 @@ export declare const AccountStatusOutput: import("@fuzdev/fuz_schema/schema.ts")
|
|
|
27
26
|
email_verified: boolean;
|
|
28
27
|
};
|
|
29
28
|
actor: {
|
|
30
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
31
29
|
name: string;
|
|
30
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
32
31
|
} | null;
|
|
33
32
|
role_grants: {
|
|
34
33
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -48,8 +47,8 @@ export declare const AccountStatusOutput: import("@fuzdev/fuz_schema/schema.ts")
|
|
|
48
47
|
email_verified: boolean;
|
|
49
48
|
};
|
|
50
49
|
actor: {
|
|
51
|
-
id: string;
|
|
52
50
|
name: string;
|
|
51
|
+
id: string;
|
|
53
52
|
} | null;
|
|
54
53
|
role_grants: {
|
|
55
54
|
id: string;
|
|
@@ -86,17 +85,17 @@ export declare const AccountStatusOutput: import("@fuzdev/fuz_schema/schema.ts")
|
|
|
86
85
|
created_at: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
87
86
|
}>;
|
|
88
87
|
actor: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
89
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
90
88
|
name: string;
|
|
89
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
91
90
|
} | null, {
|
|
92
|
-
id: string;
|
|
93
91
|
name: string;
|
|
92
|
+
id: string;
|
|
94
93
|
} | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
95
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
96
94
|
name: string;
|
|
95
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
97
96
|
}, {
|
|
98
|
-
id: string;
|
|
99
97
|
name: string;
|
|
98
|
+
id: string;
|
|
100
99
|
}, "object", {
|
|
101
100
|
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">)[]> & {
|
|
102
101
|
readonly '~types'?: {
|
|
@@ -164,45 +163,100 @@ export declare const AccountStatusOutput: import("@fuzdev/fuz_schema/schema.ts")
|
|
|
164
163
|
}>>;
|
|
165
164
|
}>;
|
|
166
165
|
export type AccountStatusOutput = Infer<typeof AccountStatusOutput>;
|
|
167
|
-
/**
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
export
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
username:
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
166
|
+
/**
|
|
167
|
+
* Error body for `GET /api/account/status` on the unauthenticated path, a
|
|
168
|
+
* `@fuzdev/fuz_schema` schema.
|
|
169
|
+
*/
|
|
170
|
+
export declare const AccountStatusUnauthenticatedError: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
171
|
+
error: "authentication_required";
|
|
172
|
+
bootstrap_available?: boolean | undefined;
|
|
173
|
+
} & Record<string, unknown>, {
|
|
174
|
+
error: "authentication_required";
|
|
175
|
+
bootstrap_available?: boolean | undefined;
|
|
176
|
+
} & Record<string, unknown>, "loose_object", {
|
|
177
|
+
error: import("@fuzdev/fuz_schema/schema.ts").Schema<"authentication_required", "authentication_required", "literal", "authentication_required">;
|
|
178
|
+
bootstrap_available: import("@fuzdev/fuz_schema/schema.ts").Schema<boolean | undefined, boolean | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<boolean, boolean, "boolean", undefined>>>;
|
|
179
|
+
}>;
|
|
180
|
+
export type AccountStatusUnauthenticatedError = Infer<typeof AccountStatusUnauthenticatedError>;
|
|
181
|
+
/**
|
|
182
|
+
* Input for `POST /login`, a `@fuzdev/fuz_schema` schema. Accepts a username
|
|
183
|
+
* or email in the `username` field.
|
|
184
|
+
*/
|
|
185
|
+
export declare const LoginInput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
186
|
+
username: string;
|
|
187
|
+
password: string;
|
|
188
|
+
}, {
|
|
189
|
+
username: string;
|
|
190
|
+
password: string;
|
|
191
|
+
}, "object", {
|
|
192
|
+
username: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
193
|
+
password: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
194
|
+
}>;
|
|
195
|
+
export type LoginInput = Infer<typeof LoginInput>;
|
|
196
|
+
/**
|
|
197
|
+
* Output for `POST /login`, a `@fuzdev/fuz_schema` schema. Session cookie is
|
|
198
|
+
* the operative side effect.
|
|
199
|
+
*/
|
|
200
|
+
export declare const LoginOutput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
201
|
+
ok: true;
|
|
202
|
+
}, {
|
|
203
|
+
ok: true;
|
|
204
|
+
}, "object", {
|
|
205
|
+
ok: import("@fuzdev/fuz_schema/schema.ts").Schema<true, true, "literal", true>;
|
|
206
|
+
}>;
|
|
207
|
+
export type LoginOutput = Infer<typeof LoginOutput>;
|
|
208
|
+
/** Input for `POST /logout`, `literal(null)`. Session identity flows through the cookie. */
|
|
209
|
+
export declare const LogoutInput: import("@fuzdev/fuz_schema/schema.ts").Schema<null, null, "literal", null>;
|
|
210
|
+
export type LogoutInput = Infer<typeof LogoutInput>;
|
|
211
|
+
/**
|
|
212
|
+
* Output for `POST /logout`, a `@fuzdev/fuz_schema` schema. Includes the
|
|
213
|
+
* revoked account's username for UI redraw, as the account row holds it.
|
|
214
|
+
*/
|
|
215
|
+
export declare const LogoutOutput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
216
|
+
username: string;
|
|
217
|
+
ok: true;
|
|
218
|
+
}, {
|
|
219
|
+
username: string;
|
|
220
|
+
ok: true;
|
|
221
|
+
}, "object", {
|
|
222
|
+
ok: import("@fuzdev/fuz_schema/schema.ts").Schema<true, true, "literal", true>;
|
|
223
|
+
username: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
224
|
+
}>;
|
|
225
|
+
export type LogoutOutput = Infer<typeof LogoutOutput>;
|
|
226
|
+
/**
|
|
227
|
+
* Input for `POST /password`, a `@fuzdev/fuz_schema` schema.
|
|
228
|
+
* `current_password` is minimally validated; `new_password` enforces the full
|
|
229
|
+
* policy.
|
|
230
|
+
*/
|
|
231
|
+
export declare const PasswordChangeInput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
232
|
+
current_password: string;
|
|
233
|
+
new_password: string;
|
|
234
|
+
}, {
|
|
235
|
+
current_password: string;
|
|
236
|
+
new_password: string;
|
|
237
|
+
}, "object", {
|
|
238
|
+
current_password: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
239
|
+
new_password: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
240
|
+
}>;
|
|
241
|
+
export type PasswordChangeInput = Infer<typeof PasswordChangeInput>;
|
|
242
|
+
/**
|
|
243
|
+
* Output for `POST /password`, a `@fuzdev/fuz_schema` schema. Counts are
|
|
244
|
+
* returned so the UI can summarize the revoke-all cascade.
|
|
245
|
+
*/
|
|
246
|
+
export declare const PasswordChangeOutput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
247
|
+
sessions_revoked: number;
|
|
248
|
+
tokens_revoked: number;
|
|
249
|
+
ok: true;
|
|
250
|
+
}, {
|
|
251
|
+
sessions_revoked: number;
|
|
252
|
+
tokens_revoked: number;
|
|
253
|
+
ok: true;
|
|
254
|
+
}, "object", {
|
|
255
|
+
ok: import("@fuzdev/fuz_schema/schema.ts").Schema<true, true, "literal", true>;
|
|
256
|
+
sessions_revoked: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<number, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>>;
|
|
257
|
+
tokens_revoked: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<number, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>>;
|
|
258
|
+
}>;
|
|
259
|
+
export type PasswordChangeOutput = Infer<typeof PasswordChangeOutput>;
|
|
206
260
|
/**
|
|
207
261
|
* Default maximum sessions per account.
|
|
208
262
|
*
|
|
@@ -237,7 +291,7 @@ export declare const account_status_route_shape: {
|
|
|
237
291
|
};
|
|
238
292
|
reads_credential: true;
|
|
239
293
|
description: string;
|
|
240
|
-
input:
|
|
294
|
+
input: import("@fuzdev/fuz_schema/schema.ts").Schema<null, null, "literal", null>;
|
|
241
295
|
output: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
242
296
|
account: {
|
|
243
297
|
email: string | null;
|
|
@@ -247,8 +301,8 @@ export declare const account_status_route_shape: {
|
|
|
247
301
|
email_verified: boolean;
|
|
248
302
|
};
|
|
249
303
|
actor: {
|
|
250
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
251
304
|
name: string;
|
|
305
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
252
306
|
} | null;
|
|
253
307
|
role_grants: {
|
|
254
308
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -268,8 +322,8 @@ export declare const account_status_route_shape: {
|
|
|
268
322
|
email_verified: boolean;
|
|
269
323
|
};
|
|
270
324
|
actor: {
|
|
271
|
-
id: string;
|
|
272
325
|
name: string;
|
|
326
|
+
id: string;
|
|
273
327
|
} | null;
|
|
274
328
|
role_grants: {
|
|
275
329
|
id: string;
|
|
@@ -306,17 +360,17 @@ export declare const account_status_route_shape: {
|
|
|
306
360
|
created_at: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
307
361
|
}>;
|
|
308
362
|
actor: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
309
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
310
363
|
name: string;
|
|
364
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
311
365
|
} | null, {
|
|
312
|
-
id: string;
|
|
313
366
|
name: string;
|
|
367
|
+
id: string;
|
|
314
368
|
} | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
315
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
316
369
|
name: string;
|
|
370
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
317
371
|
}, {
|
|
318
|
-
id: string;
|
|
319
372
|
name: string;
|
|
373
|
+
id: string;
|
|
320
374
|
}, "object", {
|
|
321
375
|
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">)[]> & {
|
|
322
376
|
readonly '~types'?: {
|
|
@@ -384,10 +438,16 @@ export declare const account_status_route_shape: {
|
|
|
384
438
|
}>>;
|
|
385
439
|
}>;
|
|
386
440
|
errors: {
|
|
387
|
-
401:
|
|
388
|
-
error:
|
|
389
|
-
bootstrap_available
|
|
390
|
-
},
|
|
441
|
+
401: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
442
|
+
error: "authentication_required";
|
|
443
|
+
bootstrap_available?: boolean | undefined;
|
|
444
|
+
} & Record<string, unknown>, {
|
|
445
|
+
error: "authentication_required";
|
|
446
|
+
bootstrap_available?: boolean | undefined;
|
|
447
|
+
} & Record<string, unknown>, "loose_object", {
|
|
448
|
+
error: import("@fuzdev/fuz_schema/schema.ts").Schema<"authentication_required", "authentication_required", "literal", "authentication_required">;
|
|
449
|
+
bootstrap_available: import("@fuzdev/fuz_schema/schema.ts").Schema<boolean | undefined, boolean | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<boolean, boolean, "boolean", undefined>>>;
|
|
450
|
+
}>;
|
|
391
451
|
};
|
|
392
452
|
};
|
|
393
453
|
/** Option inputs that shape the account route metadata (not its handlers). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account_route_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/account_route_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"account_route_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/account_route_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAaN,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAKtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQvD,mGAAmG;AACnG,eAAO,MAAM,kBAAkB,4EAAgB,CAAC;AAChD,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAElE,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAaD,CAAC;AAEvC,8EAA8E;AAC9E,MAAM,WAAW,wBAAwB;IACxC,8FAA8F;IAC9F,0BAA0B,EAAE,OAAO,CAAC;CACpC;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,GACvC,SAAS,wBAAwB,KAC/B,CACF,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,EAC1B,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,EAC1B,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,EAC1B,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAiE1B,CAAC"}
|
|
@@ -11,51 +11,69 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
15
|
-
import { array, nullable, object } from '@fuzdev/fuz_schema/schema.ts';
|
|
14
|
+
import { array, boolean, integer, literal, loose_object, min_value, nullable, number, object, one_of, optional, pipe } from '@fuzdev/fuz_schema/schema.ts';
|
|
16
15
|
import { ActorSummaryJson, RoleGrantSummaryJson, SessionAccountJson } from './account_schema.js';
|
|
17
|
-
import { UsernameProvided } from '../
|
|
16
|
+
import { UsernameCanonical, UsernameProvided } from '../primitive_schemas_fuz.js';
|
|
18
17
|
import { Password, PasswordProvided } from './password.js';
|
|
19
18
|
import { ERROR_AUTHENTICATION_REQUIRED, ERROR_INVALID_CREDENTIALS, ERROR_INVALID_JSON_BODY, ERROR_INVALID_REQUEST_BODY } from '../http/error_schemas.js';
|
|
20
|
-
/** Input for `GET /api/account/status`. No parameters — caller is the subject. */
|
|
21
|
-
export const AccountStatusInput =
|
|
19
|
+
/** Input for `GET /api/account/status`, `literal(null)`. No parameters — caller is the subject. */
|
|
20
|
+
export const AccountStatusInput = literal(null);
|
|
22
21
|
/** Output for `GET /api/account/status`, a `@fuzdev/fuz_schema` schema. */
|
|
23
22
|
export const AccountStatusOutput = object({
|
|
24
23
|
account: SessionAccountJson,
|
|
25
24
|
actor: nullable(ActorSummaryJson),
|
|
26
25
|
role_grants: array(RoleGrantSummaryJson)
|
|
27
26
|
});
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Error body for `GET /api/account/status` on the unauthenticated path, a
|
|
29
|
+
* `@fuzdev/fuz_schema` schema.
|
|
30
|
+
*/
|
|
31
|
+
export const AccountStatusUnauthenticatedError = loose_object({
|
|
32
|
+
error: literal(ERROR_AUTHENTICATION_REQUIRED),
|
|
33
|
+
bootstrap_available: optional(boolean)
|
|
32
34
|
});
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Input for `POST /login`, a `@fuzdev/fuz_schema` schema. Accepts a username
|
|
37
|
+
* or email in the `username` field.
|
|
38
|
+
*/
|
|
39
|
+
export const LoginInput = object({
|
|
35
40
|
username: UsernameProvided,
|
|
36
41
|
password: PasswordProvided
|
|
37
42
|
});
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Output for `POST /login`, a `@fuzdev/fuz_schema` schema. Session cookie is
|
|
45
|
+
* the operative side effect.
|
|
46
|
+
*/
|
|
47
|
+
export const LoginOutput = object({
|
|
48
|
+
ok: literal(true)
|
|
41
49
|
});
|
|
42
|
-
/** Input for `POST /logout`. Session identity flows through the cookie. */
|
|
43
|
-
export const LogoutInput =
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
/** Input for `POST /logout`, `literal(null)`. Session identity flows through the cookie. */
|
|
51
|
+
export const LogoutInput = literal(null);
|
|
52
|
+
/**
|
|
53
|
+
* Output for `POST /logout`, a `@fuzdev/fuz_schema` schema. Includes the
|
|
54
|
+
* revoked account's username for UI redraw, as the account row holds it.
|
|
55
|
+
*/
|
|
56
|
+
export const LogoutOutput = object({
|
|
57
|
+
ok: literal(true),
|
|
58
|
+
username: UsernameCanonical
|
|
48
59
|
});
|
|
49
|
-
/**
|
|
50
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Input for `POST /password`, a `@fuzdev/fuz_schema` schema.
|
|
62
|
+
* `current_password` is minimally validated; `new_password` enforces the full
|
|
63
|
+
* policy.
|
|
64
|
+
*/
|
|
65
|
+
export const PasswordChangeInput = object({
|
|
51
66
|
current_password: PasswordProvided,
|
|
52
67
|
new_password: Password
|
|
53
68
|
});
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Output for `POST /password`, a `@fuzdev/fuz_schema` schema. Counts are
|
|
71
|
+
* returned so the UI can summarize the revoke-all cascade.
|
|
72
|
+
*/
|
|
73
|
+
export const PasswordChangeOutput = object({
|
|
74
|
+
ok: literal(true),
|
|
75
|
+
sessions_revoked: pipe(number, integer, min_value(0)),
|
|
76
|
+
tokens_revoked: pipe(number, integer, min_value(0))
|
|
59
77
|
});
|
|
60
78
|
/**
|
|
61
79
|
* Default maximum sessions per account.
|
|
@@ -119,8 +137,8 @@ export const create_account_route_shapes = (options) => [
|
|
|
119
137
|
required_scope: 'surface:account_verify'
|
|
120
138
|
},
|
|
121
139
|
description: 'Session-validity probe for nginx auth_request (empty body; 200, 401, or 403 for a narrowed token)',
|
|
122
|
-
input:
|
|
123
|
-
output:
|
|
140
|
+
input: literal(null),
|
|
141
|
+
output: literal(null)
|
|
124
142
|
},
|
|
125
143
|
{
|
|
126
144
|
method: 'POST',
|
|
@@ -136,10 +154,8 @@ export const create_account_route_shapes = (options) => [
|
|
|
136
154
|
// database connection.
|
|
137
155
|
transaction: false,
|
|
138
156
|
errors: {
|
|
139
|
-
400:
|
|
140
|
-
|
|
141
|
-
}),
|
|
142
|
-
401: z.looseObject({ error: z.literal(ERROR_INVALID_CREDENTIALS) })
|
|
157
|
+
400: loose_object({ error: one_of([ERROR_INVALID_JSON_BODY, ERROR_INVALID_REQUEST_BODY]) }),
|
|
158
|
+
401: loose_object({ error: literal(ERROR_INVALID_CREDENTIALS) })
|
|
143
159
|
}
|
|
144
160
|
},
|
|
145
161
|
{
|
|
@@ -168,9 +184,7 @@ export const create_account_route_shapes = (options) => [
|
|
|
168
184
|
// Argon2 verify and hash, hold no database connection.
|
|
169
185
|
transaction: false,
|
|
170
186
|
errors: {
|
|
171
|
-
400:
|
|
172
|
-
error: z.enum([ERROR_INVALID_JSON_BODY, ERROR_INVALID_REQUEST_BODY])
|
|
173
|
-
})
|
|
187
|
+
400: loose_object({ error: one_of([ERROR_INVALID_JSON_BODY, ERROR_INVALID_REQUEST_BODY]) })
|
|
174
188
|
}
|
|
175
189
|
}
|
|
176
190
|
];
|
|
@@ -227,7 +227,7 @@ export const create_account_route_specs = (deps, options) => {
|
|
|
227
227
|
// parse time — the validated value lands canonical in
|
|
228
228
|
// `c.var.validated_input`, so the per-account rate-limit key,
|
|
229
229
|
// DB lookup, and audit metadata see one form. See
|
|
230
|
-
// `
|
|
230
|
+
// `primitive_schemas_fuz.ts` for the schema-layer canonicalization.
|
|
231
231
|
const { username, password: pw } = get_route_input(c);
|
|
232
232
|
// DB lookup first so we can key the per-account rate limit by a canonical value
|
|
233
233
|
// (account.id) rather than the submitted identifier. Otherwise an attacker could
|