@fuzdev/fuz_app 0.148.0 → 0.149.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/CLAUDE.md +2 -2
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +14 -1
- package/dist/actions/perform_action.d.ts +17 -1
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +22 -2
- package/dist/auth/CLAUDE.md +3 -2
- package/dist/auth/account_action_specs.d.ts +12 -0
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_action_specs.js +16 -2
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +7 -4
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +29 -8
- package/dist/auth/audit_emitter.d.ts +14 -0
- package/dist/auth/audit_emitter.d.ts.map +1 -1
- package/dist/auth/audit_emitter.js +5 -1
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +5 -3
- package/dist/http/CLAUDE.md +14 -2
- package/dist/http/error_schemas.d.ts +8 -0
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +12 -0
- package/dist/http/jsonrpc_errors.d.ts +40 -15
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +90 -35
- package/dist/schema_meta.d.ts +60 -0
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +64 -0
- package/dist/testing/CLAUDE.md +162 -61
- package/dist/testing/adversarial_input_cases.d.ts +67 -7
- package/dist/testing/adversarial_input_cases.d.ts.map +1 -1
- package/dist/testing/adversarial_input_cases.js +210 -165
- package/dist/testing/audit_drift_guard.d.ts +3 -2
- package/dist/testing/audit_drift_guard.d.ts.map +1 -1
- package/dist/testing/audit_drift_guard.js +5 -3
- package/dist/testing/cross_backend/audit_cross_helpers.d.ts +6 -0
- package/dist/testing/cross_backend/audit_cross_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/audit_cross_helpers.js +11 -0
- package/dist/testing/cross_backend/capabilities.d.ts +27 -4
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +10 -6
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.js +117 -2
- package/dist/testing/cross_backend/cross_rpc.d.ts +3 -1
- package/dist/testing/cross_backend/cross_rpc.d.ts.map +1 -1
- package/dist/testing/cross_backend/cross_rpc.js +2 -2
- package/dist/testing/cross_backend/default_backend_configs.d.ts +9 -7
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +3 -3
- package/dist/testing/cross_backend/rpc_adversarial.d.ts +9 -0
- package/dist/testing/cross_backend/rpc_adversarial.d.ts.map +1 -1
- package/dist/testing/cross_backend/rpc_adversarial.js +16 -6
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.js +6 -3
- package/dist/testing/cross_backend/setup.d.ts +2 -2
- package/dist/testing/cross_backend/spine_suites.d.ts +85 -5
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +291 -20
- package/dist/testing/cross_backend/spine_surface_constants.d.ts +15 -0
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.js +24 -0
- package/dist/testing/cross_backend/testing_backdoor.d.ts +27 -4
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +136 -41
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +30 -15
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +52 -35
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +6 -3
- package/dist/testing/rpc_attack_surface.d.ts +10 -0
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.js +15 -3
- package/dist/testing/rpc_envelope_cases.d.ts +5 -2
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.js +4 -1
- package/dist/testing/rpc_round_trip.js +3 -3
- package/dist/testing/schema_generators.d.ts +99 -2
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +244 -76
- package/dist/testing/stubs.d.ts +4 -3
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +6 -4
- package/dist/zod.d.ts +9 -0
- package/dist/zod.d.ts.map +1 -1
- package/dist/zod.js +20 -0
- package/package.json +1 -1
package/dist/actions/CLAUDE.md
CHANGED
|
@@ -308,7 +308,7 @@ Pipeline (401 → authz → 403 → 429 → 400 → handler):
|
|
|
308
308
|
2. Authorization phase — `apply_authorization_phase` against `account_id` + `read_acting(auth, raw_params)`, which takes the selector off the raw params (malformed reads as omitted) since validation runs later. Test escape hatch via `preset.request_context`
|
|
309
309
|
3. Post-authorization auth (403) — credential-type gate, then token scope, then role
|
|
310
310
|
4. Rate limit (429) — throttle-requests semantics, ahead of validation so malformed params charge the budget and a throttled caller pays no schema work
|
|
311
|
-
5. Validate params (400) — `spec.input.safeParse` with `z.void()` / `?? {}` rules; a `z.void()` input reads absent, `null` (GET `?params=null`), and `{}` alike as the no-arg call (`to_input_params` in `http/schema_helpers.ts`, via `to_void_params`, the twin of the Rust `require_void_params`; the peer receive path in `ActionDispatcher` runs the same normalizer) and refuses any other shape
|
|
311
|
+
5. Validate params (400) — `spec.input.safeParse` with `z.void()` / `?? {}` rules; a `z.void()` input reads absent, `null` (GET `?params=null`), and `{}` alike as the no-arg call (`to_input_params` in `http/schema_helpers.ts`, via `to_void_params`, the twin of the Rust `require_void_params`; the peer receive path in `ActionDispatcher` runs the same normalizer) and refuses any other shape. A refusal is `to_invalid_params_error`: the generic `invalid params`, `data.reason` when the first issue's field declares an `invalid_reason` in its `.meta()` and no issue sits on the input itself, such as an unknown key (`resolve_issues_invalid_reason`, `schema_meta.ts` — see ../../../docs/architecture.md §Error Schema System), and the Zod issues DEV-only
|
|
312
312
|
6. Dispatch + DEV output validation + error normalization — `spec.side_effects` picks transaction vs pool. `ThrownJsonrpcError` preserves code + data; generic throws become `internal_error`
|
|
313
313
|
|
|
314
314
|
`PerformActionInput` carries `account_id`, `credential_type`, `client_ip`,
|
|
@@ -1051,7 +1051,7 @@ high-level shapes that span modules:
|
|
|
1051
1051
|
- **39-variant discriminated union** — `ActionEventDataUnion<TMethod, TInput, TOutput>` across `kind` + `phase` + `step` (28 for `request_response`, 6 for `remote_notification`, 5 for `local_call`). Narrows `input` / `output` / `error` / `request` / `response` / `notification` / `progress` at each lifecycle point.
|
|
1052
1052
|
- **Step transitions** — `initial → parsed | failed`, `parsed → handling | failed`, `handling → handled | failed`, `handled`/`failed` terminal. `validate_step_transition(from, to)` throws on illegal moves.
|
|
1053
1053
|
- **Phase transitions** — chained: `send_request → receive_response`, `receive_request → send_response`; everything else terminal. `validate_phase_for_kind` + `validate_phase_transition` enforce.
|
|
1054
|
-
- **`ActionEvent.parse()`** — `initial → parsed` via `spec.input.safeParse`. Input validation failures **fail immediately** without routing through an error phase (client-side programming errors, not runtime conditions with handlers). Handler errors DO route through `send_error` / `receive_error`. On `receive_response` with error response, transitions to `receive_error` instead of failing; a success response's `result` is validated against `spec.output` (always, not DEV-only — it's inbound data; undeclared keys are dropped rather than refused, so an older client survives an added response field) and `output` becomes the parsed value, or the event moves to `receive_error` with an `internal_error` carrying `data: {reason: ERROR_RESPONSE_OUTPUT_INVALID, validation_errors}` — a remote contract break, deliberately distinct from the `invalid_params` / `validation_error` of bad caller input.
|
|
1054
|
+
- **`ActionEvent.parse()`** — `initial → parsed` via `spec.input.safeParse`. Input validation failures **fail immediately** without routing through an error phase (client-side programming errors, not runtime conditions with handlers); their `invalid_params` `data` is `{validation_errors, reason?}`, `reason` the declared `invalid_reason` the server would answer. Handler errors DO route through `send_error` / `receive_error`. On `receive_response` with error response, transitions to `receive_error` instead of failing; a success response's `result` is validated against `spec.output` (always, not DEV-only — it's inbound data; undeclared keys are dropped rather than refused, so an older client survives an added response field) and `output` becomes the parsed value, or the event moves to `receive_error` with an `internal_error` carrying `data: {reason: ERROR_RESPONSE_OUTPUT_INVALID, validation_errors}` — a remote contract break, deliberately distinct from the `invalid_params` / `validation_error` of bad caller input.
|
|
1055
1055
|
- **Handler throws** — `ThrownJsonrpcError` keeps code/message/data; any other throw becomes `internal_error` carrying the thrown message. When the error answers a remote caller (`receive_request` / `send_response`), the raw message goes through `dev_only` like the server dispatch core.
|
|
1056
1056
|
- **Protocol message creation is automatic** — transitioning `parsed → handling` on `send_request` materializes the outgoing `JsonrpcRequest` with a fresh `create_uuid()` id; on `send` (notification) it materializes the `JsonrpcNotification`.
|
|
1057
1057
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action_event.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/action_event.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EAAE,gBAAgB,EAAc,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"action_event.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/action_event.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EAAE,gBAAgB,EAAc,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAiBtF,OAAO,KAAK,EACX,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EAGnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAA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GG,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAsCnC;;;;;;;OAOG;IACH,WAAW,IAAI,IAAI;IA8BnB;;;;;;;;;;OAUG;IACH,UAAU,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAezC,WAAW,IAAI,OAAO;IAItB,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;IAIxC,WAAW,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAQ1C,YAAY,CAAC,QAAQ,EAAE,sBAAsB,GAAG,IAAI;IAUpD,gBAAgB,CAAC,YAAY,EAAE,mBAAmB,GAAG,IAAI;CAgMzD;AAGD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,SAAS,MAAM,GAAG,MAAM,EAClE,aAAa,sBAAsB,EACnC,MAAM,eAAe,EACrB,OAAO,OAAO,EACd,gBAAgB,gBAAgB,KAC9B,WAAW,CAAC,OAAO,CAmBrB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GAAI,OAAO,SAAS,MAAM,GAAG,MAAM,EAC5E,MAAM,oBAAoB,CAAC,OAAO,CAAC,EACnC,aAAa,sBAAsB,KACjC,WAAW,CAAC,OAAO,CAOrB,CAAC;AAIF,eAAO,MAAM,kBAAkB,GAC9B,UAAU,OAAO,EACjB,aAAa,sBAAsB,KACjC,WAGF,CAAC"}
|
|
@@ -12,6 +12,7 @@ import { to_error_message } from '@fuzdev/fuz_util/error.ts';
|
|
|
12
12
|
import { create_jsonrpc_request, create_jsonrpc_response, create_jsonrpc_error_response, create_jsonrpc_notification, to_jsonrpc_params, is_jsonrpc_error_response } from '../http/jsonrpc_helpers.js';
|
|
13
13
|
import { dev_only, jsonrpc_error_messages, ThrownJsonrpcError, UNKNOWN_ERROR_MESSAGE } from '../http/jsonrpc_errors.js';
|
|
14
14
|
import { safe_parse_dropping_unknown_keys } from '../http/schema_helpers.js';
|
|
15
|
+
import { resolve_issues_invalid_reason } from '../schema_meta.js';
|
|
15
16
|
import { ActionEventData } from './action_event_data.js';
|
|
16
17
|
import { validate_step_transition, validate_phase_transition, should_validate_output, is_action_complete, create_initial_data, get_initial_phase, is_request_response, is_send_request_with_parsed_input, is_notification_send_with_parsed_input } from './action_event_helpers.js';
|
|
17
18
|
/**
|
|
@@ -20,6 +21,18 @@ import { validate_step_transition, validate_phase_transition, should_validate_ou
|
|
|
20
21
|
* `invalid_params` / `validation_error` a caller's own bad input produces.
|
|
21
22
|
*/
|
|
22
23
|
export const ERROR_RESPONSE_OUTPUT_INVALID = 'response_output_invalid';
|
|
24
|
+
/**
|
|
25
|
+
* `error.data` for a local input parse failure: the issues, and the declared
|
|
26
|
+
* `invalid_reason` of the first issue's field — the reason the server would
|
|
27
|
+
* answer the same input with, so a caller matching `data.reason` reads one
|
|
28
|
+
* value whichever side refused.
|
|
29
|
+
*/
|
|
30
|
+
const to_local_invalid_params_data = (input, issues) => {
|
|
31
|
+
const reason = resolve_issues_invalid_reason(input, issues);
|
|
32
|
+
return reason === undefined
|
|
33
|
+
? { validation_errors: issues }
|
|
34
|
+
: { validation_errors: issues, reason };
|
|
35
|
+
};
|
|
23
36
|
/**
|
|
24
37
|
* Action event that manages the lifecycle of an action through its state machine.
|
|
25
38
|
*/
|
|
@@ -136,7 +149,7 @@ export class ActionEvent {
|
|
|
136
149
|
// Handler errors (network, server, business logic) DO transition to error phases.
|
|
137
150
|
this.#fail(
|
|
138
151
|
// no need to protect this info
|
|
139
|
-
jsonrpc_error_messages.invalid_params(`failed to parse input: ${z.prettifyError(parsed.error)}`,
|
|
152
|
+
jsonrpc_error_messages.invalid_params(`failed to parse input: ${z.prettifyError(parsed.error)}`, to_local_invalid_params_data(this.spec.input, parsed.error.issues)));
|
|
140
153
|
}
|
|
141
154
|
return this;
|
|
142
155
|
}
|
|
@@ -28,7 +28,10 @@
|
|
|
28
28
|
* sits behind the authority gates by choice rather than necessity: a
|
|
29
29
|
* caller those gates refuse is answered 403, not 429.
|
|
30
30
|
* 5. **Validate params (400)** — `spec.input.safeParse(raw_params)` with
|
|
31
|
-
* `z.void()` / `?? {}` rules (`to_input_params`).
|
|
31
|
+
* `z.void()` / `?? {}` rules (`to_input_params`). A refusal is the generic
|
|
32
|
+
* `invalid params`, with `data.reason` when the first issue's field
|
|
33
|
+
* declares an `invalid_reason` (`to_invalid_params_error`) and the Zod
|
|
34
|
+
* issues under DEV only. Runs **after** the authority gates: a
|
|
32
35
|
* 400 describing the action's input shape to a caller those gates
|
|
33
36
|
* refuse would confirm the method exists and describe how to call it,
|
|
34
37
|
* to a channel that should have learned nothing. Coarse authority
|
|
@@ -55,6 +58,7 @@
|
|
|
55
58
|
* @module
|
|
56
59
|
*/
|
|
57
60
|
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
61
|
+
import type { z } from 'zod';
|
|
58
62
|
import type { Uuid } from '../primitive_schemas.js';
|
|
59
63
|
import { type RequestContext } from '../auth/request_context.js';
|
|
60
64
|
import { type CredentialType } from '../hono_context.js';
|
|
@@ -163,6 +167,18 @@ export type PerformActionResult = {
|
|
|
163
167
|
* the harness omits `account_id`.
|
|
164
168
|
*/
|
|
165
169
|
export declare const perform_action: (input: PerformActionInput, deps: PerformActionDeps) => Promise<PerformActionResult>;
|
|
170
|
+
/**
|
|
171
|
+
* The `invalid_params` error an input validation failure answers: the generic
|
|
172
|
+
* `invalid params` message, `data.reason` when the field the first issue lands
|
|
173
|
+
* on declares an `invalid_reason` and no issue sits on the input itself
|
|
174
|
+
* (`resolve_issues_invalid_reason`), and the Zod issues under DEV only
|
|
175
|
+
* (`dev_only`). With no declared reason, production sends no `data` at all.
|
|
176
|
+
*
|
|
177
|
+
* @param input - the action's input schema
|
|
178
|
+
* @param issues - the failed parse's issues, in Zod's order
|
|
179
|
+
* @returns the JSON-RPC error object
|
|
180
|
+
*/
|
|
181
|
+
export declare const to_invalid_params_error: (input: z.ZodType, issues: ReadonlyArray<z.core.$ZodIssue>) => JsonrpcErrorObject;
|
|
166
182
|
/**
|
|
167
183
|
* The credential-type 403 — one builder, so the dispatcher's gate below and a
|
|
168
184
|
* handler that gates a credential channel on its input (`account_delete`'s
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perform_action.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/perform_action.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"perform_action.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/perform_action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAGN,KAAK,cAAc,EACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAKtC,OAAO,EAEN,KAAK,gBAAgB,EAErB,KAAK,kBAAkB,EACvB,MAAM,oBAAoB,CAAC;AAc5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAgC,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAGN,KAAK,UAAU,EACf,MAAM,wBAAwB,CAAC;AAEhC;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAClC,kEAAkE;IAClE,MAAM,EAAE,SAAS,CAAC;IAClB,mGAAmG;IACnG,UAAU,EAAE,OAAO,CAAC;IACpB,sDAAsD;IACtD,UAAU,EAAE,gBAAgB,CAAC;IAC7B,yDAAyD;IACzD,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AO,MAAM,cAAc,GAC1B,OAAO,kBAAkB,EACzB,MAAM,iBAAiB,KACrB,OAAO,CAAC,mBAAmB,CAiL7B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GACnC,OAAO,CAAC,CAAC,OAAO,EAChB,QAAQ,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KACrC,kBAOF,CAAC;AA6DF;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,GAC1C,2BAA2B,aAAa,CAAC,MAAM,CAAC,KAC9C,kBAIA,CAAC;AAyDJ;;;GAGG;AACH,eAAO,MAAM,iCAAiC,GAC7C,IAAI,gBAAgB,EACpB,QAAQ,mBAAmB,KACzB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,gBAAgB,CAAA;CAAE,GAAG,CAC9C;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,kBAAkB,CAAA;CAAE,CAMnD,CAAC"}
|
|
@@ -28,7 +28,10 @@
|
|
|
28
28
|
* sits behind the authority gates by choice rather than necessity: a
|
|
29
29
|
* caller those gates refuse is answered 403, not 429.
|
|
30
30
|
* 5. **Validate params (400)** — `spec.input.safeParse(raw_params)` with
|
|
31
|
-
* `z.void()` / `?? {}` rules (`to_input_params`).
|
|
31
|
+
* `z.void()` / `?? {}` rules (`to_input_params`). A refusal is the generic
|
|
32
|
+
* `invalid params`, with `data.reason` when the first issue's field
|
|
33
|
+
* declares an `invalid_reason` (`to_invalid_params_error`) and the Zod
|
|
34
|
+
* issues under DEV only. Runs **after** the authority gates: a
|
|
32
35
|
* 400 describing the action's input shape to a caller those gates
|
|
33
36
|
* refuse would confirm the method exists and describe how to call it,
|
|
34
37
|
* to a channel that should have learned nothing. Coarse authority
|
|
@@ -57,6 +60,7 @@
|
|
|
57
60
|
import { DEV } from 'esm-env';
|
|
58
61
|
import { apply_authorization_phase, has_any_scoped_role } from '../auth/request_context.js';
|
|
59
62
|
import {} from '../hono_context.js';
|
|
63
|
+
import { resolve_issues_invalid_reason } from '../schema_meta.js';
|
|
60
64
|
import { to_input_params } from '../http/schema_helpers.js';
|
|
61
65
|
import { rate_limit_ip_key } from '../http/ip_canonical.js';
|
|
62
66
|
import { dispatch_with_post_commit_rollback } from '../http/pending_effects.js';
|
|
@@ -153,7 +157,7 @@ export const perform_action = async (input, deps) => {
|
|
|
153
157
|
const params = to_input_params(spec.input, raw_params);
|
|
154
158
|
const parse_result = spec.input.safeParse(params);
|
|
155
159
|
if (!parse_result.success) {
|
|
156
|
-
return error_result(
|
|
160
|
+
return error_result(to_invalid_params_error(spec.input, parse_result.error.issues));
|
|
157
161
|
}
|
|
158
162
|
const validated_input = parse_result.data;
|
|
159
163
|
// step 6: dispatch — transaction for mutations, pool for reads.
|
|
@@ -212,6 +216,22 @@ export const perform_action = async (input, deps) => {
|
|
|
212
216
|
return error_result(jsonrpc_error_messages.internal_error(dev_only(err instanceof Error ? err.message : undefined)));
|
|
213
217
|
}
|
|
214
218
|
};
|
|
219
|
+
/**
|
|
220
|
+
* The `invalid_params` error an input validation failure answers: the generic
|
|
221
|
+
* `invalid params` message, `data.reason` when the field the first issue lands
|
|
222
|
+
* on declares an `invalid_reason` and no issue sits on the input itself
|
|
223
|
+
* (`resolve_issues_invalid_reason`), and the Zod issues under DEV only
|
|
224
|
+
* (`dev_only`). With no declared reason, production sends no `data` at all.
|
|
225
|
+
*
|
|
226
|
+
* @param input - the action's input schema
|
|
227
|
+
* @param issues - the failed parse's issues, in Zod's order
|
|
228
|
+
* @returns the JSON-RPC error object
|
|
229
|
+
*/
|
|
230
|
+
export const to_invalid_params_error = (input, issues) => {
|
|
231
|
+
const reason = resolve_issues_invalid_reason(input, issues);
|
|
232
|
+
const issues_data = dev_only({ issues });
|
|
233
|
+
return jsonrpc_error_messages.invalid_params('invalid params', reason === undefined ? issues_data : { reason, ...issues_data });
|
|
234
|
+
};
|
|
215
235
|
const error_result = (error) => ({
|
|
216
236
|
kind: 'error',
|
|
217
237
|
error,
|
package/dist/auth/CLAUDE.md
CHANGED
|
@@ -130,6 +130,7 @@ its registered listeners + optional `AuditLogConfig`. Its methods:
|
|
|
130
130
|
- `add_listener(listener)` — listener registration, returning a remover for that registration (idempotent; the same function registered twice is two registrations, each with its own remover). Twin of Rust `fuz_auth` `AuditEmitter::add_listener` in firing order and snapshot-at-notify
|
|
131
131
|
- `listener_count()` — registered-listener count, for tests / diagnostics
|
|
132
132
|
- `drain_inflight()` — test-binary barrier: waits until no `emit` write is in flight, writes started while waiting included. Only an emitter built with `track_inflight: true` tracks; otherwise it resolves at once (production never tracks). Backs `_testing_drain_effects` (twin of Rust `AuditEmitter::drain_inflight` / `new_with_inflight_tracking`)
|
|
133
|
+
- `is_tracking_inflight()` — whether the emitter was built with `track_inflight: true`, i.e. whether `drain_inflight` can wait on anything. `_testing_drain_effects` reports it as `tracked`, and `cross_drain_effects` (every `list_audit_events` read) refuses `false` (twin of Rust `AuditEmitter::is_tracking_inflight`)
|
|
133
134
|
|
|
134
135
|
Listeners are closure-private; they change only through `add_listener` and
|
|
135
136
|
its removers. `create_app_server` registers the audit-log SSE listener,
|
|
@@ -615,7 +616,7 @@ fine — same as `role_grant_revoke`). `account_undelete` is admin-only —
|
|
|
615
616
|
reactivation has no self path because a soft-deleted account can't
|
|
616
617
|
authenticate.
|
|
617
618
|
|
|
618
|
-
- `admin_account_list_action_spec` — read; input `{limit?, offset?, include_deleted?}`; output `{accounts, grantable_roles}`. `include_deleted` (default false) surfaces soft-deleted rows (with `account.deleted_at` set) for the admin UI's reactivation view.
|
|
619
|
+
- `admin_account_list_action_spec` — read; input `{limit?, offset?, include_deleted?}`; output `{accounts, grantable_roles}`. On it and the other paged reads (`audit_log_list`, `audit_log_role_grant_history`, `role_grant_offer_history`) `limit` / `offset` declare `invalid_reason` `ERROR_LIMIT_INVALID` / `ERROR_OFFSET_INVALID` (`http/error_schemas.ts`), and `audit_log_list`'s `since_seq` / `outcome` `ERROR_SINCE_SEQ_INVALID` / `ERROR_OUTCOME_INVALID`: every refusal of the field carries it. `include_deleted` (default false) surfaces soft-deleted rows (with `account.deleted_at` set) for the admin UI's reactivation view.
|
|
619
620
|
- `account_delete_action_spec` — mutation (soft delete); self-or-admin (`{account, actor}`, handler elevates to admin when `account_id` ≠ self); the self path is session-only, handler-enforced ahead of the target guards (an API or daemon token gets the dispatcher's `ERROR_CREDENTIAL_TYPE_REQUIRED` 403 via `credential_type_required_error`), while an admin deleting another account keeps any credential; input `{account_id?}`; output `{ok, deleted}`. Tombstones account + actor(s), revokes sessions/tokens, emits `account_delete` + per-actor `actor_delete`. Refuses a keeper-role target (`ERROR_CANNOT_DELETE_KEEPER`) or the sole active admin (`ERROR_CANNOT_DELETE_LAST_ADMIN`) — both fail-loud with a failure-audit row.
|
|
620
621
|
- `account_purge_action_spec` — mutation (hard purge); keeper-only (`credential_types: ['daemon_token']` + `roles: ['keeper']`) + `confirm: true` + WARN; input `{account_id, confirm?}`; output `{ok, purged}`. Cascading delete; emits `account_purge` + per-actor `actor_purge` (identity snapshot survives in metadata since `audit_log` ids carry no FK). Refuses a keeper-role target (`ERROR_CANNOT_DELETE_KEEPER`) or the sole active admin (`ERROR_CANNOT_DELETE_LAST_ADMIN`).
|
|
621
622
|
- `account_undelete_action_spec` — mutation (reactivation, inverse of soft delete); admin-only (`roles: ['admin']` — no self path, a tombstoned account can't authenticate); input `{account_id}`; output `{ok, undeleted}`. Clears the `deleted_at` tombstone on the account + its actor(s), emits `account_undelete` + per-actor `actor_undelete`. Does not restore revoked sessions/tokens.
|
|
@@ -805,7 +806,7 @@ Options: `roles?: RoleSchemaResult` (drives admin-grant-path lookup),
|
|
|
805
806
|
- `account_session_list_action_spec` — read; input `z.void()`; output `{sessions}`.
|
|
806
807
|
- `account_session_revoke_action_spec` — mutation; input `{session_id}`; output `{ok, revoked}`.
|
|
807
808
|
- `account_session_revoke_all_action_spec` — mutation; input `z.void()`; output `{ok, count}`.
|
|
808
|
-
- `account_token_create_action_spec` — mutation; input `{name?, scope, lifetime}` (both `scope` and `lifetime` required — default-deny at mint on both axes; `name` at most `API_TOKEN_NAME_LENGTH_MAX` = 255 characters, since it is copied into the audit row); output `{ok, token, id, name, expires_at}`.
|
|
809
|
+
- `account_token_create_action_spec` — mutation; input `{name?, scope, lifetime}` (both `scope` and `lifetime` required — default-deny at mint on both axes; `name` at most `API_TOKEN_NAME_LENGTH_MAX` = 255 characters, since it is copied into the audit row); output `{ok, token, id, name, expires_at}`. `scope` / `lifetime` declare `invalid_reason` `ERROR_TOKEN_SCOPE_INVALID` / `ERROR_TOKEN_LIFETIME_INVALID`, so every refusal of either carries it — the handler's over-cap scope refusal included.
|
|
809
810
|
- `account_token_list_action_spec` — read; input `z.void()`; output `{tokens}`.
|
|
810
811
|
- `account_token_revoke_action_spec` — mutation; input `{token_id}`; output `{ok, revoked}`.
|
|
811
812
|
|
|
@@ -52,6 +52,18 @@ export type SessionRevokeAllOutput = z.infer<typeof SessionRevokeAllOutput>;
|
|
|
52
52
|
* the Rust spine's `API_TOKEN_NAME_LENGTH_MAX`.
|
|
53
53
|
*/
|
|
54
54
|
export declare const API_TOKEN_NAME_LENGTH_MAX = 255;
|
|
55
|
+
/**
|
|
56
|
+
* `error.data.reason` on any refusal of `account_token_create`'s `scope` —
|
|
57
|
+
* missing, `null`, an unknown `kind` or key, a malformed `methods`, an
|
|
58
|
+
* over-cap document. The field's declared `invalid_reason`.
|
|
59
|
+
*/
|
|
60
|
+
export declare const ERROR_TOKEN_SCOPE_INVALID: "token_scope_invalid";
|
|
61
|
+
/**
|
|
62
|
+
* `error.data.reason` on any refusal of `account_token_create`'s `lifetime` —
|
|
63
|
+
* missing, `null`, an unknown `kind` or key, a `days` out of range. The
|
|
64
|
+
* field's declared `invalid_reason`.
|
|
65
|
+
*/
|
|
66
|
+
export declare const ERROR_TOKEN_LIFETIME_INVALID: "token_lifetime_invalid";
|
|
55
67
|
/**
|
|
56
68
|
* Input for `account_token_create`.
|
|
57
69
|
*
|
|
@@ -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;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAW3E,6EAA6E;AAC7E,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,yCAAyC;AACzC,eAAO,MAAM,iBAAiB;;;;;;;kBAE5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB;;kBAE7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,iFAAiF;AACjF,eAAO,MAAM,mBAAmB;;;kBAG9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,6DAA6D;AAC7D,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E,+CAA+C;AAC/C,eAAO,MAAM,sBAAsB;;;kBAGjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBA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O,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;CAUR,CAAC;AAKtC,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;CAUV,CAAC;AAGtC,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;CAUd,CAAC;AAEtC;;;;;;;;;GASG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWR,CAAC;AAEtC,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;CAUN,CAAC;AAGtC,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;CAUR,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,yBAAyB,CAQrE,CAAC"}
|
|
@@ -45,6 +45,18 @@ export const SessionRevokeAllOutput = z.strictObject({
|
|
|
45
45
|
* the Rust spine's `API_TOKEN_NAME_LENGTH_MAX`.
|
|
46
46
|
*/
|
|
47
47
|
export const API_TOKEN_NAME_LENGTH_MAX = 255;
|
|
48
|
+
/**
|
|
49
|
+
* `error.data.reason` on any refusal of `account_token_create`'s `scope` —
|
|
50
|
+
* missing, `null`, an unknown `kind` or key, a malformed `methods`, an
|
|
51
|
+
* over-cap document. The field's declared `invalid_reason`.
|
|
52
|
+
*/
|
|
53
|
+
export const ERROR_TOKEN_SCOPE_INVALID = 'token_scope_invalid';
|
|
54
|
+
/**
|
|
55
|
+
* `error.data.reason` on any refusal of `account_token_create`'s `lifetime` —
|
|
56
|
+
* missing, `null`, an unknown `kind` or key, a `days` out of range. The
|
|
57
|
+
* field's declared `invalid_reason`.
|
|
58
|
+
*/
|
|
59
|
+
export const ERROR_TOKEN_LIFETIME_INVALID = 'token_lifetime_invalid';
|
|
48
60
|
/**
|
|
49
61
|
* Input for `account_token_create`.
|
|
50
62
|
*
|
|
@@ -69,11 +81,13 @@ export const TokenCreateInput = z.strictObject({
|
|
|
69
81
|
description: "What the token may do. `{kind:'full'}` for full account authority, or " +
|
|
70
82
|
"`{kind:'methods',methods:[…]}` to narrow it to named RPC methods — a " +
|
|
71
83
|
'narrowed token is RPC-only and reaches no non-RPC surface that reads ' +
|
|
72
|
-
'account data or carries authority.'
|
|
84
|
+
'account data or carries authority.',
|
|
85
|
+
invalid_reason: ERROR_TOKEN_SCOPE_INVALID
|
|
73
86
|
}),
|
|
74
87
|
lifetime: TokenLifetimeInput.meta({
|
|
75
88
|
description: "How long the token lives. `{kind:'eternal'}` never expires; " +
|
|
76
|
-
"`{kind:'ttl',days:N}` expires N days from mint."
|
|
89
|
+
"`{kind:'ttl',days:N}` expires N days from mint.",
|
|
90
|
+
invalid_reason: ERROR_TOKEN_LIFETIME_INVALID
|
|
77
91
|
})
|
|
78
92
|
});
|
|
79
93
|
/** Output for `account_token_create`. `token` is returned exactly once. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/account_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAwB9F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"account_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/account_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAwB9F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AA0B3D,4CAA4C;AAC5C,MAAM,WAAW,oBAAoB;IACpC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GAClC,MAAM,yBAAyB,EAC/B,UAAS,oBAAyB,KAChC,KAAK,CAAC,SAAS,CAyLjB,CAAC"}
|
|
@@ -39,7 +39,7 @@ import { token_lifetime_to_expires_at } from './token_lifetime.js';
|
|
|
39
39
|
import { generate_api_token } from './api_token.js';
|
|
40
40
|
import { DEFAULT_MAX_TOKENS } from './account_route_schema.js';
|
|
41
41
|
import { to_iso8601_seconds } from '../timestamp.js';
|
|
42
|
-
import { account_verify_action_spec, account_session_list_action_spec, account_session_revoke_action_spec, account_session_revoke_all_action_spec, account_token_create_action_spec, account_token_list_action_spec, account_token_revoke_action_spec } from './account_action_specs.js';
|
|
42
|
+
import { account_verify_action_spec, account_session_list_action_spec, account_session_revoke_action_spec, account_session_revoke_all_action_spec, account_token_create_action_spec, account_token_list_action_spec, account_token_revoke_action_spec, ERROR_TOKEN_SCOPE_INVALID } from './account_action_specs.js';
|
|
43
43
|
/**
|
|
44
44
|
* Create the self-service account RPC actions.
|
|
45
45
|
*
|
|
@@ -111,13 +111,16 @@ export const create_account_actions = (deps, options = {}) => {
|
|
|
111
111
|
// a validation error upstream, not a full-authority token.
|
|
112
112
|
const scope = token_scope_from_input(input.scope);
|
|
113
113
|
// Over the stored-document cap is a malformed request, refused before
|
|
114
|
-
// any write (the insert would otherwise throw it as a 500)
|
|
115
|
-
//
|
|
114
|
+
// any write (the insert would otherwise throw it as a 500), with the
|
|
115
|
+
// reason the schema declares for every other `scope` refusal. Twin of
|
|
116
|
+
// the Rust spine's `invalid_params` on `TokenScopeError::TooLarge`.
|
|
116
117
|
try {
|
|
117
118
|
serialize_token_scope(scope);
|
|
118
119
|
}
|
|
119
120
|
catch (err) {
|
|
120
|
-
throw jsonrpc_errors.invalid_params(`invalid scope: ${to_error_message(err)}
|
|
121
|
+
throw jsonrpc_errors.invalid_params(`invalid scope: ${to_error_message(err)}`, {
|
|
122
|
+
reason: ERROR_TOKEN_SCOPE_INVALID
|
|
123
|
+
});
|
|
121
124
|
}
|
|
122
125
|
// `input.lifetime` is required for the same reason — an omitted lifetime
|
|
123
126
|
// is a validation error, never an eternal token.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/admin_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"admin_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/admin_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAsB3E,+BAA+B;AAC/B,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,8CAA8C;AAC9C,eAAO,MAAM,gCAAgC,KAAK,CAAC;AACnD,0CAA0C;AAC1C,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAIhD,sCAAsC;AACtC,eAAO,MAAM,qBAAqB;;;;;mBA0BrB,CAAC;AACd,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E,uCAAuC;AACvC,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAGjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,sCAAsC;AACtC,eAAO,MAAM,qBAAqB;;mBAIrB,CAAC;AACd,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E,mGAAmG;AACnG,eAAO,MAAM,sBAAsB;;;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KG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,yBAAyB,CAenE,CAAC"}
|
|
@@ -24,6 +24,7 @@ import { ActingActor } from '../http/auth_shape.js';
|
|
|
24
24
|
import { AdminSessionJson, AUDIT_LOG_DEFAULT_LIMIT, AuditEventTypeName, AuditLogEventWithUsernamesJson, AuditOutcome, RoleGrantHistoryEventJson } from './audit_log_schema.js';
|
|
25
25
|
import { InviteJson, InviteWithUsernamesJson } from './invite_schema.js';
|
|
26
26
|
import { AppSettingsWithUsernameJson } from './app_settings_schema.js';
|
|
27
|
+
import { ERROR_LIMIT_INVALID, ERROR_OFFSET_INVALID, ERROR_OUTCOME_INVALID, ERROR_SINCE_SEQ_INVALID } from '../http/error_schemas.js';
|
|
27
28
|
/** Max audit-log page size. */
|
|
28
29
|
export const AUDIT_LOG_LIST_LIMIT_MAX = 200;
|
|
29
30
|
/** Default `admin_account_list` page size. */
|
|
@@ -42,9 +43,15 @@ export const AdminAccountListInput = z
|
|
|
42
43
|
.max(ADMIN_ACCOUNT_LIST_LIMIT_MAX)
|
|
43
44
|
.nullish()
|
|
44
45
|
.meta({
|
|
45
|
-
description: `Max accounts to return (default ${ADMIN_ACCOUNT_LIST_DEFAULT_LIMIT}, max ${ADMIN_ACCOUNT_LIST_LIMIT_MAX})
|
|
46
|
+
description: `Max accounts to return (default ${ADMIN_ACCOUNT_LIST_DEFAULT_LIMIT}, max ${ADMIN_ACCOUNT_LIST_LIMIT_MAX}).`,
|
|
47
|
+
invalid_reason: ERROR_LIMIT_INVALID
|
|
46
48
|
}),
|
|
47
|
-
offset: z
|
|
49
|
+
offset: z
|
|
50
|
+
.number()
|
|
51
|
+
.int()
|
|
52
|
+
.min(0)
|
|
53
|
+
.nullish()
|
|
54
|
+
.meta({ description: 'Pagination offset.', invalid_reason: ERROR_OFFSET_INVALID }),
|
|
48
55
|
include_deleted: z.boolean().nullish().meta({
|
|
49
56
|
description: 'Include soft-deleted (tombstoned) accounts in the listing. Default false (active only). Used by the admin UI to surface accounts for reactivation via `account_undelete`.'
|
|
50
57
|
})
|
|
@@ -97,7 +104,8 @@ export const AuditLogListInput = z
|
|
|
97
104
|
description: 'Filter by event type. Accepts builtin or consumer-registered names (regex-validated).'
|
|
98
105
|
}),
|
|
99
106
|
outcome: AuditOutcome.nullish().meta({
|
|
100
|
-
description: 'Filter by outcome (`success` or `failure`).'
|
|
107
|
+
description: 'Filter by outcome (`success` or `failure`).',
|
|
108
|
+
invalid_reason: ERROR_OUTCOME_INVALID
|
|
101
109
|
}),
|
|
102
110
|
account_id: Uuid.nullish().meta({ description: 'Filter by actor account id.' }),
|
|
103
111
|
limit: z
|
|
@@ -107,11 +115,18 @@ export const AuditLogListInput = z
|
|
|
107
115
|
.max(AUDIT_LOG_LIST_LIMIT_MAX)
|
|
108
116
|
.nullish()
|
|
109
117
|
.meta({
|
|
110
|
-
description: `Max rows to return (default ${AUDIT_LOG_DEFAULT_LIMIT}, max ${AUDIT_LOG_LIST_LIMIT_MAX})
|
|
118
|
+
description: `Max rows to return (default ${AUDIT_LOG_DEFAULT_LIMIT}, max ${AUDIT_LOG_LIST_LIMIT_MAX}).`,
|
|
119
|
+
invalid_reason: ERROR_LIMIT_INVALID
|
|
111
120
|
}),
|
|
112
|
-
offset: z
|
|
121
|
+
offset: z
|
|
122
|
+
.number()
|
|
123
|
+
.int()
|
|
124
|
+
.min(0)
|
|
125
|
+
.nullish()
|
|
126
|
+
.meta({ description: 'Pagination offset.', invalid_reason: ERROR_OFFSET_INVALID }),
|
|
113
127
|
since_seq: z.number().int().min(0).nullish().meta({
|
|
114
|
-
description: 'Gap-fill from this seq forward. Used for SSE reconnection.'
|
|
128
|
+
description: 'Gap-fill from this seq forward. Used for SSE reconnection.',
|
|
129
|
+
invalid_reason: ERROR_SINCE_SEQ_INVALID
|
|
115
130
|
}),
|
|
116
131
|
acting: ActingActor
|
|
117
132
|
})
|
|
@@ -130,9 +145,15 @@ export const AuditLogRoleGrantHistoryInput = z
|
|
|
130
145
|
.max(AUDIT_LOG_LIST_LIMIT_MAX)
|
|
131
146
|
.nullish()
|
|
132
147
|
.meta({
|
|
133
|
-
description: `Max rows to return (default ${AUDIT_LOG_DEFAULT_LIMIT}, max ${AUDIT_LOG_LIST_LIMIT_MAX})
|
|
148
|
+
description: `Max rows to return (default ${AUDIT_LOG_DEFAULT_LIMIT}, max ${AUDIT_LOG_LIST_LIMIT_MAX}).`,
|
|
149
|
+
invalid_reason: ERROR_LIMIT_INVALID
|
|
134
150
|
}),
|
|
135
|
-
offset: z
|
|
151
|
+
offset: z
|
|
152
|
+
.number()
|
|
153
|
+
.int()
|
|
154
|
+
.min(0)
|
|
155
|
+
.nullish()
|
|
156
|
+
.meta({ description: 'Pagination offset.', invalid_reason: ERROR_OFFSET_INVALID }),
|
|
136
157
|
acting: ActingActor
|
|
137
158
|
})
|
|
138
159
|
.default({});
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
* throws are isolated.
|
|
32
32
|
* - `drain_inflight()` — test-binary barrier: await every in-flight `emit`
|
|
33
33
|
* write, on an emitter built with `track_inflight: true`.
|
|
34
|
+
* - `is_tracking_inflight()` — whether that barrier can wait on anything, so a
|
|
35
|
+
* test binary built without tracking is caught rather than racing.
|
|
34
36
|
*
|
|
35
37
|
* ## When listeners hear about a row
|
|
36
38
|
*
|
|
@@ -227,6 +229,18 @@ export interface AuditEmitter {
|
|
|
227
229
|
* to wait for. Twin of the Rust `fuz_auth` `AuditEmitter::drain_inflight`.
|
|
228
230
|
*/
|
|
229
231
|
drain_inflight(): Promise<void>;
|
|
232
|
+
/**
|
|
233
|
+
* Whether this emitter tracks its in-flight `emit` writes — `true` only
|
|
234
|
+
* when built with `track_inflight: true`. When `false`, `drain_inflight`
|
|
235
|
+
* resolves at once and waits on nothing.
|
|
236
|
+
*
|
|
237
|
+
* The `_testing_drain_effects` action reports it as `tracked`, and the
|
|
238
|
+
* `list_audit_events` reads refuse `false`: a test binary whose emitter was
|
|
239
|
+
* built without tracking would otherwise answer the drain at once and its
|
|
240
|
+
* audit reads would race the writes. Twin of the Rust `fuz_auth`
|
|
241
|
+
* `AuditEmitter::is_tracking_inflight`.
|
|
242
|
+
*/
|
|
243
|
+
is_tracking_inflight(): boolean;
|
|
230
244
|
}
|
|
231
245
|
/**
|
|
232
246
|
* Signature of `AuditEmitter.emit` — captured by the inner closure so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_emitter.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_emitter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"audit_emitter.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_emitter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB;IAClE,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACrE,0FAA0F;IAC1F,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB,CAAC,C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AAM,EAC1C,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KACnB,IAAI,CAAC;AAEV;;;;;;;;;;GAUG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,WAAW,CAAC;AAEhE,0CAA0C;AAC1C,MAAM,WAAW,yBAAyB;IACzC,oDAAoD;IACpD,EAAE,EAAE,EAAE,CAAC;IACP,qDAAqD;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IACzD;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,cAAc,CAAC;IAClC;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B;;;;;;;;;OASG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB;AAYD,2EAA2E;AAC3E,eAAO,MAAM,wBAAwB,QAAO,MAA8B,CAAC;AAE3E,0CAA0C;AAC1C,eAAO,MAAM,0BAA0B,QAAO,IAE7C,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,yBAAyB,KAAG,YAiJzE,CAAC"}
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
* throws are isolated.
|
|
32
32
|
* - `drain_inflight()` — test-binary barrier: await every in-flight `emit`
|
|
33
33
|
* write, on an emitter built with `track_inflight: true`.
|
|
34
|
+
* - `is_tracking_inflight()` — whether that barrier can wait on anything, so a
|
|
35
|
+
* test binary built without tracking is caught rather than racing.
|
|
34
36
|
*
|
|
35
37
|
* ## When listeners hear about a row
|
|
36
38
|
*
|
|
@@ -158,6 +160,7 @@ export const create_audit_emitter = (options) => {
|
|
|
158
160
|
await Promise.allSettled(inflight);
|
|
159
161
|
}
|
|
160
162
|
};
|
|
163
|
+
const is_tracking_inflight = () => inflight !== null;
|
|
161
164
|
const base_emit = (ctx, input) => {
|
|
162
165
|
if (input.outcome === 'failure') {
|
|
163
166
|
// an attempt happened whether or not the transaction commits
|
|
@@ -218,6 +221,7 @@ export const create_audit_emitter = (options) => {
|
|
|
218
221
|
notify,
|
|
219
222
|
add_listener,
|
|
220
223
|
listener_count,
|
|
221
|
-
drain_inflight
|
|
224
|
+
drain_inflight,
|
|
225
|
+
is_tracking_inflight
|
|
222
226
|
});
|
|
223
227
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role_grant_offer_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_grant_offer_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"role_grant_offer_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_grant_offer_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAiB3E,oEAAoE;AACpE,eAAO,MAAM,kCAAkC,EAAG,8BAAuC,CAAC;AAC1F,kEAAkE;AAClE,eAAO,MAAM,+BAA+B,EAAG,2BAAoC,CAAC;AACpF,sDAAsD;AACtD,eAAO,MAAM,8BAA8B,EAAG,0BAAmC,CAAC;AAClF,wGAAwG;AACxG,eAAO,MAAM,gCAAgC,EAAG,4BAAqC,CAAC;AACtF,uIAAuI;AACvI,eAAO,MAAM,yCAAyC,EACrD,qCAA8C,CAAC;AAChD,gKAAgK;AAChK,eAAO,MAAM,qCAAqC,EAAG,iCAA0C,CAAC;AAChG,6FAA6F;AAC7F,eAAO,MAAM,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MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,sCAAsC;AACtC,eAAO,MAAM,qBAAqB;;;kBAGhC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAI1E;;;;;;;;;GASG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBX,CAAC;AAEtC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBX,CAAC;AAEtC,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;CAWZ,CAAC;AAEtC,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;CAWZ,CAAC;AAEtC,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWT,CAAC;AAEtC,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWZ,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;CAaL,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBL,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,EAAE,KAAK,CAAC,yBAAyB,CAS9E,CAAC"}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { z } from 'zod';
|
|
24
24
|
import { Uuid, bounded_string } from '../primitive_schemas.js';
|
|
25
|
-
import { ERROR_INSUFFICIENT_PERMISSIONS, ERROR_ROLE_GRANT_NOT_FOUND, ERROR_ROLE_NOT_WEB_GRANTABLE } from '../http/error_schemas.js';
|
|
25
|
+
import { ERROR_INSUFFICIENT_PERMISSIONS, ERROR_LIMIT_INVALID, ERROR_OFFSET_INVALID, ERROR_ROLE_GRANT_NOT_FOUND, ERROR_ROLE_NOT_WEB_GRANTABLE } from '../http/error_schemas.js';
|
|
26
26
|
import { RoleName } from './role_schema.js';
|
|
27
27
|
import { SCOPE_KIND_LENGTH_MAX } from './scope_kind_schema.js';
|
|
28
28
|
import { ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX, RoleGrantOfferJson } from './role_grant_offer_schema.js';
|
|
@@ -153,10 +153,12 @@ export const RoleGrantOfferHistoryInput = z
|
|
|
153
153
|
description: 'Admin-only — history for another account. Defaults to the caller.'
|
|
154
154
|
}),
|
|
155
155
|
limit: z.number().int().min(1).max(ROLE_GRANT_OFFER_HISTORY_LIMIT_MAX).nullish().meta({
|
|
156
|
-
description: 'Max rows to return (default 100).'
|
|
156
|
+
description: 'Max rows to return (default 100).',
|
|
157
|
+
invalid_reason: ERROR_LIMIT_INVALID
|
|
157
158
|
}),
|
|
158
159
|
offset: z.number().int().min(0).nullish().meta({
|
|
159
|
-
description: 'Pagination offset (default 0).'
|
|
160
|
+
description: 'Pagination offset (default 0).',
|
|
161
|
+
invalid_reason: ERROR_OFFSET_INVALID
|
|
160
162
|
}),
|
|
161
163
|
acting: ActingActor
|
|
162
164
|
})
|
package/dist/http/CLAUDE.md
CHANGED
|
@@ -396,7 +396,8 @@ per-action schemas so mismatches surface as `invalid_params` rather than
|
|
|
396
396
|
### 15-code error taxonomy
|
|
397
397
|
|
|
398
398
|
Five standard codes + ten general application codes (consumers add their
|
|
399
|
-
own by casting `as JsonrpcErrorCode
|
|
399
|
+
own by casting `as JsonrpcErrorCode`, and declare each one's HTTP status with
|
|
400
|
+
`register_jsonrpc_error_code` — see below):
|
|
400
401
|
|
|
401
402
|
- `parse_error` (-32700, HTTP 400) — JSON parse failure.
|
|
402
403
|
- `invalid_request` (-32600, HTTP 400) — envelope malformed.
|
|
@@ -423,13 +424,24 @@ business rules.
|
|
|
423
424
|
limiting is the default interpretation when translating generic HTTP back
|
|
424
425
|
to a JSON-RPC code.
|
|
425
426
|
|
|
427
|
+
**Consumer codes** — a consumer code answers 500 until
|
|
428
|
+
`register_jsonrpc_error_code(code, http_status)` declares its status, called
|
|
429
|
+
once at module load beside the code (list that module in `sideEffects`). It
|
|
430
|
+
throws when the code is outside -32099..-32000, is any code
|
|
431
|
+
`JSONRPC_ERROR_CODES` defines, or is already registered with another status,
|
|
432
|
+
or when the status is outside 400–599; the same code and status again is a
|
|
433
|
+
no-op. A registered code joins neither the reverse map nor
|
|
434
|
+
`JSONRPC_ERROR_CODE_TO_NAME`. Twin of the Rust spine's `ConsumerErrorCode::new`,
|
|
435
|
+
which holds a declaration to the same rules.
|
|
436
|
+
|
|
426
437
|
### API map
|
|
427
438
|
|
|
428
439
|
- `JSONRPC_ERROR_CODES` — `Record<JsonrpcErrorName, JsonrpcErrorCode>` (frozen)
|
|
429
440
|
- `jsonrpc_error_messages` — named constructors returning `JsonrpcErrorObject`
|
|
430
441
|
- `jsonrpc_errors` — named constructors returning `ThrownJsonrpcError` (derived from `jsonrpc_error_messages` via `create_error_thrower`). Usage: `throw jsonrpc_errors.not_found('user')`, `throw jsonrpc_errors.forbidden()`
|
|
431
442
|
- `ThrownJsonrpcError` — `Error` subclass carrying `code` + optional `data`
|
|
432
|
-
- `
|
|
443
|
+
- `jsonrpc_error_code_to_http_status` / `http_status_to_jsonrpc_error_code` (fall back to 500 / `internal_error`) — the code → status table is module-private; `HTTP_STATUS_TO_JSONRPC_ERROR_CODE` (frozen) is the reverse over the base set
|
|
444
|
+
- `register_jsonrpc_error_code(code, http_status)` — declares a consumer code's status (see **Consumer codes** above)
|
|
433
445
|
- Envelope schemas in `http/jsonrpc.ts`: `JsonrpcRequest`, `JsonrpcNotification`, `JsonrpcResponse`, `JsonrpcErrorResponse`, `JsonrpcResponseOrError`, `JsonrpcMessage`, `JsonrpcMessageFromClientToServer`, `JsonrpcMessageFromServerToClient`. Also `JsonrpcRequestId`, `JsonrpcMethod`, `JsonrpcProgressToken`, `JsonrpcMcpMeta`, `JsonrpcRequestParamsMeta`
|
|
434
446
|
- Builders in `http/jsonrpc_helpers.ts`: `create_jsonrpc_request`, `create_jsonrpc_notification`, `create_jsonrpc_response`, `create_jsonrpc_error_response`, `create_jsonrpc_error_response_from_thrown` (preserves code/message/data on `ThrownJsonrpcError`; plain `Error` → `internal_error` with `{stack}` in DEV)
|
|
435
447
|
- Type guards: `is_jsonrpc_request_id` (rejects NaN/Infinity), `is_jsonrpc_object`, `is_jsonrpc_message`, `is_jsonrpc_request` / `_notification` / `_response` / `_error_response`
|
|
@@ -124,6 +124,14 @@ export declare const ERROR_ROLE_NOT_WEB_GRANTABLE: "role_not_web_grantable";
|
|
|
124
124
|
export declare const ERROR_ROLE_GRANT_NOT_FOUND: "role_grant_not_found";
|
|
125
125
|
/** Query parameter `event_type` is not a valid audit event type. */
|
|
126
126
|
export declare const ERROR_INVALID_EVENT_TYPE: "invalid_event_type";
|
|
127
|
+
/** `limit` on a paged read refused — out of `[1, max]`, or not an integer. */
|
|
128
|
+
export declare const ERROR_LIMIT_INVALID: "limit_invalid";
|
|
129
|
+
/** `offset` on a paged read refused — negative, or not a safe integer. */
|
|
130
|
+
export declare const ERROR_OFFSET_INVALID: "offset_invalid";
|
|
131
|
+
/** `audit_log_list`'s `since_seq` cursor refused — negative, or not a safe integer. */
|
|
132
|
+
export declare const ERROR_SINCE_SEQ_INVALID: "since_seq_invalid";
|
|
133
|
+
/** `audit_log_list`'s `outcome` filter refused — not `'success'` or `'failure'`. */
|
|
134
|
+
export declare const ERROR_OUTCOME_INVALID: "outcome_invalid";
|
|
127
135
|
/** DELETE blocked by a foreign key constraint. */
|
|
128
136
|
export declare const ERROR_FOREIGN_KEY_VIOLATION: "foreign_key_violation";
|
|
129
137
|
/** Table name not found in `information_schema`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error_schemas.d.ts","sourceRoot":"../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