@fuzdev/fuz_app 0.183.0 → 0.185.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 +538 -1223
- 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 +3 -2
- package/dist/actions/connection_closer.d.ts +11 -9
- package/dist/actions/connection_closer.d.ts.map +1 -1
- package/dist/actions/connection_closer.js +11 -9
- package/dist/actions/frontend_rpc_client.d.ts +1 -1
- package/dist/actions/register_action_ws.d.ts +21 -1
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +2 -1
- package/dist/actions/ws_socket_session.d.ts +25 -4
- package/dist/actions/ws_socket_session.d.ts.map +1 -1
- package/dist/actions/ws_socket_session.js +81 -25
- package/dist/auth/CLAUDE.md +433 -1048
- package/dist/auth/account_queries.d.ts +1 -1
- package/dist/auth/account_queries.js +1 -1
- package/dist/auth/account_routes.d.ts +4 -5
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +8 -10
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +10 -11
- package/dist/auth/api_token.d.ts +20 -3
- package/dist/auth/api_token.d.ts.map +1 -1
- package/dist/auth/api_token.js +28 -9
- package/dist/auth/api_token_queries.d.ts +2 -2
- package/dist/auth/api_token_queries.js +2 -2
- package/dist/auth/audit_log_routes.d.ts +1 -1
- package/dist/auth/audit_log_routes.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.js +3 -2
- package/dist/auth/audit_log_schema.d.ts +15 -9
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +1 -2
- package/dist/auth/auth_guard_resolver.d.ts +1 -1
- package/dist/auth/auth_guard_resolver.js +1 -1
- package/dist/auth/bearer_auth.d.ts +2 -5
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +4 -13
- package/dist/auth/bootstrap_account.d.ts +13 -15
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +9 -11
- package/dist/auth/bootstrap_routes.d.ts +20 -21
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +21 -19
- package/dist/auth/bootstrap_token_store.d.ts +3 -4
- package/dist/auth/bootstrap_token_store.d.ts.map +1 -1
- package/dist/auth/bootstrap_token_store.js +1 -1
- package/dist/auth/cleanup.d.ts +34 -3
- package/dist/auth/cleanup.d.ts.map +1 -1
- package/dist/auth/cleanup.js +11 -3
- package/dist/auth/daemon_token.d.ts +5 -1
- package/dist/auth/daemon_token.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.d.ts +12 -8
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +15 -21
- package/dist/auth/deps.d.ts +11 -0
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/invite_queries.d.ts +51 -3
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +81 -6
- package/dist/auth/invite_schema.d.ts +2 -1
- package/dist/auth/invite_schema.d.ts.map +1 -1
- package/dist/auth/middleware.d.ts +2 -3
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +3 -3
- package/dist/auth/request_context.d.ts +3 -3
- package/dist/auth/request_context.js +3 -3
- package/dist/auth/role_grant_offer_actions.d.ts +2 -2
- package/dist/auth/role_grant_offer_actions.js +2 -2
- package/dist/auth/session_cookie.d.ts +82 -174
- package/dist/auth/session_cookie.d.ts.map +1 -1
- package/dist/auth/session_cookie.js +80 -130
- package/dist/auth/session_middleware.d.ts +8 -17
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_middleware.js +14 -23
- package/dist/auth/session_queries.d.ts +9 -14
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +8 -9
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +4 -6
- package/dist/db/CLAUDE.md +5 -3
- package/dist/dev/setup.d.ts +3 -1
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +3 -1
- package/dist/http/CLAUDE.md +315 -768
- package/dist/http/db_routes.d.ts +1 -1
- package/dist/http/db_routes.js +1 -1
- package/dist/http/origin.d.ts +7 -8
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +7 -8
- package/dist/http/pending_effects.d.ts +82 -4
- package/dist/http/pending_effects.d.ts.map +1 -1
- package/dist/http/pending_effects.js +82 -4
- package/dist/http/route_result.d.ts +1 -1
- package/dist/http/route_spec.d.ts +17 -14
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/realtime/audit_log_sse.d.ts +1 -1
- package/dist/realtime/sse.d.ts +6 -25
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +4 -25
- package/dist/realtime/sse_constants.d.ts +1 -1
- package/dist/realtime/sse_constants.js +1 -1
- package/dist/server/app_backend.d.ts +4 -5
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +3 -1
- package/dist/server/app_server.d.ts +87 -76
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +111 -91
- package/dist/server/app_server_context.d.ts +1 -2
- package/dist/server/app_server_context.d.ts.map +1 -1
- package/dist/server/env.js +2 -2
- package/dist/server/shutdown_drain.d.ts +69 -0
- package/dist/server/shutdown_drain.d.ts.map +1 -0
- package/dist/server/shutdown_drain.js +77 -0
- package/dist/testing/CLAUDE.md +89 -57
- package/dist/testing/admin_integration.d.ts +4 -5
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +39 -23
- package/dist/testing/app_server.d.ts +3 -8
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +10 -9
- package/dist/testing/attack_surface.d.ts +1 -1
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/audit_completeness.d.ts +2 -3
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +1 -1
- package/dist/testing/cross_backend/bootstrap_backend.d.ts +3 -1
- package/dist/testing/cross_backend/bootstrap_backend.d.ts.map +1 -1
- package/dist/testing/cross_backend/bootstrap_backend.js +5 -1
- package/dist/testing/cross_backend/capability_mounts.d.ts.map +1 -1
- package/dist/testing/cross_backend/capability_mounts.js +16 -11
- package/dist/testing/cross_backend/conformance_table.d.ts +5 -6
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +4 -4
- package/dist/testing/cross_backend/cookie_attributes.js +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +10 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.js +33 -7
- package/dist/testing/cross_backend/default_backend_configs.d.ts +3 -3
- package/dist/testing/cross_backend/default_spine_surface.d.ts +0 -6
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +4 -9
- package/dist/testing/cross_backend/differential.d.ts +2 -3
- package/dist/testing/cross_backend/differential.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential.js +1 -1
- package/dist/testing/cross_backend/full_spine_mount.d.ts +1 -42
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +45 -4
- package/dist/testing/cross_backend/in_process_setup.d.ts +7 -8
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.js +10 -13
- package/dist/testing/cross_backend/rpc_success_fixtures.d.ts.map +1 -1
- package/dist/testing/cross_backend/rpc_success_fixtures.js +2 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +3 -4
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.js +2 -2
- package/dist/testing/cross_backend/setup.d.ts +1 -1
- package/dist/testing/cross_backend/spawn_backend.d.ts +14 -0
- package/dist/testing/cross_backend/spawn_backend.d.ts.map +1 -1
- package/dist/testing/cross_backend/spawn_backend.js +56 -8
- package/dist/testing/cross_backend/spine_suites.d.ts +18 -16
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +38 -18
- package/dist/testing/cross_backend/standard.d.ts +19 -84
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.js +8 -23
- package/dist/testing/cross_backend/standard_auth.d.ts +74 -0
- package/dist/testing/cross_backend/standard_auth.d.ts.map +1 -0
- package/dist/testing/cross_backend/standard_auth.js +28 -0
- package/dist/testing/cross_backend/standard_bundle.d.ts +48 -0
- package/dist/testing/cross_backend/standard_bundle.d.ts.map +1 -0
- package/dist/testing/cross_backend/standard_bundle.js +43 -0
- package/dist/testing/cross_backend/testing_credential_read.d.ts +10 -11
- package/dist/testing/cross_backend/testing_credential_read.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_credential_read.js +12 -12
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +46 -30
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +52 -31
- package/dist/testing/cross_backend/testing_server_bun.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_bun.js +5 -4
- package/dist/testing/cross_backend/testing_server_core.d.ts +16 -3
- package/dist/testing/cross_backend/testing_server_core.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_core.js +22 -7
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +6 -2
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +7 -3
- package/dist/testing/daemon_token_rotation.d.ts.map +1 -1
- package/dist/testing/daemon_token_rotation.js +2 -3
- package/dist/testing/error_coverage.d.ts +5 -0
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +2 -1
- package/dist/testing/integration.d.ts +6 -23
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +53 -83
- package/dist/testing/integration_helpers.d.ts +16 -0
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +29 -1
- package/dist/testing/middleware_gate_probes.d.ts +55 -1
- package/dist/testing/middleware_gate_probes.d.ts.map +1 -1
- package/dist/testing/middleware_gate_probes.js +69 -3
- package/dist/testing/rate_limiting.d.ts +2 -3
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +3 -3
- package/dist/testing/rpc_helpers.d.ts +1 -2
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +3 -3
- package/dist/testing/rpc_round_trip.d.ts +2 -3
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +1 -1
- package/dist/testing/sse_round_trip.d.ts +2 -3
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +2 -2
- package/dist/testing/stubs.d.ts +5 -6
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +10 -8
- package/dist/testing/test_app.d.ts +8 -5
- package/dist/testing/test_app.d.ts.map +1 -1
- package/dist/testing/test_app.js +7 -7
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +3 -0
- package/dist/ui/ui_format.d.ts.map +1 -1
- package/dist/ui/ui_format.js +1 -2
- package/package.json +1 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
2
|
import type { RouteMethod, RouteSpec } from '../http/route_spec.js';
|
|
3
|
+
import type { AppSurfaceSpec } from '../http/surface.js';
|
|
3
4
|
import { type RouteErrorMap } from '../http/route_errors.js';
|
|
4
5
|
import { type RestErrorDef } from '../http/error_schemas.js';
|
|
5
|
-
import
|
|
6
|
+
import { ErrorCoverageCollector } from './error_coverage.js';
|
|
7
|
+
import { type RpcEndpointsSuiteOption } from './rpc_helpers.js';
|
|
8
|
+
import type { SetupTest } from './cross_backend/setup.js';
|
|
6
9
|
/** The `Origin` the origin probe sends — no allowlist names it. */
|
|
7
10
|
export declare const GATE_PROBE_FOREIGN_ORIGIN = "https://gate-probe.invalid";
|
|
8
11
|
/** The `Host` the host probe sends — neither loopback nor named by an allowed origin. */
|
|
@@ -87,4 +90,55 @@ export declare const send_middleware_gate_probe: (probe: MiddlewareGateProbe, ba
|
|
|
87
90
|
* declared refusal, or its body is off the route's map
|
|
88
91
|
*/
|
|
89
92
|
export declare const assert_middleware_gate_refusal: (probe: MiddlewareGateProbe, response: Response, collector: ErrorCoverageCollector, route_specs: Array<RouteSpec>) => Promise<void>;
|
|
93
|
+
/** Configuration for `describe_middleware_gate_tests`. */
|
|
94
|
+
export interface MiddlewareGateTestOptions {
|
|
95
|
+
/**
|
|
96
|
+
* Per-test fixture-producing function. Read in-process only, once, for the
|
|
97
|
+
* transport every probe shares; over a socket the probes need no fixture.
|
|
98
|
+
*/
|
|
99
|
+
setup_test: SetupTest;
|
|
100
|
+
/** App surface: the counted routes and their error maps, middleware included. */
|
|
101
|
+
surface_source: AppSurfaceSpec;
|
|
102
|
+
/** The session cookie's name, to resolve factory-form `rpc_endpoints` at setup. */
|
|
103
|
+
session_cookie_name: string;
|
|
104
|
+
/** RPC endpoint specs — the endpoint's path is a counted route. */
|
|
105
|
+
rpc_endpoints: RpcEndpointsSuiteOption;
|
|
106
|
+
/**
|
|
107
|
+
* Base URL the backend is reachable at, or `null` in-process. Over a socket
|
|
108
|
+
* the probes write their heads to it (`fetch` replaces a caller's `Host` and
|
|
109
|
+
* `Content-Length`); in-process they go through the fixture's transport.
|
|
110
|
+
*/
|
|
111
|
+
base_url: string | null;
|
|
112
|
+
/**
|
|
113
|
+
* The backend's request-body cap on every counted route but the RPC
|
|
114
|
+
* endpoint, in bytes — the body-limit probe declares one byte more.
|
|
115
|
+
*
|
|
116
|
+
* @default SPINE_BODY_LIMIT_DEFAULT_BYTES
|
|
117
|
+
*/
|
|
118
|
+
max_body_bytes?: number;
|
|
119
|
+
/**
|
|
120
|
+
* The backend's request-body cap on the RPC endpoint, in bytes, when it
|
|
121
|
+
* isn't `max_body_bytes`.
|
|
122
|
+
*/
|
|
123
|
+
rpc_max_body_bytes?: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* One test per middleware gate each route the standard integration suite
|
|
127
|
+
* counts declares in its error map (`plan_middleware_gate_probes`): the origin
|
|
128
|
+
* check, the host gate, the body limit, and in-process the unreadable length.
|
|
129
|
+
* Each probe is a bodiless head with no credential that the gate refuses
|
|
130
|
+
* before auth, rate limiting or body parsing, so the probes leave no state; a
|
|
131
|
+
* gate a route's map doesn't declare (a carve-out, a backend without the
|
|
132
|
+
* layer) gets no probe. Each refusal's body is held to the route's map.
|
|
133
|
+
*
|
|
134
|
+
* Every gate refusal (`MIDDLEWARE_GATE_ERROR_CODES`) a counted route declares
|
|
135
|
+
* must have a planned probe — the unreadable length aside over a socket — or
|
|
136
|
+
* the call throws at collection, so a planner that drops a probe can't pass by
|
|
137
|
+
* registering fewer tests, whatever a run filters or excludes.
|
|
138
|
+
*
|
|
139
|
+
* @param options - the routes, the backend's socket and its caps
|
|
140
|
+
* @throws Error at setup when `options.rpc_endpoints` names no single endpoint,
|
|
141
|
+
* or a declared gate refusal has no planned probe
|
|
142
|
+
*/
|
|
143
|
+
export declare const describe_middleware_gate_tests: (options: MiddlewareGateTestOptions) => void;
|
|
90
144
|
//# sourceMappingURL=middleware_gate_probes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware_gate_probes.d.ts","sourceRoot":"","sources":["../../src/lib/testing/middleware_gate_probes.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"middleware_gate_probes.d.ts","sourceRoot":"","sources":["../../src/lib/testing/middleware_gate_probes.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAqC7B,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAElF,OAAO,EAKN,KAAK,YAAY,EACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAK7D,OAAO,EAGN,KAAK,uBAAuB,EAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAK1D,mEAAmE;AACnE,eAAO,MAAM,yBAAyB,+BAA+B,CAAC;AAEtE,yFAAyF;AACzF,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAE5D,8DAA8D;AAC9D,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAE3D,qFAAqF;AACrF,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,6DAA6D;IAC7D,QAAQ,CAAC,cAAc,EAAE,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AAyB;IACzC;;;OAGG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB,iFAAiF;IACjF,cAAc,EAAE,cAAc,CAAC;IAC/B,mFAAmF;IACnF,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mEAAmE;IACnE,aAAa,EAAE,uBAAuB,CAAC;IACvC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,8BAA8B,GAAI,SAAS,yBAAyB,KAAG,IAmDnF,CAAC"}
|
|
@@ -23,15 +23,21 @@ import './assert_dev_env.js';
|
|
|
23
23
|
* the answer a Bun server gives when a request repeats an equal
|
|
24
24
|
* `Content-Length`, which Bun hands over joined into one value.
|
|
25
25
|
*
|
|
26
|
-
* `
|
|
27
|
-
*
|
|
26
|
+
* `describe_middleware_gate_tests` runs one per declared gate of each route
|
|
27
|
+
* the standard integration suite counts (`is_standard_integration_route`). It
|
|
28
|
+
* is a suite of its own, not a group of that one, because over a socket it
|
|
29
|
+
* writes raw heads: the suites that send only through the fixture transports
|
|
30
|
+
* stay free of a raw-socket sender.
|
|
28
31
|
*
|
|
29
32
|
* @module
|
|
30
33
|
*/
|
|
31
|
-
import { assert } from 'vitest';
|
|
34
|
+
import { assert, describe, test } from 'vitest';
|
|
32
35
|
import { get_route_error_map } from '../http/route_errors.js';
|
|
33
36
|
import { split_route_template } from '../http/route_error_check.js';
|
|
34
37
|
import { REST_FORBIDDEN_HOST, REST_FORBIDDEN_ORIGIN, REST_INVALID_CONTENT_LENGTH, REST_PAYLOAD_TOO_LARGE } from '../http/error_schemas.js';
|
|
38
|
+
import { ErrorCoverageCollector } from './error_coverage.js';
|
|
39
|
+
import { is_standard_integration_route, MIDDLEWARE_GATE_ERROR_CODES } from './integration_helpers.js';
|
|
40
|
+
import { require_rpc_endpoint_path, resolve_rpc_endpoints_for_setup } from './rpc_helpers.js';
|
|
35
41
|
import { to_route_content_type } from './schema_generators.js';
|
|
36
42
|
import { raw_http_send_head } from './transports/raw_http.js';
|
|
37
43
|
import { SPINE_BODY_LIMIT_DEFAULT_BYTES } from './cross_backend/spine_surface_constants.js';
|
|
@@ -177,3 +183,63 @@ export const assert_middleware_gate_refusal = async (probe, response, collector,
|
|
|
177
183
|
assert.strictEqual(body?.error, probe.expected.code, `${label}: answered ${JSON.stringify(body)}`);
|
|
178
184
|
await collector.assert_and_record(route_specs, probe.method, probe.path, response);
|
|
179
185
|
};
|
|
186
|
+
/**
|
|
187
|
+
* One test per middleware gate each route the standard integration suite
|
|
188
|
+
* counts declares in its error map (`plan_middleware_gate_probes`): the origin
|
|
189
|
+
* check, the host gate, the body limit, and in-process the unreadable length.
|
|
190
|
+
* Each probe is a bodiless head with no credential that the gate refuses
|
|
191
|
+
* before auth, rate limiting or body parsing, so the probes leave no state; a
|
|
192
|
+
* gate a route's map doesn't declare (a carve-out, a backend without the
|
|
193
|
+
* layer) gets no probe. Each refusal's body is held to the route's map.
|
|
194
|
+
*
|
|
195
|
+
* Every gate refusal (`MIDDLEWARE_GATE_ERROR_CODES`) a counted route declares
|
|
196
|
+
* must have a planned probe — the unreadable length aside over a socket — or
|
|
197
|
+
* the call throws at collection, so a planner that drops a probe can't pass by
|
|
198
|
+
* registering fewer tests, whatever a run filters or excludes.
|
|
199
|
+
*
|
|
200
|
+
* @param options - the routes, the backend's socket and its caps
|
|
201
|
+
* @throws Error at setup when `options.rpc_endpoints` names no single endpoint,
|
|
202
|
+
* or a declared gate refusal has no planned probe
|
|
203
|
+
*/
|
|
204
|
+
export const describe_middleware_gate_tests = (options) => {
|
|
205
|
+
const route_specs = options.surface_source.route_specs;
|
|
206
|
+
const rpc_path = require_rpc_endpoint_path(resolve_rpc_endpoints_for_setup(options.rpc_endpoints, options.session_cookie_name));
|
|
207
|
+
const counted_routes = route_specs.filter((s) => is_standard_integration_route(s, rpc_path));
|
|
208
|
+
const probes = plan_middleware_gate_probes({
|
|
209
|
+
route_specs: counted_routes,
|
|
210
|
+
route_error_maps: options.surface_source.route_error_maps,
|
|
211
|
+
base_url: options.base_url,
|
|
212
|
+
max_body_bytes: options.max_body_bytes,
|
|
213
|
+
rpc_path,
|
|
214
|
+
rpc_max_body_bytes: options.rpc_max_body_bytes
|
|
215
|
+
});
|
|
216
|
+
// every gate refusal a counted route declares has a probe planned — checked
|
|
217
|
+
// at collection, so a planner that drops one fails whatever a run filters or
|
|
218
|
+
// excludes; the unreadable length goes unprobed over a socket (the module doc)
|
|
219
|
+
const planned = new Set(probes.map((p) => `${p.method} ${p.path} ${p.expected.status} ${p.expected.code}`));
|
|
220
|
+
const unplanned = new ErrorCoverageCollector(options.surface_source.route_error_maps)
|
|
221
|
+
.uncovered(counted_routes)
|
|
222
|
+
.filter(({ code }) => MIDDLEWARE_GATE_ERROR_CODES.includes(code) &&
|
|
223
|
+
!(options.base_url !== null && code === REST_INVALID_CONTENT_LENGTH.code))
|
|
224
|
+
.map(({ method, path, status, code }) => `${method} ${path} ${status} ${code}`)
|
|
225
|
+
.filter((key) => !planned.has(key));
|
|
226
|
+
if (unplanned.length > 0) {
|
|
227
|
+
throw new Error(`describe_middleware_gate_tests: declared gate refusals no probe plans: ${unplanned.join(', ')}`);
|
|
228
|
+
}
|
|
229
|
+
describe('middleware gates', () => {
|
|
230
|
+
const collector = new ErrorCoverageCollector(options.surface_source.route_error_maps);
|
|
231
|
+
// in-process the probes share one fixture's transport, made by the first
|
|
232
|
+
// to run; over a socket they need none, as they read and write no state
|
|
233
|
+
let in_process_transport = null;
|
|
234
|
+
const get_transport = () => (in_process_transport ??= options
|
|
235
|
+
.setup_test()
|
|
236
|
+
.then((fixture) => fixture.fresh_transport({ origin: null })));
|
|
237
|
+
for (const probe of probes) {
|
|
238
|
+
test(format_middleware_gate_probe(probe), async () => {
|
|
239
|
+
const transport = options.base_url === null ? await get_transport() : null;
|
|
240
|
+
const res = await send_middleware_gate_probe(probe, options.base_url, transport);
|
|
241
|
+
await assert_middleware_gate_refusal(probe, res, collector, route_specs);
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
|
-
import type { SessionOptions } from '../auth/session_cookie.js';
|
|
3
2
|
import type { AppServerContext } from '../server/app_server_context.js';
|
|
4
3
|
import type { RouteSpec } from '../http/route_spec.js';
|
|
5
4
|
import { type SuiteAppOptions } from './test_app.js';
|
|
@@ -9,8 +8,8 @@ import type { RpcEndpointsSuiteOption } from './rpc_helpers.js';
|
|
|
9
8
|
* Configuration for `describe_rate_limiting_tests`.
|
|
10
9
|
*/
|
|
11
10
|
export interface RateLimitingTestOptions {
|
|
12
|
-
/**
|
|
13
|
-
|
|
11
|
+
/** The session cookie's name. */
|
|
12
|
+
session_cookie_name: string;
|
|
14
13
|
/** Route spec factory — same one used in production. */
|
|
15
14
|
create_route_specs: (ctx: AppServerContext) => Array<RouteSpec>;
|
|
16
15
|
/** Optional overrides for `AppServerOptions`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate_limiting.d.ts","sourceRoot":"","sources":["../../src/lib/testing/rate_limiting.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AA2B7B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"rate_limiting.d.ts","sourceRoot":"","sources":["../../src/lib/testing/rate_limiting.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AA2B7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIvD,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,EAGN,KAAK,SAAS,EACd,MAAM,SAAS,CAAC;AAGjB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAIhE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,iCAAiC;IACjC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,wDAAwD;IACxD,kBAAkB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,iDAAiD;IACjD,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACxC;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4BAA4B,GAAI,SAAS,uBAAuB,KAAG,IA2J/E,CAAC"}
|
|
@@ -7,7 +7,7 @@ import './assert_dev_env.js';
|
|
|
7
7
|
* (2 attempts / 1 minute) and fire requests until 429 is returned.
|
|
8
8
|
*
|
|
9
9
|
* Consumers call `describe_rate_limiting_tests` with their route factory and
|
|
10
|
-
* session
|
|
10
|
+
* session cookie name — rate limit enforcement tests come for free.
|
|
11
11
|
*
|
|
12
12
|
* Each test body constructs its own `TestApp` with a per-test rate limiter
|
|
13
13
|
* override in `app_options`, so this suite reads its inputs directly from
|
|
@@ -63,7 +63,7 @@ export const describe_rate_limiting_tests = (options) => {
|
|
|
63
63
|
const login_ip_rate_limiter = create_test_rate_limiter();
|
|
64
64
|
try {
|
|
65
65
|
const test_app = await create_test_app({
|
|
66
|
-
|
|
66
|
+
session_cookie_name: options.session_cookie_name,
|
|
67
67
|
create_route_specs: options.create_route_specs,
|
|
68
68
|
db: get_db(),
|
|
69
69
|
rpc_endpoints: options.rpc_endpoints,
|
|
@@ -111,7 +111,7 @@ export const describe_rate_limiting_tests = (options) => {
|
|
|
111
111
|
const login_account_rate_limiter = create_test_rate_limiter();
|
|
112
112
|
try {
|
|
113
113
|
const test_app = await create_test_app({
|
|
114
|
-
|
|
114
|
+
session_cookie_name: options.session_cookie_name,
|
|
115
115
|
create_route_specs: options.create_route_specs,
|
|
116
116
|
db: get_db(),
|
|
117
117
|
rpc_endpoints: options.rpc_endpoints,
|
|
@@ -5,7 +5,6 @@ import type { RequestResponseActionSpec } from '../actions/action_spec.js';
|
|
|
5
5
|
import type { RpcAction } from '../actions/action_types.js';
|
|
6
6
|
import type { AppSurfaceRpcEndpoint, AppSurfaceRpcMethod, RpcEndpointSpec } from '../http/surface.js';
|
|
7
7
|
import type { AppServerContext } from '../server/app_server_context.js';
|
|
8
|
-
import type { SessionOptions } from '../auth/session_cookie.js';
|
|
9
8
|
/**
|
|
10
9
|
* Union accepted by the suite-level `rpc_endpoints` option — eager array or
|
|
11
10
|
* a factory that takes an `AppServerContext` and returns endpoint specs. The
|
|
@@ -39,7 +38,7 @@ export type RpcEndpointsSuiteOption = Array<RpcEndpointSpec> | ((ctx: AppServerC
|
|
|
39
38
|
* @throws Error if the factory's two stub-ctx invocations produce different
|
|
40
39
|
* `(path, method-list)` shapes — surfaces non-pure factories at setup time.
|
|
41
40
|
*/
|
|
42
|
-
export declare const resolve_rpc_endpoints_for_setup: (rpc_endpoints: RpcEndpointsSuiteOption,
|
|
41
|
+
export declare const resolve_rpc_endpoints_for_setup: (rpc_endpoints: RpcEndpointsSuiteOption, session_cookie_name: string) => Array<RpcEndpointSpec>;
|
|
43
42
|
/**
|
|
44
43
|
* Create a `RequestInit` for a JSON-RPC POST request.
|
|
45
44
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc_helpers.d.ts","sourceRoot":"","sources":["../../src/lib/testing/rpc_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,EAAa,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,KAAK,SAAS,EAAE,MA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cG;AACH,eAAO,MAAM,iBAAiB,GAAU,KAAK,SAAS,yBAAyB,EAC9E,MAAM,kBAAkB,CAAC,KAAK,CAAC,KAC7B,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAoBrC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GAAU,CAAC,EACrC,MAAM,WAAW,EACjB,eAAe,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,KAC3B,OAAO,CAAC,CAAC,CAkBX,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC3B,eAAe,aAAa,CAAC,eAAe,CAAC,EAC7C,QAAQ,MAAM,KACZ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GAAG,SAOxC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC3B,eAAe,aAAa,CAAC,qBAAqB,CAAC,EACnD,QAAQ,MAAM,KACZ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,mBAAmB,CAAA;CAAE,GAAG,SAOvD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,yBAAyB,GACrC,eAAe,aAAa,CAAC,eAAe,CAAC,KAC3C,MAcF,CAAC"}
|
|
@@ -35,11 +35,11 @@ import { TEST_ORIGIN } from './test_origin.js';
|
|
|
35
35
|
* @throws Error if the factory's two stub-ctx invocations produce different
|
|
36
36
|
* `(path, method-list)` shapes — surfaces non-pure factories at setup time.
|
|
37
37
|
*/
|
|
38
|
-
export const resolve_rpc_endpoints_for_setup = (rpc_endpoints,
|
|
38
|
+
export const resolve_rpc_endpoints_for_setup = (rpc_endpoints, session_cookie_name) => {
|
|
39
39
|
if (typeof rpc_endpoints !== 'function')
|
|
40
40
|
return rpc_endpoints;
|
|
41
|
-
const first = rpc_endpoints(create_stub_app_server_context(
|
|
42
|
-
const second = rpc_endpoints(create_stub_app_server_context(
|
|
41
|
+
const first = rpc_endpoints(create_stub_app_server_context(session_cookie_name));
|
|
42
|
+
const second = rpc_endpoints(create_stub_app_server_context(session_cookie_name));
|
|
43
43
|
const summarize = (eps) => JSON.stringify(eps
|
|
44
44
|
.map((ep) => ({
|
|
45
45
|
path: ep.path,
|
|
@@ -4,7 +4,6 @@ import type { AppSurfaceSpec, AppSurfaceRpcMethod } from '../http/surface.js';
|
|
|
4
4
|
import { type RpcEndpointsSuiteOption } from './rpc_helpers.js';
|
|
5
5
|
import { type AuthPrincipal, type KeeperHeaderProvider } from './integration_helpers.js';
|
|
6
6
|
import type { SetupTest, TestFixture } from './cross_backend/setup.js';
|
|
7
|
-
import type { SessionOptions } from '../auth/session_cookie.js';
|
|
8
7
|
/** Options for `describe_rpc_round_trip_tests`. */
|
|
9
8
|
export interface RpcRoundTripTestOptions {
|
|
10
9
|
/** Per-test fixture-producing function (per-describe cadence). */
|
|
@@ -16,12 +15,12 @@ export interface RpcRoundTripTestOptions {
|
|
|
16
15
|
*/
|
|
17
16
|
surface_source: AppSurfaceSpec;
|
|
18
17
|
/**
|
|
19
|
-
*
|
|
18
|
+
* The session cookie's name — only needed to resolve factory-form `rpc_endpoints`
|
|
20
19
|
* against a stub `AppServerContext` at setup time (the actions' input
|
|
21
20
|
* schemas drive params generation; auth/dispatch run against the real
|
|
22
21
|
* backend through the fixture's transports).
|
|
23
22
|
*/
|
|
24
|
-
|
|
23
|
+
session_cookie_name: string;
|
|
25
24
|
/**
|
|
26
25
|
* RPC endpoint specs — eager array or factory. The factory must return
|
|
27
26
|
* the same endpoint `path` + `spec.method` list regardless of ctx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc_round_trip.d.ts","sourceRoot":"","sources":["../../src/lib/testing/rpc_round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AA0C7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,mBA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BAAqB;IACrC,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,0GAA0G;AAC1G,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEzF,0GAA0G;AAC1G,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAEhE,oEAAoE;AACpE,MAAM,WAAW,gBAAgB;IAChC,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GACzB,QAAQ,mBAAmB,EAC3B,QAAQ,oBAAoB,EAC5B,gBAAgB,WAAW,EAC3B,eAAe,WAAW,KACxB,gBAMF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,wBAAwB,GACpC,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,MAAM,OAAO,EACb,WAAW,aAAa,KACtB,IAwBF,CAAC;AA8GF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,6BAA6B,GAAI,SAAS,uBAAuB,KAAG,IAuKhF,CAAC"}
|
|
@@ -210,7 +210,7 @@ export const describe_rpc_round_trip_tests = (options) => {
|
|
|
210
210
|
// whatever the backend was started with — `action.spec.method` /
|
|
211
211
|
// `.input` / `.output` are ctx-independent, so the stub-resolved specs
|
|
212
212
|
// match what the running backend serves.
|
|
213
|
-
const rpc_endpoints_for_setup = resolve_rpc_endpoints_for_setup(options.rpc_endpoints, options.
|
|
213
|
+
const rpc_endpoints_for_setup = resolve_rpc_endpoints_for_setup(options.rpc_endpoints, options.session_cookie_name);
|
|
214
214
|
const surface_rpc_endpoints = options.surface_source.surface.rpc_endpoints;
|
|
215
215
|
describe('RPC round-trip validation', () => {
|
|
216
216
|
let fixture;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
2
|
import type { RouteSpec } from '../http/route_spec.js';
|
|
3
3
|
import type { AppServerContext } from '../server/app_server_context.js';
|
|
4
|
-
import type { SessionOptions } from '../auth/session_cookie.js';
|
|
5
4
|
import type { EventSpec } from '../realtime/sse.js';
|
|
6
5
|
import type { AuditLogEvent } from '../auth/audit_log_schema.js';
|
|
7
6
|
import { type SuiteAppOptions, type TestApp, type TestAccount } from './test_app.js';
|
|
@@ -35,8 +34,8 @@ export interface SseRouteTestSpec {
|
|
|
35
34
|
}
|
|
36
35
|
/** Options for `describe_sse_route_tests`. */
|
|
37
36
|
export interface SseRouteTestOptions {
|
|
38
|
-
/**
|
|
39
|
-
|
|
37
|
+
/** The session cookie's name. */
|
|
38
|
+
session_cookie_name: string;
|
|
40
39
|
/** Route spec factory — same shape as production. */
|
|
41
40
|
create_route_specs: (ctx: AppServerContext) => Array<RouteSpec>;
|
|
42
41
|
/** Optional overrides for `AppServerOptions`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse_round_trip.d.ts","sourceRoot":"","sources":["../../src/lib/testing/sse_round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAoB7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sse_round_trip.d.ts","sourceRoot":"","sources":["../../src/lib/testing/sse_round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAoB7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE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CAAC,CAAC;CAChC;AAmDD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS,mBAAmB,KAAG,IAyIvE,CAAC"}
|
|
@@ -71,7 +71,7 @@ export const describe_sse_route_tests = (options) => {
|
|
|
71
71
|
// confusing test failure when `rpc_endpoints` is missing. Factory-form
|
|
72
72
|
// callers are resolved with a stub ctx purely to extract the endpoint
|
|
73
73
|
// path; real handlers run per-test via the top-level `rpc_endpoints` slot on `CreateTestAppOptions`.
|
|
74
|
-
const rpc_endpoints_for_setup = resolve_rpc_endpoints_for_setup(options.rpc_endpoints, options.
|
|
74
|
+
const rpc_endpoints_for_setup = resolve_rpc_endpoints_for_setup(options.rpc_endpoints, options.session_cookie_name);
|
|
75
75
|
const rpc_path = require_rpc_endpoint_path(rpc_endpoints_for_setup);
|
|
76
76
|
const init_schema = async (db) => {
|
|
77
77
|
await run_migrations(db, [AUTH_MIGRATION_NS]);
|
|
@@ -97,7 +97,7 @@ export const describe_sse_route_tests = (options) => {
|
|
|
97
97
|
? (params) => create_audit_emitter({ ...params, on_audit_event })
|
|
98
98
|
: undefined;
|
|
99
99
|
test_app = await create_test_app({
|
|
100
|
-
|
|
100
|
+
session_cookie_name: options.session_cookie_name,
|
|
101
101
|
create_route_specs: options.create_route_specs,
|
|
102
102
|
db,
|
|
103
103
|
rpc_endpoints: options.rpc_endpoints,
|
package/dist/testing/stubs.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
2
|
import type { AnySchema } from '@fuzdev/fuz_schema/schema.ts';
|
|
3
|
-
import type { SessionOptions } from '../auth/session_cookie.js';
|
|
4
3
|
import type { MiddlewareCarveOut, MiddlewareSpec } from '../http/middleware_spec.js';
|
|
5
4
|
import type { AppDeps } from '../auth/deps.js';
|
|
6
5
|
import type { AuditEmitter } from '../auth/audit_emitter.js';
|
|
@@ -131,16 +130,16 @@ export declare const create_stub_api_middleware: (options?: {
|
|
|
131
130
|
/**
|
|
132
131
|
* Create a stub `AppServerContext` for attack surface testing.
|
|
133
132
|
*
|
|
134
|
-
* Provides sensible defaults for all fields. Pass `
|
|
133
|
+
* Provides sensible defaults for all fields. Pass `session_cookie_name` since
|
|
135
134
|
* it varies per consumer; other fields use stubs/nulls.
|
|
136
135
|
*
|
|
137
|
-
* @param
|
|
136
|
+
* @param session_cookie_name - consumer's session cookie name (required — varies per app)
|
|
138
137
|
*/
|
|
139
|
-
export declare const create_stub_app_server_context: (
|
|
138
|
+
export declare const create_stub_app_server_context: (session_cookie_name: string) => AppServerContext;
|
|
140
139
|
/** Options for `create_test_app_surface_spec`. */
|
|
141
140
|
export interface CreateTestAppSurfaceSpecOptions {
|
|
142
|
-
/**
|
|
143
|
-
|
|
141
|
+
/** The session cookie's name (required — varies per app). */
|
|
142
|
+
session_cookie_name: string;
|
|
144
143
|
/** Consumer's route factory — receives the same `AppServerContext` as production. */
|
|
145
144
|
create_route_specs: (ctx: AppServerContext) => Array<RouteSpec>;
|
|
146
145
|
/** Env schema for surface generation (default: `BaseServerEnv`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../../src/lib/testing/stubs.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../../src/lib/testing/stubs.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAIrF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0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AAC,eAAe,CAAC,CAAC,CAAC;IAC7F;;;;;;;;OAQG;IACH,YAAY,CAAC,EACZ,aAAa,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,gBAAgB,KAAK,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC;IAC5F;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACxC;;;;;;;;OAQG;IACH,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,KAAK,CAAC,cAAc,CAAC,CAAC;IAC/E;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAC9C;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACnC;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAmBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,4BAA4B,GACxC,SAAS,+BAA+B,KACtC,cAmHF,CAAC"}
|
package/dist/testing/stubs.js
CHANGED
|
@@ -26,6 +26,7 @@ import { SseRegistry } from '../realtime/sse_registry.js';
|
|
|
26
26
|
import { ROLE_ADMIN } from '../auth/role_schema.js';
|
|
27
27
|
import { BaseServerEnv } from '../server/env.js';
|
|
28
28
|
import { AUTH_MIDDLEWARE_PATH, ORIGIN_MIDDLEWARE_PATH, assert_credential_routes_in_auth_scope, assert_endpoint_in_auth_scope, assert_middleware_stack_mounted, assert_origin_carve_outs_valid, freeze_origin_carve_outs } from '../auth/middleware.js';
|
|
29
|
+
import { create_request_tracker } from '../http/pending_effects.js';
|
|
29
30
|
/**
|
|
30
31
|
* Create a Proxy that throws descriptive errors on any property access or method call.
|
|
31
32
|
*
|
|
@@ -167,8 +168,8 @@ export const create_stub_audit_sse = () => {
|
|
|
167
168
|
* Create no-op `AppDeps` for auth surface testing.
|
|
168
169
|
*/
|
|
169
170
|
export const create_stub_app_deps = () => ({
|
|
170
|
-
// `sign` answers a string, as a keyring does
|
|
171
|
-
//
|
|
171
|
+
// `sign` answers a string, as a keyring does, so a route that signs a
|
|
172
|
+
// session cookie on stub deps writes a line
|
|
172
173
|
keyring: create_noop_stub('keyring', {
|
|
173
174
|
sign: async (value) => `${value}.stub_signature`
|
|
174
175
|
}),
|
|
@@ -177,7 +178,8 @@ export const create_stub_app_deps = () => ({
|
|
|
177
178
|
log: new Logger('test', { level: 'off' }),
|
|
178
179
|
audit: create_test_audit_emitter(),
|
|
179
180
|
connection_closer: create_realtime_closer(),
|
|
180
|
-
notification_sender: create_realtime_notification_sender()
|
|
181
|
+
notification_sender: create_realtime_notification_sender(),
|
|
182
|
+
request_tracker: create_request_tracker()
|
|
181
183
|
});
|
|
182
184
|
/**
|
|
183
185
|
* Create a stub `AppBackend` with no database behind it — no migration
|
|
@@ -239,18 +241,18 @@ export const create_stub_api_middleware = (options) => {
|
|
|
239
241
|
/**
|
|
240
242
|
* Create a stub `AppServerContext` for attack surface testing.
|
|
241
243
|
*
|
|
242
|
-
* Provides sensible defaults for all fields. Pass `
|
|
244
|
+
* Provides sensible defaults for all fields. Pass `session_cookie_name` since
|
|
243
245
|
* it varies per consumer; other fields use stubs/nulls.
|
|
244
246
|
*
|
|
245
|
-
* @param
|
|
247
|
+
* @param session_cookie_name - consumer's session cookie name (required — varies per app)
|
|
246
248
|
*/
|
|
247
|
-
export const create_stub_app_server_context = (
|
|
249
|
+
export const create_stub_app_server_context = (session_cookie_name) => {
|
|
248
250
|
const backend = create_stub_app_backend();
|
|
249
251
|
return {
|
|
250
252
|
deps: backend.deps,
|
|
251
253
|
backend,
|
|
252
254
|
bootstrap_status: { available: false },
|
|
253
|
-
|
|
255
|
+
session_cookie_name,
|
|
254
256
|
login_ip_rate_limiter: null,
|
|
255
257
|
signup_ip_rate_limiter: null,
|
|
256
258
|
bootstrap_ip_rate_limiter: null,
|
|
@@ -312,7 +314,7 @@ const assert_self_resolved_ws_origins = (endpoint) => {
|
|
|
312
314
|
* reorders, wraps, or replaces the stub host gate, proxy or auth spec
|
|
313
315
|
*/
|
|
314
316
|
export const create_test_app_surface_spec = (options) => {
|
|
315
|
-
const ctx = create_stub_app_server_context(options.
|
|
317
|
+
const ctx = create_stub_app_server_context(options.session_cookie_name);
|
|
316
318
|
const consumer_routes = options.create_route_specs(ctx);
|
|
317
319
|
// Auto-mount rpc endpoints (mirrors create_app_server) so consumer
|
|
318
320
|
// `create_route_specs` does not need to call `create_rpc_endpoint`.
|
|
@@ -13,6 +13,7 @@ import './assert_dev_env.js';
|
|
|
13
13
|
import type { Hono } from 'hono';
|
|
14
14
|
import type { Uuid } from '../primitive_schemas.js';
|
|
15
15
|
import { type AppServer, type AppServerOptions, type BootstrapServerOptions } from '../server/app_server.js';
|
|
16
|
+
import type { ShutdownDrainGivenUp } from '../server/shutdown_drain.js';
|
|
16
17
|
import type { AppServerContext } from '../server/app_server_context.js';
|
|
17
18
|
import type { AppSurface, AppSurfaceSpec } from '../http/surface.js';
|
|
18
19
|
import type { RouteSpec } from '../http/route_spec.js';
|
|
@@ -23,6 +24,8 @@ import type { DbInvariantExclusions } from './db_invariant_queries.js';
|
|
|
23
24
|
* Configuration for `create_test_app`.
|
|
24
25
|
*/
|
|
25
26
|
export interface CreateTestAppOptions extends TestAppServerOptions {
|
|
27
|
+
/** The session cookie's name the assembled server reads and sets. */
|
|
28
|
+
session_cookie_name: string;
|
|
26
29
|
/** Route spec factory — called with the assembled `AppServerContext`. */
|
|
27
30
|
create_route_specs: (context: AppServerContext) => Array<RouteSpec>;
|
|
28
31
|
/**
|
|
@@ -45,7 +48,7 @@ export interface CreateTestAppOptions extends TestAppServerOptions {
|
|
|
45
48
|
bootstrap?: BootstrapServerOptions;
|
|
46
49
|
/**
|
|
47
50
|
* Optional overrides for `AppServerOptions`. Excludes fields
|
|
48
|
-
* `create_test_app` manages directly: `backend`, `
|
|
51
|
+
* `create_test_app` manages directly: `backend`, `session_cookie_name`,
|
|
49
52
|
* `create_route_specs`, `rpc_endpoints`, `bootstrap` (top-level slots
|
|
50
53
|
* above).
|
|
51
54
|
*/
|
|
@@ -63,12 +66,12 @@ export interface CreateTestAppOptions extends TestAppServerOptions {
|
|
|
63
66
|
/**
|
|
64
67
|
* `app_options` shape accepted by `create_test_app` and the DB-backed suite
|
|
65
68
|
* helpers. Excludes fields the helpers manage directly — `backend` /
|
|
66
|
-
* `
|
|
69
|
+
* `session_cookie_name` / `create_route_specs` are constructed by the helper
|
|
67
70
|
* itself; `rpc_endpoints` and `bootstrap` live on top-level options so
|
|
68
71
|
* setup-time surface lookup and runtime dispatch read from one source of
|
|
69
72
|
* truth.
|
|
70
73
|
*/
|
|
71
|
-
export type SuiteAppOptions = Partial<Omit<AppServerOptions, 'backend' | '
|
|
74
|
+
export type SuiteAppOptions = Partial<Omit<AppServerOptions, 'backend' | 'session_cookie_name' | 'create_route_specs' | 'rpc_endpoints' | 'bootstrap'>>;
|
|
72
75
|
/**
|
|
73
76
|
* A bootstrapped test account with credentials.
|
|
74
77
|
*/
|
|
@@ -135,8 +138,8 @@ export interface TestApp {
|
|
|
135
138
|
* @throws Error listing every broken invariant and its rows
|
|
136
139
|
*/
|
|
137
140
|
assert_db_invariants: () => Promise<void>;
|
|
138
|
-
/** Cleanup resources — `AppServer.close`: stops an opted-in auth cleanup schedule, closes live connections, disposes the limiters the server built and removes the audit listeners and closer members it added, then the backend's `close
|
|
139
|
-
cleanup: () => Promise<
|
|
141
|
+
/** Cleanup resources — `AppServer.close`: stops an opted-in auth cleanup schedule, closes live connections, drains the work in flight within its bound, disposes the limiters the server built and removes the audit listeners and closer members it added, then the backend's `close`; resolves what the drain gave up on. Idempotent. */
|
|
142
|
+
cleanup: () => Promise<ShutdownDrainGivenUp>;
|
|
140
143
|
}
|
|
141
144
|
/**
|
|
142
145
|
* Create a fully assembled test app with a Hono server, middleware, and routes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test_app.d.ts","sourceRoot":"","sources":["../../src/lib/testing/test_app.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAEN,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAMvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAKN,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,MAAM,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IACjE,yEAAyE;IACzE,kBAAkB,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IACpE;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACnC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;;;;;;OAOG;IACH,qBAA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AAE,cAAc,CAAC;IAC7B,OAAO,EAAE,UAAU,CAAC;IACpB,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC9B,kEAAkE;IAClE,sBAAsB,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnF,gEAAgE;IAChE,qBAAqB,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClF,iEAAiE;IACjE,2BAA2B,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxF,qDAAqD;IACrD,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,wBAAwB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7E;;;;;;;OAOG;IACH,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,2UAA2U;IAC3U,OAAO,EAAE,MAAM,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC7C;AAyCD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,eAAe,GAAU,SAAS,oBAAoB,KAAG,OAAO,CAAC,OAAO,CAwFpF,CAAC"}
|
package/dist/testing/test_app.js
CHANGED
|
@@ -14,7 +14,11 @@ const test_app_options = () => ({
|
|
|
14
14
|
// every limiter off unless `app_options` passes one — a rate-limit test
|
|
15
15
|
// enables just the limiter it pins
|
|
16
16
|
rate_limiters: 'disabled_for_testing',
|
|
17
|
-
await_pending_effects: true
|
|
17
|
+
await_pending_effects: true,
|
|
18
|
+
// off: a background pass would delete rows and write audit rows mid-test.
|
|
19
|
+
// A suite that opts in through `app_options` has the schedule stopped by
|
|
20
|
+
// `cleanup`.
|
|
21
|
+
auth_cleanup: 'off'
|
|
18
22
|
});
|
|
19
23
|
/** Build request headers carrying `session_cookie` in the `cookie_name` cookie. */
|
|
20
24
|
const create_session_headers_builder = (cookie_name, session_cookie) => (extra) => create_test_request_headers({ cookie: `${cookie_name}=${session_cookie}`, ...extra });
|
|
@@ -64,18 +68,15 @@ export const create_test_app = async (options) => {
|
|
|
64
68
|
const result = await create_app_server({
|
|
65
69
|
...test_app_options(),
|
|
66
70
|
backend: test_server,
|
|
67
|
-
|
|
71
|
+
session_cookie_name: options.session_cookie_name,
|
|
68
72
|
daemon_token_state,
|
|
69
73
|
rpc_endpoints: options.rpc_endpoints,
|
|
70
74
|
bootstrap: options.bootstrap,
|
|
71
|
-
// `auth_cleanup` stays at its default, off: a background pass would
|
|
72
|
-
// delete rows and write audit rows mid-test. A suite that opts in
|
|
73
|
-
// through `app_options` has the schedule stopped by `cleanup`.
|
|
74
75
|
...options.app_options,
|
|
75
76
|
create_route_specs: options.create_route_specs
|
|
76
77
|
});
|
|
77
78
|
const { app, surface_spec } = result;
|
|
78
|
-
const
|
|
79
|
+
const cookie_name = options.session_cookie_name;
|
|
79
80
|
const { password = stub_password_deps } = options;
|
|
80
81
|
const create_session_headers = create_session_headers_builder(cookie_name, test_server.session_cookie);
|
|
81
82
|
const create_bearer_headers = create_bearer_headers_builder(test_server.api_token);
|
|
@@ -90,7 +91,6 @@ export const create_test_app = async (options) => {
|
|
|
90
91
|
const bootstrapped = await create_test_account_with_credentials({
|
|
91
92
|
db: test_server.deps.db,
|
|
92
93
|
keyring: test_server.keyring,
|
|
93
|
-
session_options: options.session_options,
|
|
94
94
|
password,
|
|
95
95
|
username: account_options?.username ?? `test_user_${account_counter}`,
|
|
96
96
|
password_value: account_options?.password_value ?? DEFAULT_TEST_PASSWORD,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws_round_trip.d.ts","sourceRoot":"","sources":["../../src/lib/testing/ws_round_trip.ts"],"names":[],"mappings":"AA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