@fuzdev/fuz_app 0.162.0 → 0.164.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/README.md +2 -1
- package/dist/actions/action_event_data.d.ts +1 -1
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +4 -0
- package/dist/actions/action_spec.d.ts +3 -3
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/auth/CLAUDE.md +39 -36
- 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 +98 -62
- package/dist/auth/account_route_schema.d.ts.map +1 -1
- package/dist/auth/account_route_schema.js +45 -45
- 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 +76 -76
- 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_route_schema.d.ts +1 -1
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_route_schema.js +4 -5
- package/dist/auth/audit_log_schema.d.ts +46 -66
- 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 +146 -52
- package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
- package/dist/auth/bootstrap_route_schema.js +33 -19
- 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/daemon_token.d.ts +4 -4
- package/dist/auth/daemon_token.d.ts.map +1 -1
- package/dist/auth/daemon_token.js +3 -3
- package/dist/auth/daemon_token_middleware.d.ts +1 -1
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +5 -5
- 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/middleware.js +4 -4
- 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.d.ts +2 -2
- 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 +17 -19
- 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/db/CLAUDE.md +2 -1
- package/dist/db/file_fact_url.d.ts +11 -6
- package/dist/db/file_fact_url.d.ts.map +1 -1
- package/dist/db/file_fact_url.js +5 -5
- package/dist/db/schema_ready.d.ts +0 -5
- package/dist/db/schema_ready.d.ts.map +1 -1
- package/dist/db/schema_ready.js +0 -5
- package/dist/http/CLAUDE.md +104 -71
- package/dist/http/auth_shape.d.ts +48 -29
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +12 -85
- package/dist/http/body_limit.d.ts +12 -0
- package/dist/http/body_limit.d.ts.map +1 -1
- package/dist/http/body_limit.js +15 -0
- package/dist/http/body_limit_schema.d.ts +20 -0
- package/dist/http/body_limit_schema.d.ts.map +1 -0
- package/dist/http/body_limit_schema.js +20 -0
- package/dist/http/common_routes.d.ts +1 -1
- package/dist/http/common_routes.d.ts.map +1 -1
- package/dist/http/common_routes.js +11 -14
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +59 -69
- package/dist/http/dev_route_error_check.d.ts +70 -0
- package/dist/http/dev_route_error_check.d.ts.map +1 -0
- package/dist/http/dev_route_error_check.js +119 -0
- package/dist/http/error_schemas.d.ts +365 -189
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +256 -149
- package/dist/http/health_schema.d.ts +10 -6
- package/dist/http/health_schema.d.ts.map +1 -1
- package/dist/http/health_schema.js +3 -3
- package/dist/http/middleware_spec.d.ts +8 -3
- package/dist/http/middleware_spec.d.ts.map +1 -1
- package/dist/http/origin.d.ts +12 -43
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +10 -6
- package/dist/http/route_error_check.d.ts +158 -0
- package/dist/http/route_error_check.d.ts.map +1 -0
- package/dist/http/route_error_check.js +247 -0
- package/dist/http/route_errors.d.ts +80 -0
- package/dist/http/route_errors.d.ts.map +1 -0
- package/dist/http/route_errors.js +83 -0
- package/dist/http/route_spec.d.ts +33 -17
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +48 -62
- package/dist/http/schema_helpers.d.ts +0 -33
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +0 -45
- package/dist/http/surface.d.ts +19 -12
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +25 -38
- package/dist/http/surface_query.d.ts +11 -2
- package/dist/http/surface_query.d.ts.map +1 -1
- package/dist/http/surface_query.js +7 -1
- 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 +39 -5
- package/dist/primitive_schemas_fuz.d.ts.map +1 -1
- package/dist/primitive_schemas_fuz.js +36 -7
- package/dist/rate_limiter.d.ts +13 -0
- package/dist/rate_limiter.d.ts.map +1 -1
- package/dist/rate_limiter.js +20 -2
- package/dist/schema_issues.d.ts +29 -11
- package/dist/schema_issues.d.ts.map +1 -1
- package/dist/schema_issues.js +11 -10
- package/dist/schema_meta.d.ts +8 -1
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +2 -1
- package/dist/server/app_server.d.ts +3 -1
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +24 -10
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +8 -31
- package/dist/server/surface_route.d.ts.map +1 -1
- package/dist/server/surface_route.js +5 -6
- package/dist/server/x_accel.d.ts +12 -7
- package/dist/server/x_accel.d.ts.map +1 -1
- package/dist/server/x_accel.js +7 -9
- package/dist/testing/CLAUDE.md +55 -44
- 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 +2 -2
- package/dist/testing/adversarial_404.d.ts +4 -18
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_404.js +19 -51
- package/dist/testing/adversarial_headers.d.ts +3 -4
- package/dist/testing/adversarial_headers.d.ts.map +1 -1
- package/dist/testing/adversarial_headers.js +8 -6
- package/dist/testing/adversarial_input.d.ts.map +1 -1
- package/dist/testing/adversarial_input.js +18 -17
- package/dist/testing/assertions.d.ts +33 -11
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +52 -12
- package/dist/testing/attack_surface.d.ts +5 -35
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +29 -91
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +2 -1
- package/dist/testing/cross_backend/action_manifest.d.ts +126 -56
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +11 -11
- package/dist/testing/cross_backend/action_manifest_parity.d.ts +1 -1
- package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.js +2 -1
- package/dist/testing/cross_backend/conformance_table.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/fact_serving.js +3 -3
- 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/origin_conformance.d.ts +278 -102
- package/dist/testing/cross_backend/origin_conformance.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin_conformance.js +21 -21
- 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/rust_spine_consumer_surface.js +7 -1
- package/dist/testing/cross_backend/setup.d.ts +14 -1
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +68 -48
- 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/testing_origin_check.d.ts +147 -71
- package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_origin_check.js +16 -13
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +70 -27
- package/dist/testing/cross_backend/testing_reset_actions.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/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +5 -4
- package/dist/testing/error_coverage.d.ts +24 -34
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +46 -89
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +6 -14
- package/dist/testing/integration_helpers.d.ts +37 -9
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +86 -40
- package/dist/testing/middleware.d.ts +3 -5
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +5 -4
- package/dist/testing/rate_limiting.d.ts +1 -1
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +5 -4
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +5 -3
- package/dist/testing/schema_generators.d.ts +10 -3
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +23 -11
- package/dist/testing/stubs.d.ts +10 -1
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +15 -5
- package/dist/testing/surface_invariants.d.ts +36 -115
- package/dist/testing/surface_invariants.d.ts.map +1 -1
- package/dist/testing/surface_invariants.js +106 -269
- 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/CLAUDE.md +4 -2
- package/dist/ui/SignupForm.svelte +4 -2
- package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
- package/dist/ui/auth_state.svelte.d.ts.map +1 -1
- package/dist/ui/auth_state.svelte.js +2 -8
- package/dist/ui/backend_probe.svelte.js +3 -3
- package/dist/ui/table_state.svelte.d.ts.map +1 -1
- package/dist/ui/table_state.svelte.js +1 -8
- package/dist/ui/ui_fetch.d.ts +12 -2
- package/dist/ui/ui_fetch.d.ts.map +1 -1
- package/dist/ui/ui_fetch.js +22 -4
- 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,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK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{ 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,85 @@ 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
|
-
username:
|
|
176
|
-
password:
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
export
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
ok:
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
},
|
|
205
|
-
|
|
166
|
+
/**
|
|
167
|
+
* Input for `POST /login`, a `@fuzdev/fuz_schema` schema. Accepts a username
|
|
168
|
+
* or email in the `username` field.
|
|
169
|
+
*/
|
|
170
|
+
export declare const LoginInput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
171
|
+
username: string;
|
|
172
|
+
password: string;
|
|
173
|
+
}, {
|
|
174
|
+
username: string;
|
|
175
|
+
password: string;
|
|
176
|
+
}, "object", {
|
|
177
|
+
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>>>;
|
|
178
|
+
password: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
179
|
+
}>;
|
|
180
|
+
export type LoginInput = Infer<typeof LoginInput>;
|
|
181
|
+
/**
|
|
182
|
+
* Output for `POST /login`, a `@fuzdev/fuz_schema` schema. Session cookie is
|
|
183
|
+
* the operative side effect.
|
|
184
|
+
*/
|
|
185
|
+
export declare const LoginOutput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
186
|
+
ok: true;
|
|
187
|
+
}, {
|
|
188
|
+
ok: true;
|
|
189
|
+
}, "object", {
|
|
190
|
+
ok: import("@fuzdev/fuz_schema/schema.ts").Schema<true, true, "literal", true>;
|
|
191
|
+
}>;
|
|
192
|
+
export type LoginOutput = Infer<typeof LoginOutput>;
|
|
193
|
+
/** Input for `POST /logout`, `literal(null)`. Session identity flows through the cookie. */
|
|
194
|
+
export declare const LogoutInput: import("@fuzdev/fuz_schema/schema.ts").Schema<null, null, "literal", null>;
|
|
195
|
+
export type LogoutInput = Infer<typeof LogoutInput>;
|
|
196
|
+
/**
|
|
197
|
+
* Output for `POST /logout`, a `@fuzdev/fuz_schema` schema. Includes the
|
|
198
|
+
* revoked account's username for UI redraw, as the account row holds it.
|
|
199
|
+
*/
|
|
200
|
+
export declare const LogoutOutput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
201
|
+
username: string;
|
|
202
|
+
ok: true;
|
|
203
|
+
}, {
|
|
204
|
+
username: string;
|
|
205
|
+
ok: true;
|
|
206
|
+
}, "object", {
|
|
207
|
+
ok: import("@fuzdev/fuz_schema/schema.ts").Schema<true, true, "literal", true>;
|
|
208
|
+
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>>>;
|
|
209
|
+
}>;
|
|
210
|
+
export type LogoutOutput = Infer<typeof LogoutOutput>;
|
|
211
|
+
/**
|
|
212
|
+
* Input for `POST /password`, a `@fuzdev/fuz_schema` schema.
|
|
213
|
+
* `current_password` is minimally validated; `new_password` enforces the full
|
|
214
|
+
* policy.
|
|
215
|
+
*/
|
|
216
|
+
export declare const PasswordChangeInput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
217
|
+
current_password: string;
|
|
218
|
+
new_password: string;
|
|
219
|
+
}, {
|
|
220
|
+
current_password: string;
|
|
221
|
+
new_password: string;
|
|
222
|
+
}, "object", {
|
|
223
|
+
current_password: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
224
|
+
new_password: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
225
|
+
}>;
|
|
226
|
+
export type PasswordChangeInput = Infer<typeof PasswordChangeInput>;
|
|
227
|
+
/**
|
|
228
|
+
* Output for `POST /password`, a `@fuzdev/fuz_schema` schema. Counts are
|
|
229
|
+
* returned so the UI can summarize the revoke-all cascade.
|
|
230
|
+
*/
|
|
231
|
+
export declare const PasswordChangeOutput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
232
|
+
sessions_revoked: number;
|
|
233
|
+
tokens_revoked: number;
|
|
234
|
+
ok: true;
|
|
235
|
+
}, {
|
|
236
|
+
sessions_revoked: number;
|
|
237
|
+
tokens_revoked: number;
|
|
238
|
+
ok: true;
|
|
239
|
+
}, "object", {
|
|
240
|
+
ok: import("@fuzdev/fuz_schema/schema.ts").Schema<true, true, "literal", true>;
|
|
241
|
+
sessions_revoked: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<number, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>>;
|
|
242
|
+
tokens_revoked: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<number, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>>;
|
|
243
|
+
}>;
|
|
244
|
+
export type PasswordChangeOutput = Infer<typeof PasswordChangeOutput>;
|
|
206
245
|
/**
|
|
207
246
|
* Default maximum sessions per account.
|
|
208
247
|
*
|
|
@@ -237,7 +276,7 @@ export declare const account_status_route_shape: {
|
|
|
237
276
|
};
|
|
238
277
|
reads_credential: true;
|
|
239
278
|
description: string;
|
|
240
|
-
input:
|
|
279
|
+
input: import("@fuzdev/fuz_schema/schema.ts").Schema<null, null, "literal", null>;
|
|
241
280
|
output: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
242
281
|
account: {
|
|
243
282
|
email: string | null;
|
|
@@ -247,8 +286,8 @@ export declare const account_status_route_shape: {
|
|
|
247
286
|
email_verified: boolean;
|
|
248
287
|
};
|
|
249
288
|
actor: {
|
|
250
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
251
289
|
name: string;
|
|
290
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
252
291
|
} | null;
|
|
253
292
|
role_grants: {
|
|
254
293
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -268,8 +307,8 @@ export declare const account_status_route_shape: {
|
|
|
268
307
|
email_verified: boolean;
|
|
269
308
|
};
|
|
270
309
|
actor: {
|
|
271
|
-
id: string;
|
|
272
310
|
name: string;
|
|
311
|
+
id: string;
|
|
273
312
|
} | null;
|
|
274
313
|
role_grants: {
|
|
275
314
|
id: string;
|
|
@@ -306,17 +345,17 @@ export declare const account_status_route_shape: {
|
|
|
306
345
|
created_at: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
307
346
|
}>;
|
|
308
347
|
actor: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
309
|
-
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
310
348
|
name: string;
|
|
349
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
311
350
|
} | null, {
|
|
312
|
-
id: string;
|
|
313
351
|
name: string;
|
|
352
|
+
id: string;
|
|
314
353
|
} | 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
354
|
name: string;
|
|
355
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
317
356
|
}, {
|
|
318
|
-
id: string;
|
|
319
357
|
name: string;
|
|
358
|
+
id: string;
|
|
320
359
|
}, "object", {
|
|
321
360
|
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
361
|
readonly '~types'?: {
|
|
@@ -383,12 +422,9 @@ export declare const account_status_route_shape: {
|
|
|
383
422
|
}>>;
|
|
384
423
|
}>>;
|
|
385
424
|
}>;
|
|
386
|
-
errors: {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
bootstrap_available: z.ZodOptional<z.ZodBoolean>;
|
|
390
|
-
}, z.core.$loose>;
|
|
391
|
-
};
|
|
425
|
+
errors: import("../http/error_schemas.js").RestErrorDef<401, "authentication_required", {
|
|
426
|
+
readonly 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>>>;
|
|
427
|
+
}>[];
|
|
392
428
|
};
|
|
393
429
|
/** Option inputs that shape the account route metadata (not its handlers). */
|
|
394
430
|
export interface AccountRouteShapeOptions {
|
|
@@ -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,EASN,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAKtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAMvD,mGAAmG;AACnG,eAAO,MAAM,kBAAkB,4EAAgB,CAAC;AAChD,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,kBA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AAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWD,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,CA6D1B,CAAC"}
|
|
@@ -11,51 +11,61 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
15
|
-
import { array, nullable, object } from '@fuzdev/fuz_schema/schema.ts';
|
|
14
|
+
import { array, integer, literal, min_value, nullable, number, object, 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
|
-
import {
|
|
20
|
-
/** Input for `GET /api/account/status`. No parameters — caller is the subject. */
|
|
21
|
-
export const AccountStatusInput =
|
|
18
|
+
import { REST_AUTHENTICATION_REQUIRED_BOOTSTRAP, REST_INVALID_CREDENTIALS } from '../http/error_schemas.js';
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
/** Input for `POST /login`. Accepts a username or email in the `username` field. */
|
|
34
|
-
export const LoginInput = z.strictObject({
|
|
27
|
+
/**
|
|
28
|
+
* Input for `POST /login`, a `@fuzdev/fuz_schema` schema. Accepts a username
|
|
29
|
+
* or email in the `username` field.
|
|
30
|
+
*/
|
|
31
|
+
export const LoginInput = object({
|
|
35
32
|
username: UsernameProvided,
|
|
36
33
|
password: PasswordProvided
|
|
37
34
|
});
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Output for `POST /login`, a `@fuzdev/fuz_schema` schema. Session cookie is
|
|
37
|
+
* the operative side effect.
|
|
38
|
+
*/
|
|
39
|
+
export const LoginOutput = object({
|
|
40
|
+
ok: literal(true)
|
|
41
41
|
});
|
|
42
|
-
/** Input for `POST /logout`. Session identity flows through the cookie. */
|
|
43
|
-
export const LogoutInput =
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
/** Input for `POST /logout`, `literal(null)`. Session identity flows through the cookie. */
|
|
43
|
+
export const LogoutInput = literal(null);
|
|
44
|
+
/**
|
|
45
|
+
* Output for `POST /logout`, a `@fuzdev/fuz_schema` schema. Includes the
|
|
46
|
+
* revoked account's username for UI redraw, as the account row holds it.
|
|
47
|
+
*/
|
|
48
|
+
export const LogoutOutput = object({
|
|
49
|
+
ok: literal(true),
|
|
50
|
+
username: UsernameCanonical
|
|
48
51
|
});
|
|
49
|
-
/**
|
|
50
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Input for `POST /password`, a `@fuzdev/fuz_schema` schema.
|
|
54
|
+
* `current_password` is minimally validated; `new_password` enforces the full
|
|
55
|
+
* policy.
|
|
56
|
+
*/
|
|
57
|
+
export const PasswordChangeInput = object({
|
|
51
58
|
current_password: PasswordProvided,
|
|
52
59
|
new_password: Password
|
|
53
60
|
});
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Output for `POST /password`, a `@fuzdev/fuz_schema` schema. Counts are
|
|
63
|
+
* returned so the UI can summarize the revoke-all cascade.
|
|
64
|
+
*/
|
|
65
|
+
export const PasswordChangeOutput = object({
|
|
66
|
+
ok: literal(true),
|
|
67
|
+
sessions_revoked: pipe(number, integer, min_value(0)),
|
|
68
|
+
tokens_revoked: pipe(number, integer, min_value(0))
|
|
59
69
|
});
|
|
60
70
|
/**
|
|
61
71
|
* Default maximum sessions per account.
|
|
@@ -92,9 +102,7 @@ export const account_status_route_shape = {
|
|
|
92
102
|
description: 'Current account info (unauthenticated: 401 with bootstrap status)',
|
|
93
103
|
input: AccountStatusInput,
|
|
94
104
|
output: AccountStatusOutput,
|
|
95
|
-
errors:
|
|
96
|
-
401: AccountStatusUnauthenticatedError
|
|
97
|
-
}
|
|
105
|
+
errors: [REST_AUTHENTICATION_REQUIRED_BOOTSTRAP]
|
|
98
106
|
};
|
|
99
107
|
/**
|
|
100
108
|
* The four account route shapes (`/verify`, `/login`, `/logout`, `/password`)
|
|
@@ -119,8 +127,8 @@ export const create_account_route_shapes = (options) => [
|
|
|
119
127
|
required_scope: 'surface:account_verify'
|
|
120
128
|
},
|
|
121
129
|
description: 'Session-validity probe for nginx auth_request (empty body; 200, 401, or 403 for a narrowed token)',
|
|
122
|
-
input:
|
|
123
|
-
output:
|
|
130
|
+
input: literal(null),
|
|
131
|
+
output: literal(null)
|
|
124
132
|
},
|
|
125
133
|
{
|
|
126
134
|
method: 'POST',
|
|
@@ -135,12 +143,7 @@ export const create_account_route_shapes = (options) => [
|
|
|
135
143
|
// so a reservation waiting for a slot, and the Argon2 verify, hold no
|
|
136
144
|
// database connection.
|
|
137
145
|
transaction: false,
|
|
138
|
-
errors:
|
|
139
|
-
400: z.looseObject({
|
|
140
|
-
error: z.enum([ERROR_INVALID_JSON_BODY, ERROR_INVALID_REQUEST_BODY])
|
|
141
|
-
}),
|
|
142
|
-
401: z.looseObject({ error: z.literal(ERROR_INVALID_CREDENTIALS) })
|
|
143
|
-
}
|
|
146
|
+
errors: [REST_INVALID_CREDENTIALS]
|
|
144
147
|
},
|
|
145
148
|
{
|
|
146
149
|
method: 'POST',
|
|
@@ -167,10 +170,7 @@ export const create_account_route_shapes = (options) => [
|
|
|
167
170
|
// and the revocations, so a reservation waiting for a slot, and the
|
|
168
171
|
// Argon2 verify and hash, hold no database connection.
|
|
169
172
|
transaction: false,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
error: z.enum([ERROR_INVALID_JSON_BODY, ERROR_INVALID_REQUEST_BODY])
|
|
173
|
-
})
|
|
174
|
-
}
|
|
173
|
+
// a wrong current password answers `invalid_credentials`, as login does
|
|
174
|
+
errors: [REST_INVALID_CREDENTIALS]
|
|
175
175
|
}
|
|
176
176
|
];
|
|
@@ -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
|