@fuzdev/fuz_app 0.96.0 → 0.98.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 +57 -23
- package/dist/actions/action_bridge.d.ts.map +1 -1
- package/dist/actions/action_codegen.d.ts +1 -1
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +1 -1
- package/dist/actions/{action_peer.d.ts → action_dispatcher.d.ts} +12 -12
- package/dist/actions/action_dispatcher.d.ts.map +1 -0
- package/dist/actions/{action_peer.js → action_dispatcher.js} +2 -2
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_rpc.d.ts +9 -0
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/broadcast_api.d.ts +2 -2
- package/dist/actions/broadcast_api.d.ts.map +1 -1
- package/dist/actions/compile_action_registry.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.d.ts +3 -3
- package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.js +3 -3
- package/dist/actions/peer_ping.d.ts +147 -0
- package/dist/actions/peer_ping.d.ts.map +1 -0
- package/dist/actions/peer_ping.js +189 -0
- package/dist/actions/peer_request.d.ts +158 -0
- package/dist/actions/peer_request.d.ts.map +1 -0
- package/dist/actions/peer_request.js +167 -0
- package/dist/actions/perform_action.d.ts +8 -0
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +2 -1
- package/dist/actions/protocol.d.ts +3 -3
- package/dist/actions/protocol.d.ts.map +1 -1
- package/dist/actions/protocol.js +9 -4
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +28 -1
- package/dist/actions/rpc_client.d.ts +4 -4
- package/dist/actions/rpc_client.d.ts.map +1 -1
- package/dist/actions/socket.svelte.d.ts.map +1 -1
- package/dist/actions/transports.d.ts +1 -1
- package/dist/actions/transports_http.d.ts.map +1 -1
- package/dist/actions/transports_ws.d.ts +12 -5
- package/dist/actions/transports_ws.d.ts.map +1 -1
- package/dist/actions/transports_ws.js +36 -6
- package/dist/actions/transports_ws_backend.d.ts +34 -1
- package/dist/actions/transports_ws_backend.d.ts.map +1 -1
- package/dist/actions/transports_ws_backend.js +62 -5
- package/dist/auth/CLAUDE.md +13 -13
- package/dist/auth/actor_lookup_action_specs.d.ts.map +1 -1
- package/dist/auth/actor_search_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +6 -7
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.d.ts +21 -4
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +61 -10
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +6 -2
- package/dist/auth/role_grant_queries.d.ts +31 -12
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +36 -12
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/db/create_db.d.ts.map +1 -1
- package/dist/db/fact_store.d.ts.map +1 -1
- package/dist/db/status.d.ts.map +1 -1
- package/dist/http/CLAUDE.md +3 -2
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/error_schemas.d.ts +0 -6
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +0 -6
- package/dist/http/jsonrpc_helpers.d.ts +1 -1
- package/dist/http/jsonrpc_helpers.js +1 -1
- package/dist/http/origin.d.ts +18 -1
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +17 -0
- package/dist/rate_limiter.d.ts.map +1 -1
- package/dist/rate_limiter.js +11 -0
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +7 -4
- package/dist/testing/CLAUDE.md +41 -18
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/adversarial_input.d.ts.map +1 -1
- package/dist/testing/adversarial_input.js +3 -1
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +4 -1
- package/dist/testing/cross_backend/action_manifest.d.ts +7 -7
- package/dist/testing/cross_backend/action_manifest.js +7 -7
- package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/bootstrap_backend.d.ts.map +1 -1
- package/dist/testing/cross_backend/bootstrap_backend.js +8 -0
- package/dist/testing/cross_backend/capabilities.d.ts +15 -12
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +4 -4
- package/dist/testing/cross_backend/cell_cross_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_case.d.ts +42 -0
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_case.js +47 -0
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +90 -3
- package/dist/testing/cross_backend/cookie_attributes.d.ts +20 -0
- package/dist/testing/cross_backend/cookie_attributes.d.ts.map +1 -0
- package/dist/testing/cross_backend/cookie_attributes.js +158 -0
- package/dist/testing/cross_backend/credential_header_robustness.d.ts +12 -0
- package/dist/testing/cross_backend/credential_header_robustness.d.ts.map +1 -0
- package/dist/testing/cross_backend/credential_header_robustness.js +179 -0
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +5 -3
- package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
- package/dist/testing/cross_backend/fact_serving.js +5 -1
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +7 -0
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
- package/dist/testing/cross_backend/method_coverage.d.ts +3 -7
- package/dist/testing/cross_backend/method_coverage.d.ts.map +1 -1
- package/dist/testing/cross_backend/method_coverage.js +1 -2
- package/dist/testing/cross_backend/peer_ping_ws.js +1 -1
- package/dist/testing/cross_backend/role_grant_offer_enumeration.d.ts +26 -0
- package/dist/testing/cross_backend/role_grant_offer_enumeration.d.ts.map +1 -0
- package/dist/testing/cross_backend/role_grant_offer_enumeration.js +108 -0
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.d.ts +17 -0
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +31 -8
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +0 -13
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +12 -4
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +9 -3
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/db.d.ts.map +1 -1
- package/dist/testing/db_entities.d.ts +15 -0
- package/dist/testing/db_entities.d.ts.map +1 -1
- package/dist/testing/db_entities.js +16 -1
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +1 -2
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +3 -1
- package/dist/testing/schema_parity.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/surface_invariants.d.ts.map +1 -1
- package/dist/testing/transports/bootstrap.d.ts.map +1 -1
- package/dist/testing/transports/ws_client.d.ts +1 -1
- package/dist/testing/transports/ws_transport.d.ts +1 -1
- package/dist/testing/ws_round_trip.d.ts +1 -1
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +3 -3
- package/dist/ui/CLAUDE.md +6 -3
- package/dist/ui/auth_state.svelte.d.ts.map +1 -1
- package/dist/ui/form_state.svelte.d.ts.map +1 -1
- package/dist/ui/role_grant_offers_state.svelte.d.ts +1 -1
- package/dist/ui/role_grant_offers_state.svelte.js +1 -1
- package/dist/ui/ui_format.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/actions/action_peer.d.ts.map +0 -1
|
@@ -33,13 +33,14 @@ import { hash_session_token } from '../auth/session_queries.js';
|
|
|
33
33
|
import { get_client_ip } from '../http/client_ip.js';
|
|
34
34
|
import { flush_pending_effects, flush_post_commit_effects } from '../http/pending_effects.js';
|
|
35
35
|
import { jsonrpc_error_messages } from '../http/jsonrpc_errors.js';
|
|
36
|
-
import { create_jsonrpc_error_response, create_jsonrpc_notification, to_jsonrpc_message_id, to_jsonrpc_params, is_jsonrpc_request, } from '../http/jsonrpc_helpers.js';
|
|
36
|
+
import { create_jsonrpc_error_response, create_jsonrpc_notification, to_jsonrpc_message_id, to_jsonrpc_params, is_jsonrpc_request, is_jsonrpc_response, is_jsonrpc_error_response, } from '../http/jsonrpc_helpers.js';
|
|
37
37
|
import { CREDENTIAL_TYPE_KEY, AUTH_API_TOKEN_ID_KEY, TEST_CONTEXT_PRESET_KEY, } from '../hono_context.js';
|
|
38
38
|
import {} from './action_types.js';
|
|
39
39
|
import { compile_action_registry } from './compile_action_registry.js';
|
|
40
40
|
import { cancel_action_spec, CancelNotificationParams } from './cancel.js';
|
|
41
41
|
import { WS_CLOSE_SERVER_HEARTBEAT_TIMEOUT } from './transports.js';
|
|
42
42
|
import { BackendWebsocketTransport } from './transports_ws_backend.js';
|
|
43
|
+
import { audit_unmatched_peer_response } from './peer_request.js';
|
|
43
44
|
import { perform_action, perform_action_result_to_envelope } from './perform_action.js';
|
|
44
45
|
/** Default inactivity window before the server closes a silent socket. */
|
|
45
46
|
export const DEFAULT_SERVER_HEARTBEAT_TIMEOUT = 60_000;
|
|
@@ -220,6 +221,21 @@ export const register_action_ws = (options) => {
|
|
|
220
221
|
ws.send(JSON.stringify(create_jsonrpc_error_response(null, jsonrpc_error_messages.invalid_request('batch JSON-RPC requests are not supported on WebSocket'))));
|
|
221
222
|
return;
|
|
222
223
|
}
|
|
224
|
+
// Inbound responses to server-initiated requests (`peer/ping`,
|
|
225
|
+
// etc.) — route to the pending-request registry scoped to THIS
|
|
226
|
+
// socket. A response carries `result`/`error` + `id` and no
|
|
227
|
+
// `method`, so it precedes the request/notification split below.
|
|
228
|
+
// An unmatched id (unsolicited, cross-connection, or already
|
|
229
|
+
// settled) resolves nothing and is dropped, so the read loop
|
|
230
|
+
// survives a junk frame.
|
|
231
|
+
if (is_jsonrpc_response(json) || is_jsonrpc_error_response(json)) {
|
|
232
|
+
if (captured_connection_id !== undefined) {
|
|
233
|
+
const matched = transport.resolve_peer_response(captured_connection_id, json);
|
|
234
|
+
if (!matched)
|
|
235
|
+
audit_unmatched_peer_response(log, captured_connection_id, json.id);
|
|
236
|
+
}
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
223
239
|
// Notifications (method + no id) — `cancel` is intercepted
|
|
224
240
|
// for request-scoped cancellation; other notifications are
|
|
225
241
|
// silenced per JSON-RPC spec (consumer notification handlers
|
|
@@ -289,6 +305,16 @@ export const register_action_ws = (options) => {
|
|
|
289
305
|
const pending_effects = [];
|
|
290
306
|
const post_commit_effects = [];
|
|
291
307
|
const notify = notify_socket(ws);
|
|
308
|
+
// Server→client request seam (ActionPeer) — closes over this
|
|
309
|
+
// socket's connection_id so a handler can initiate a request to
|
|
310
|
+
// the originating client and await the reply. `const` capture so
|
|
311
|
+
// the narrowed (non-undefined) type holds inside the closure;
|
|
312
|
+
// `undefined` only in the degenerate case where a message
|
|
313
|
+
// dispatches before onOpen assigned the id.
|
|
314
|
+
const conn_id = captured_connection_id;
|
|
315
|
+
const request_client = conn_id === undefined
|
|
316
|
+
? undefined
|
|
317
|
+
: (request_method, request_params, request_options) => transport.request_connection(conn_id, request_method, request_params, request_options);
|
|
292
318
|
const signal = AbortSignal.any([
|
|
293
319
|
socket_abort_controller.signal,
|
|
294
320
|
request_controller.signal,
|
|
@@ -304,6 +330,7 @@ export const register_action_ws = (options) => {
|
|
|
304
330
|
signal,
|
|
305
331
|
notify,
|
|
306
332
|
connection_id: captured_connection_id,
|
|
333
|
+
request_client,
|
|
307
334
|
preset: upgrade_preset,
|
|
308
335
|
}, {
|
|
309
336
|
db,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import type { Result } from '@fuzdev/fuz_util/result.ts';
|
|
14
14
|
import type { ActionEventEnvironment } from './action_event_types.js';
|
|
15
15
|
import { type ActionEvent } from './action_event.js';
|
|
16
|
-
import type {
|
|
16
|
+
import type { ActionDispatcher, ActionDispatcherSendOptions } from './action_dispatcher.js';
|
|
17
17
|
import type { TransportName } from './transports.js';
|
|
18
18
|
import type { JsonrpcErrorObject } from '../http/jsonrpc.js';
|
|
19
19
|
/**
|
|
@@ -27,7 +27,7 @@ import type { JsonrpcErrorObject } from '../http/jsonrpc.js';
|
|
|
27
27
|
export type TransportForMethod = (method: string) => TransportName | undefined;
|
|
28
28
|
/** Options for `create_rpc_client`. */
|
|
29
29
|
export interface CreateRpcClientOptions<TApi extends object = object> {
|
|
30
|
-
peer:
|
|
30
|
+
peer: ActionDispatcher;
|
|
31
31
|
environment: ActionEventEnvironment;
|
|
32
32
|
/**
|
|
33
33
|
* Optional callback fired once per dispatched action with the live
|
|
@@ -73,11 +73,11 @@ export interface CreateRpcClientOptions<TApi extends object = object> {
|
|
|
73
73
|
export declare const create_rpc_client: <TApi extends object>(options: CreateRpcClientOptions<TApi>) => TApi;
|
|
74
74
|
/**
|
|
75
75
|
* Per-call options accepted by every typed Proxy method. Same shape as
|
|
76
|
-
* `
|
|
76
|
+
* `ActionDispatcherSendOptions` — the client threads these through unchanged
|
|
77
77
|
* to the underlying peer. `transport_name` overrides the per-method
|
|
78
78
|
* `transport_for_method` selector for this call.
|
|
79
79
|
*/
|
|
80
|
-
export interface RpcClientCallOptions extends
|
|
80
|
+
export interface RpcClientCallOptions extends ActionDispatcherSendOptions {
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* Maps a typed `ActionsApi` to a throwing variant.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc_client.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/rpc_client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,4BAA4B,CAAC;AAQvD,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAsB,KAAK,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAMxE,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"rpc_client.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/rpc_client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,4BAA4B,CAAC;AAQvD,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAsB,KAAK,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAMxE,OAAO,KAA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I,IAAI;IAOxB,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED;;;;OAIG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;;;;;;;;OASG;IACH,OAAO,IAAI,IAAI;IA2Bf;;;;;;;;OAQG;IACH,UAAU,CAAC,IAAI,GAAE,MAA2B,GAAG,IAAI;IASnD,sGAAsG;IACtG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;IAIxB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAc3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,OAAO,CAAC,CAAC,GAAG,OAAO,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,OAAY,EACpB,OAAO,GAAE;QAAC,MAAM,CAAC,EAAE,WAAW,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,EAAE,CAAC,EAAE,gBAAgB,CAAA;KAAM,GAC1E,OAAO,CAAC,CAAC,CAAC;IA2Eb,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,IAAI;IAK9D,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,IAAI;CA2U1D;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,6BAA6B,GACzC,QAAQ,YAAY,EACpB,SAAS,OAAO,KACd,WAaF,CAAC"}
|
|
@@ -19,7 +19,7 @@ export type TransportName = z.infer<typeof TransportName>;
|
|
|
19
19
|
/**
|
|
20
20
|
* Per-call options accepted by every transport's `send`. Optional and
|
|
21
21
|
* extensible — adding a field is non-breaking. Source of truth for the
|
|
22
|
-
* shared option shape; `
|
|
22
|
+
* shared option shape; `ActionDispatcherSendOptions` and `RpcClientCallOptions`
|
|
23
23
|
* extend it.
|
|
24
24
|
*/
|
|
25
25
|
export interface TransportSendOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transports_http.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,OAAO,KAAK,EAGX,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,SAAS,EAAE,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAErE;;;;;;GAMG;AACH,qBAAa,qBAAsB,YAAW,SAAS;;IACtD,QAAQ,CAAC,cAAc,EAAG,mBAAmB,CAAU;gBAOtD,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO;IAOzC,IAAI,CACT,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,sBAAsB,CAAC;IAC5B,IAAI,CACT,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"transports_http.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,OAAO,KAAK,EAGX,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,SAAS,EAAE,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAErE;;;;;;GAMG;AACH,qBAAa,qBAAsB,YAAW,SAAS;;IACtD,QAAQ,CAAC,cAAc,EAAG,mBAAmB,CAAU;gBAOtD,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO;IAOzC,IAAI,CACT,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,sBAAsB,CAAC;IAC5B,IAAI,CACT,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA2EvC,QAAQ,IAAI,OAAO;CAGnB"}
|
|
@@ -5,9 +5,14 @@
|
|
|
5
5
|
* and `AbortSignal`-driven cancel to the underlying connection (the
|
|
6
6
|
* canonical implementation is `FrontendWebsocketClient`). The transport's
|
|
7
7
|
* own job is the `Transport` contract: route inbound server-pushed
|
|
8
|
-
* messages into `peer.receive
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* messages into `peer.receive`, send the resulting response back over the
|
|
9
|
+
* socket (the server→client ActionPeer receive loop), and translate the
|
|
10
|
+
* connection's `Promise<R>`/`ThrownJsonrpcError` shape into
|
|
11
|
+
* `JsonrpcResponseOrError` envelopes. No parallel pending-request map.
|
|
12
|
+
*
|
|
13
|
+
* Inbound `peer/ping` requests are answered directly via the built-in
|
|
14
|
+
* `peer_ping_responder` — a protocol-liveness concern that works with zero
|
|
15
|
+
* consumer wiring, the same way the server runs the `heartbeat` echo.
|
|
11
16
|
*
|
|
12
17
|
* @module
|
|
13
18
|
*/
|
|
@@ -44,8 +49,10 @@ export interface WebsocketRpcConnection extends WebsocketConnection {
|
|
|
44
49
|
/**
|
|
45
50
|
* Thin adapter over `WebsocketRpcConnection` (canonical implementation:
|
|
46
51
|
* `FrontendWebsocketClient`). Routes inbound server-pushed requests and
|
|
47
|
-
* notifications into the supplied `receive` callback
|
|
48
|
-
*
|
|
52
|
+
* notifications into the supplied `receive` callback and sends the request
|
|
53
|
+
* response back over the socket; an inbound `peer/ping` is answered by the
|
|
54
|
+
* built-in responder before `receive`. Responses to requests *we* sent are
|
|
55
|
+
* owned by the connection's own `request()` pending map and are ignored here.
|
|
49
56
|
*/
|
|
50
57
|
export declare class FrontendWebsocketTransport implements Transport {
|
|
51
58
|
#private;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transports_ws.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_ws.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"transports_ws.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_ws.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAaH,OAAO,KAAK,EAGX,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,SAAS,EAAE,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAKrE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;IAC5E,iBAAiB,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;CACnE;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IAClE,OAAO,EAAE,CACR,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE;QAAC,MAAM,CAAC,EAAE,WAAW,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,EAAE,CAAC,EAAE,gBAAgB,CAAA;KAAC,KACpE,OAAO,CAAC,OAAO,CAAC,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,qBAAa,0BAA2B,YAAW,SAAS;;IAC3D,QAAQ,CAAC,cAAc,EAAG,wBAAwB,CAAU;gBAOhD,UAAU,EAAE,sBAAsB,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC;IAkDtF,IAAI,CACT,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,sBAAsB,CAAC;IAC5B,IAAI,CACT,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA0DvC,QAAQ,IAAI,OAAO;IAInB;;;;;;OAMG;IACH,OAAO,IAAI,IAAI;CAUf"}
|
|
@@ -5,20 +5,28 @@
|
|
|
5
5
|
* and `AbortSignal`-driven cancel to the underlying connection (the
|
|
6
6
|
* canonical implementation is `FrontendWebsocketClient`). The transport's
|
|
7
7
|
* own job is the `Transport` contract: route inbound server-pushed
|
|
8
|
-
* messages into `peer.receive
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* messages into `peer.receive`, send the resulting response back over the
|
|
9
|
+
* socket (the server→client ActionPeer receive loop), and translate the
|
|
10
|
+
* connection's `Promise<R>`/`ThrownJsonrpcError` shape into
|
|
11
|
+
* `JsonrpcResponseOrError` envelopes. No parallel pending-request map.
|
|
12
|
+
*
|
|
13
|
+
* Inbound `peer/ping` requests are answered directly via the built-in
|
|
14
|
+
* `peer_ping_responder` — a protocol-liveness concern that works with zero
|
|
15
|
+
* consumer wiring, the same way the server runs the `heartbeat` echo.
|
|
11
16
|
*
|
|
12
17
|
* @module
|
|
13
18
|
*/
|
|
14
19
|
import { to_error_message } from '@fuzdev/fuz_util/error.ts';
|
|
15
20
|
import { ThrownJsonrpcError, jsonrpc_error_messages } from '../http/jsonrpc_errors.js';
|
|
16
21
|
import { is_jsonrpc_notification, is_jsonrpc_request, to_jsonrpc_message_id, to_jsonrpc_result, create_jsonrpc_response, create_jsonrpc_error_response, } from '../http/jsonrpc_helpers.js';
|
|
22
|
+
import { PEER_PING_METHOD, peer_ping_responder } from './peer_ping.js';
|
|
17
23
|
/**
|
|
18
24
|
* Thin adapter over `WebsocketRpcConnection` (canonical implementation:
|
|
19
25
|
* `FrontendWebsocketClient`). Routes inbound server-pushed requests and
|
|
20
|
-
* notifications into the supplied `receive` callback
|
|
21
|
-
*
|
|
26
|
+
* notifications into the supplied `receive` callback and sends the request
|
|
27
|
+
* response back over the socket; an inbound `peer/ping` is answered by the
|
|
28
|
+
* built-in responder before `receive`. Responses to requests *we* sent are
|
|
29
|
+
* owned by the connection's own `request()` pending map and are ignored here.
|
|
22
30
|
*/
|
|
23
31
|
export class FrontendWebsocketTransport {
|
|
24
32
|
transport_name = 'frontend_websocket_rpc';
|
|
@@ -35,7 +43,29 @@ export class FrontendWebsocketTransport {
|
|
|
35
43
|
this.#remove_message_handler = connection.add_message_handler(async (event) => {
|
|
36
44
|
try {
|
|
37
45
|
const data = JSON.parse(event.data);
|
|
38
|
-
if (is_jsonrpc_request(data)
|
|
46
|
+
if (is_jsonrpc_request(data)) {
|
|
47
|
+
// Built-in protocol responder — answer a server-initiated
|
|
48
|
+
// `peer/ping` liveness probe over the same socket with zero
|
|
49
|
+
// consumer wiring (the production twin of the cross-process
|
|
50
|
+
// test transport's echo responder). Without this the server's
|
|
51
|
+
// server→client `peer/ping` round-trip would always time out
|
|
52
|
+
// against a real frontend.
|
|
53
|
+
if (data.method === PEER_PING_METHOD) {
|
|
54
|
+
this.#connection.send(create_jsonrpc_response(data.id, peer_ping_responder(data.params)));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
// Any other server-initiated request: dispatch through the peer
|
|
58
|
+
// and send its response back over the socket — completing the
|
|
59
|
+
// server→client receive loop. (Previously the response was
|
|
60
|
+
// computed and dropped, so a consumer-handled server request
|
|
61
|
+
// never got a reply.)
|
|
62
|
+
const response = await this.#receive(data);
|
|
63
|
+
if (response !== null && typeof response === 'object') {
|
|
64
|
+
this.#connection.send(response);
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (is_jsonrpc_notification(data)) {
|
|
39
69
|
await this.#receive(data);
|
|
40
70
|
}
|
|
41
71
|
// Responses are owned by `connection.request()` — ignore here.
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { WSContext } from 'hono/ws';
|
|
8
8
|
import { type Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
9
|
-
import type { JsonrpcMessageFromServerToClient, JsonrpcNotification, JsonrpcRequest, JsonrpcResponseOrError, JsonrpcErrorResponse } from '../http/jsonrpc.js';
|
|
9
|
+
import type { JsonrpcMessageFromServerToClient, JsonrpcNotification, JsonrpcRequest, JsonrpcRequestParams, JsonrpcResponse, JsonrpcResponseOrError, JsonrpcErrorResponse } from '../http/jsonrpc.js';
|
|
10
10
|
import { type Transport, type TransportSendOptions } from './transports.js';
|
|
11
|
+
import { type PeerRequestOptions, type PeerRequestOutcome } from './peer_request.js';
|
|
11
12
|
/**
|
|
12
13
|
* Auth identity attached to a single WebSocket connection.
|
|
13
14
|
*
|
|
@@ -119,6 +120,38 @@ export declare class BackendWebsocketTransport implements FilterableBroadcastTra
|
|
|
119
120
|
* @returns the number of sockets the message was sent to
|
|
120
121
|
*/
|
|
121
122
|
send_to_account(account_id: Uuid, message: JsonrpcMessageFromServerToClient): number;
|
|
123
|
+
/**
|
|
124
|
+
* Initiate a JSON-RPC request to a single connected client and await its
|
|
125
|
+
* reply — the server→client request/response direction (ActionPeer).
|
|
126
|
+
*
|
|
127
|
+
* Sends `{jsonrpc, method, params, id}` to exactly the `connection_id`
|
|
128
|
+
* socket (never a broadcast) and registers a pending entry scoped to that
|
|
129
|
+
* connection. Resolves when the client's matching reply arrives (routed in
|
|
130
|
+
* via `resolve_peer_response`), the deadline elapses (`timeout`), the
|
|
131
|
+
* per-connection cap is hit (`too_many_in_flight`), or the socket closes
|
|
132
|
+
* (`connection_gone`). Never throws — every failure is a `PeerRequestError`.
|
|
133
|
+
*
|
|
134
|
+
* Delegates correlation to `#pending` (id allocation, deadline, cap, drain);
|
|
135
|
+
* this method owns only the socket lookup + the send. Server-issued ids are
|
|
136
|
+
* `s`-prefixed so a malicious client echoing a non-`s` id (or an id it chose
|
|
137
|
+
* for its own request) matches nothing.
|
|
138
|
+
*
|
|
139
|
+
* @returns the client's success `result`, or a `PeerRequestError`
|
|
140
|
+
* @mutates this - registers then clears an entry in `#pending`
|
|
141
|
+
*/
|
|
142
|
+
request_connection(connection_id: Uuid, method: string, params: JsonrpcRequestParams | undefined, options?: PeerRequestOptions): Promise<PeerRequestOutcome>;
|
|
143
|
+
/**
|
|
144
|
+
* Route an inbound client reply to the matching pending server→client
|
|
145
|
+
* request on `connection_id` (delegates to `#pending.resolve`).
|
|
146
|
+
*
|
|
147
|
+
* Returns `false` when no entry matches — an unsolicited, cross-connection,
|
|
148
|
+
* or already-settled reply — so the caller drops it. Per-connection scoping
|
|
149
|
+
* means a reply arriving on the wrong socket resolves nothing.
|
|
150
|
+
*
|
|
151
|
+
* @returns whether a pending request was resolved
|
|
152
|
+
* @mutates this - clears the matched entry from `#pending`
|
|
153
|
+
*/
|
|
154
|
+
resolve_peer_response(connection_id: Uuid, response: JsonrpcResponse | JsonrpcErrorResponse): boolean;
|
|
122
155
|
is_ready(): boolean;
|
|
123
156
|
/**
|
|
124
157
|
* Number of currently tracked WebSocket connections.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transports_ws_backend.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_ws_backend.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAc,KAAK,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EAEX,gCAAgC,EAChC,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"transports_ws_backend.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_ws_backend.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAc,KAAK,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EAEX,gCAAgC,EAChC,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EAA2B,KAAK,SAAS,EAAE,KAAK,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AACpG,OAAO,EAEN,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,MAAM,mBAAmB,CAAC;AAI3B;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IAClC,sEAAsE;IACtE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,4CAA4C;IAC5C,UAAU,EAAE,IAAI,CAAC;IACjB,sEAAsE;IACtE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,4BAA6B,SAAQ,SAAS;IAC9D,kBAAkB,EAAE,CACnB,OAAO,EAAE,gCAAgC,EACzC,SAAS,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,OAAO,KAChD,MAAM,CAAC;CACZ;AAED,qDAAqD;AACrD,eAAO,MAAM,iCAAiC,GAC7C,WAAW,SAAS,KAClB,SAAS,IAAI,4BAEqE,CAAC;AAEtF,qBAAa,yBAA0B,YAAW,4BAA4B;;IAC7E,QAAQ,CAAC,cAAc,EAAG,uBAAuB,CAAU;IAiB3D;;;;;;;;;;;;OAYG;IACH,cAAc,CACb,EAAE,EAAE,SAAS,EACb,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,UAAU,EAAE,IAAI,EAChB,YAA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error.ts';
|
|
8
8
|
import { create_uuid } from '@fuzdev/fuz_util/id.ts';
|
|
9
9
|
import { jsonrpc_error_messages } from '../http/jsonrpc_errors.js';
|
|
10
|
-
import { create_jsonrpc_error_response, to_jsonrpc_message_id, is_jsonrpc_request, } from '../http/jsonrpc_helpers.js';
|
|
10
|
+
import { create_jsonrpc_error_response, create_jsonrpc_request, to_jsonrpc_message_id, is_jsonrpc_request, } from '../http/jsonrpc_helpers.js';
|
|
11
11
|
import { WS_CLOSE_SESSION_REVOKED } from './transports.js';
|
|
12
|
+
import { PendingPeerRequests, } from './peer_request.js';
|
|
12
13
|
/** Type guard for `FilterableBroadcastTransport`. */
|
|
13
14
|
export const is_filterable_broadcast_transport = (transport) => 'broadcast_filtered' in transport &&
|
|
14
15
|
typeof transport.broadcast_filtered === 'function';
|
|
@@ -21,6 +22,10 @@ export class BackendWebsocketTransport {
|
|
|
21
22
|
// Auth identity per connection. Adding a new identity scope (e.g.
|
|
22
23
|
// `device_id`) means adding a field here, not a new parallel map.
|
|
23
24
|
#connection_identities = new Map();
|
|
25
|
+
// Server→client request correlation (ActionPeer). The transport owns the
|
|
26
|
+
// sockets + the send; the registry owns the pending map, id allocation,
|
|
27
|
+
// deadlines, and the per-connection in-flight cap (see `peer_request.ts`).
|
|
28
|
+
#pending = new PendingPeerRequests();
|
|
24
29
|
/**
|
|
25
30
|
* Add a new WebSocket connection with auth info.
|
|
26
31
|
* Session connections pass a token hash for targeted revocation.
|
|
@@ -110,17 +115,18 @@ export class BackendWebsocketTransport {
|
|
|
110
115
|
this.#connections.delete(connection_id);
|
|
111
116
|
this.#connection_ids.delete(ws);
|
|
112
117
|
this.#connection_identities.delete(connection_id);
|
|
118
|
+
// Wake any handler still awaiting a reply on this socket — the peer is
|
|
119
|
+
// gone, so the request can never complete.
|
|
120
|
+
this.#pending.drain(connection_id);
|
|
113
121
|
}
|
|
114
122
|
#revoke_connection(connection_id, ws) {
|
|
115
123
|
this.#cleanup_connection(connection_id, ws);
|
|
116
124
|
ws.close(WS_CLOSE_SESSION_REVOKED, 'Session revoked');
|
|
117
125
|
}
|
|
118
126
|
async send(message, _options) {
|
|
119
|
-
// TODO currently just broadcasts all messages to all clients, the transport abstraction is still a WIP
|
|
120
127
|
if (is_jsonrpc_request(message)) {
|
|
121
|
-
return create_jsonrpc_error_response(message.id,
|
|
122
|
-
|
|
123
|
-
jsonrpc_error_messages.internal_error('TODO not yet implemented - backend WebSocket transport cannot send requests expecting responses yet'));
|
|
128
|
+
return create_jsonrpc_error_response(message.id, jsonrpc_error_messages.internal_error('backend WebSocket transport cannot broadcast a request expecting a response; ' +
|
|
129
|
+
'use request_connection(connection_id, ...) to target a single socket'));
|
|
124
130
|
}
|
|
125
131
|
try {
|
|
126
132
|
await this.#broadcast(message);
|
|
@@ -189,6 +195,57 @@ export class BackendWebsocketTransport {
|
|
|
189
195
|
send_to_account(account_id, message) {
|
|
190
196
|
return this.broadcast_filtered(message, (id) => id.account_id === account_id);
|
|
191
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* Initiate a JSON-RPC request to a single connected client and await its
|
|
200
|
+
* reply — the server→client request/response direction (ActionPeer).
|
|
201
|
+
*
|
|
202
|
+
* Sends `{jsonrpc, method, params, id}` to exactly the `connection_id`
|
|
203
|
+
* socket (never a broadcast) and registers a pending entry scoped to that
|
|
204
|
+
* connection. Resolves when the client's matching reply arrives (routed in
|
|
205
|
+
* via `resolve_peer_response`), the deadline elapses (`timeout`), the
|
|
206
|
+
* per-connection cap is hit (`too_many_in_flight`), or the socket closes
|
|
207
|
+
* (`connection_gone`). Never throws — every failure is a `PeerRequestError`.
|
|
208
|
+
*
|
|
209
|
+
* Delegates correlation to `#pending` (id allocation, deadline, cap, drain);
|
|
210
|
+
* this method owns only the socket lookup + the send. Server-issued ids are
|
|
211
|
+
* `s`-prefixed so a malicious client echoing a non-`s` id (or an id it chose
|
|
212
|
+
* for its own request) matches nothing.
|
|
213
|
+
*
|
|
214
|
+
* @returns the client's success `result`, or a `PeerRequestError`
|
|
215
|
+
* @mutates this - registers then clears an entry in `#pending`
|
|
216
|
+
*/
|
|
217
|
+
request_connection(connection_id, method, params, options) {
|
|
218
|
+
const ws = this.#connections.get(connection_id);
|
|
219
|
+
if (!ws)
|
|
220
|
+
return Promise.resolve({ ok: false, error: { kind: 'connection_gone' } });
|
|
221
|
+
const registered = this.#pending.register(connection_id, options?.timeout_ms);
|
|
222
|
+
if (!registered)
|
|
223
|
+
return Promise.resolve({ ok: false, error: { kind: 'too_many_in_flight' } });
|
|
224
|
+
const { id, outcome } = registered;
|
|
225
|
+
try {
|
|
226
|
+
ws.send(JSON.stringify(create_jsonrpc_request(method, params, id)));
|
|
227
|
+
}
|
|
228
|
+
catch {
|
|
229
|
+
// Send failed — the socket is gone; settle now so the caller isn't
|
|
230
|
+
// left awaiting until the deadline.
|
|
231
|
+
this.#pending.settle(connection_id, id, { ok: false, error: { kind: 'connection_gone' } });
|
|
232
|
+
}
|
|
233
|
+
return outcome;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Route an inbound client reply to the matching pending server→client
|
|
237
|
+
* request on `connection_id` (delegates to `#pending.resolve`).
|
|
238
|
+
*
|
|
239
|
+
* Returns `false` when no entry matches — an unsolicited, cross-connection,
|
|
240
|
+
* or already-settled reply — so the caller drops it. Per-connection scoping
|
|
241
|
+
* means a reply arriving on the wrong socket resolves nothing.
|
|
242
|
+
*
|
|
243
|
+
* @returns whether a pending request was resolved
|
|
244
|
+
* @mutates this - clears the matched entry from `#pending`
|
|
245
|
+
*/
|
|
246
|
+
resolve_peer_response(connection_id, response) {
|
|
247
|
+
return this.#pending.resolve(connection_id, response);
|
|
248
|
+
}
|
|
192
249
|
is_ready() {
|
|
193
250
|
return this.#connections.size > 0;
|
|
194
251
|
}
|
package/dist/auth/CLAUDE.md
CHANGED
|
@@ -20,7 +20,7 @@ documents the cross-cutting invariants that don't fit on any single symbol.
|
|
|
20
20
|
- **Route caps** — `RouteFactoryDeps` — `Omit<AppDeps, 'db'>`; handlers get `db` via `RouteContext`.
|
|
21
21
|
- **Action caps** — inline — action factories take `Pick<RouteFactoryDeps, 'log' | 'audit'>` (role-grant-offer adds `notification_sender?`).
|
|
22
22
|
- **Parameters** — `*Options` — static startup values, per-factory.
|
|
23
|
-
- **Runtime state** — inline ref — mutable values: `bootstrap_status`, `
|
|
23
|
+
- **Runtime state** — inline ref — mutable values: `bootstrap_status`, `DaemonTokenState`. NOT in deps or options.
|
|
24
24
|
|
|
25
25
|
`audit: AuditEmitter` is the bound emitter built once at backend assembly by
|
|
26
26
|
the consumer's `audit_factory` callback over `create_audit_emitter`; closes
|
|
@@ -157,7 +157,7 @@ Everything else listed under §RPC action surfaces.
|
|
|
157
157
|
- `auth/request_context.ts` — `RequestContext`, `resolve_acting_actor`, `build_request_context`, predicates (`has_role`, `has_scoped_role`, `has_any_scoped_role`), guards (`require_auth`, `require_role`, `require_credential_types`), `refresh_role_grants`.
|
|
158
158
|
- `auth/session_middleware.ts` — `process_session_cookie` integration, `create_session_and_set_cookie` (shared by login / signup / bootstrap).
|
|
159
159
|
- `auth/bearer_auth.ts` — soft-fail bearer middleware; rejects when `Origin` or `Referer` present (browser context).
|
|
160
|
-
- `auth/daemon_token_middleware.ts` — `start_daemon_token_rotation` + `create_daemon_token_middleware` (atomic file write, fail
|
|
160
|
+
- `auth/daemon_token_middleware.ts` — `start_daemon_token_rotation` + `create_daemon_token_middleware(state, deps, log)` (atomic file write, soft-fail validation, keeper account resolution). Soft-fails — discards the credential (pass-through, no own 401/503) on **every** non-success path: browser context (`Origin`/`Referer` present), malformed/invalid token, and valid-token-but-no-keeper all `next()` through to the dispatcher's `credential_type_required` (403) gate, mirroring the bearer guard and the Rust spine's `resolve.rs`. Daemon tokens are loopback-only, so browser context never arises in practice — the discard is defense-in-depth.
|
|
161
161
|
|
|
162
162
|
See root ../../../CLAUDE.md §Middleware Ordering for canonical assembly
|
|
163
163
|
order. The auth-specific invariants are described below in §Cross-cutting
|
|
@@ -375,8 +375,8 @@ in the HTTP RPC dispatcher (`actions/action_rpc.ts`), the WS dispatcher
|
|
|
375
375
|
|
|
376
376
|
### Migrations
|
|
377
377
|
|
|
378
|
-
Schema migrations live in `auth/migrations.ts` — two
|
|
379
|
-
`role_grant_offer_and_scoped_role_grants`) under the reserved
|
|
378
|
+
Schema migrations live in `auth/migrations.ts` — two migrations today (`full_auth_schema`,
|
|
379
|
+
`role_grant_offer_and_scoped_role_grants`) under the single reserved namespace
|
|
380
380
|
`AUTH_MIGRATION_NAMESPACE = 'fuz_auth'`. Consumer namespaces must avoid
|
|
381
381
|
`reserved_migration_namespaces`. Runner contract, error vocabulary, and
|
|
382
382
|
operator recipes (rename, mark applied, reset, baseline) are in
|
|
@@ -485,10 +485,10 @@ Closure state:
|
|
|
485
485
|
|
|
486
486
|
- `grantable_roles` derived once from `options.roles?.role_specs ?? builtin_role_specs_by_name`
|
|
487
487
|
via `list_roles_with_grant_path(_, GRANT_PATH_ADMIN)`.
|
|
488
|
-
- `
|
|
489
|
-
`
|
|
490
|
-
|
|
491
|
-
|
|
488
|
+
- `app_settings_get`/`_update` handlers are always wired and read/write the DB
|
|
489
|
+
directly (`query_app_settings_load`/`query_app_settings_update`);
|
|
490
|
+
`auth/signup_routes.ts` reads the current value fresh per request. There is no
|
|
491
|
+
`options.app_settings` ref.
|
|
492
492
|
- `options.connection_closer?` — handler-side eager WS close on
|
|
493
493
|
`admin_session_revoke_all` / `admin_token_revoke_all` BEFORE the audit
|
|
494
494
|
emit so revocation lands even on audit INSERT failure. Listener-based
|
|
@@ -625,18 +625,18 @@ arbitrary sockets.
|
|
|
625
625
|
`create_standard_rpc_actions(deps, options)` in `auth/standard_rpc_actions.ts`
|
|
626
626
|
spreads `create_admin_actions`, `create_role_grant_offer_actions`, and
|
|
627
627
|
`create_account_actions` into a single `Array<RpcAction>` — the canonical
|
|
628
|
-
fuz_app "standard" surface (
|
|
629
|
-
|
|
630
|
-
`auth/standard_action_specs.ts`.
|
|
628
|
+
fuz_app "standard" surface (28 actions: 14 admin + 7 role-grant-offer + 7
|
|
629
|
+
account; the two app-settings methods are always wired). Frontend mirror is
|
|
630
|
+
`all_standard_action_specs` in `auth/standard_action_specs.ts`.
|
|
631
631
|
|
|
632
632
|
Option routing — `roles` is shared between admin + role-grant-offer;
|
|
633
|
-
`
|
|
633
|
+
`default_ttl_ms` + `authorize` → role-grant-offer
|
|
634
634
|
only; `max_tokens` → account only; `connection_closer` → admin + account;
|
|
635
635
|
`notification_sender` → role-grant-offer only.
|
|
636
636
|
|
|
637
637
|
Pair with `create_app_server`'s `rpc_endpoints` factory form
|
|
638
638
|
`(ctx) => Array<RpcEndpointSpec>` so the combined action list gets
|
|
639
|
-
`ctx.deps
|
|
639
|
+
`ctx.deps`. `create_app_server` auto-mounts the
|
|
640
640
|
endpoint via `create_rpc_endpoint`. To expose the standard surface over
|
|
641
641
|
WebSocket as well, spread `protocol_actions` and the same factory into
|
|
642
642
|
`ws_endpoints` — per-message authorization and rate limiting fire
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor_lookup_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/actor_lookup_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAKtB;;;GAGG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,iEAAiE;AACjE,eAAO,MAAM,oBAAoB;;;;kBAI/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,gBAAgB;;
|
|
1
|
+
{"version":3,"file":"actor_lookup_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/actor_lookup_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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1
|
+
{"version":3,"file":"actor_search_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/actor_search_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAMtB;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,gDAAgD;AAChD,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,EAAG,6BAAsC,CAAC;AAExF,eAAO,MAAM,gBAAgB;;;;kBAyB3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,eAAO,MAAM,iBAAiB;;;;;;kBAE5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;CAcA,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;EAAsC,CAAC"}
|
|
@@ -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,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,2BAA2B,CAAC;AAiBzE,+BAA+B;AAC/B,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,8CAA8C;AAC9C,eAA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AM,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,OAAO,CAAC,EAC7C,UAAS,kBAAuB,KAC9B,KAAK,CAAC,SAAS,CAufjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_log_queries.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAGN,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,MAAM,uBAAuB,CAAC;AAa/B,iFAAiF;AACjF,eAAO,MAAM,sCAAsC,QAAO,MACvB,CAAC;AAEpC,0CAA0C;AAC1C,eAAO,MAAM,wCAAwC,QAAO,IAE3D,CAAC;AAYF,gFAAgF;AAChF,eAAO,MAAM,qCAAqC,QAAO,MACvB,CAAC;AAEnC,0CAA0C;AAC1C,eAAO,MAAM,uCAAuC,QAAO,IAE1D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,eAAe,GAAU,CAAC,SAAS,MAAM,EACrD,MAAM,SAAS,EACf,OAAO,aAAa,CAAC,CAAC,CAAC,EACvB,SAAQ,cAAyC,KAC/C,OAAO,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"audit_log_queries.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAGN,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,MAAM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|
+
{"version":3,"file":"bearer_auth.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/bearer_auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,MAAM,CAAC;AAC5C,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAIpD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAA+B,KAAK,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,6BAA6B,GACzC,MAAM,SAAS,EACf,iBAAiB,WAAW,GAAG,IAAI,EACnC,KAAK,MAAM,KACT,iBAgFF,CAAC"}
|
package/dist/auth/bearer_auth.js
CHANGED
|
@@ -18,6 +18,7 @@ import { DEV } from 'esm-env';
|
|
|
18
18
|
import { AUTH_API_TOKEN_ID_KEY, ACCOUNT_ID_KEY, CREDENTIAL_TYPE_KEY } from '../hono_context.js';
|
|
19
19
|
import { query_validate_api_token } from './api_token_queries.js';
|
|
20
20
|
import { get_client_ip } from '../http/client_ip.js';
|
|
21
|
+
import { is_browser_context } from '../http/origin.js';
|
|
21
22
|
import { rate_limit_exceeded_response } from '../rate_limiter.js';
|
|
22
23
|
/**
|
|
23
24
|
* Create middleware that authenticates via bearer token.
|
|
@@ -62,13 +63,11 @@ export const create_bearer_auth_middleware = (deps, ip_rate_limiter, log) => {
|
|
|
62
63
|
await next();
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
65
|
-
// Silently discard bearer tokens in browser context
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
// handle public actions or fall through to cookie auth.
|
|
71
|
-
if (c.req.header('Origin') !== undefined || c.req.header('Referer') !== undefined) {
|
|
66
|
+
// Silently discard bearer tokens in browser context (`is_browser_context`
|
|
67
|
+
// — Origin or Referer present). Discards rather than returning 403 so that
|
|
68
|
+
// the RPC dispatcher can still handle public actions or fall through to
|
|
69
|
+
// cookie auth.
|
|
70
|
+
if (is_browser_context(c)) {
|
|
72
71
|
log.debug('bearer auth rejected: browser context (Origin/Referer present)');
|
|
73
72
|
// The discard is silent on the wire by design (a stolen-token probe
|
|
74
73
|
// gets an indistinguishable 401, not a "your token was dropped"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap_routes.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/bootstrap_routes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAoB,KAAK,uBAAuB,EAAC,MAAM,wBAAwB,CAAC;AAEvF,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,aAAa,CAAC;AACpC,OAAO,EAAkB,KAAK,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EAA+B,KAAK,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAGnD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACrC,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,8EAA8E;IAC9E,gBAAgB,EAAE,eAAe,CAAC;IAClC;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,uBAAuB,EAAE,C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