@fuzdev/fuz_app 0.87.0 → 0.88.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/action_rpc.js +1 -1
- package/dist/actions/register_action_ws.js +1 -1
- package/dist/auth/CLAUDE.md +15 -0
- package/dist/auth/account_actions.js +1 -1
- package/dist/auth/account_route_schema.d.ts +146 -0
- package/dist/auth/account_route_schema.d.ts.map +1 -0
- package/dist/auth/account_route_schema.js +141 -0
- package/dist/auth/account_routes.d.ts +0 -79
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +15 -110
- package/dist/auth/audit_log_route_schema.d.ts +32 -0
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -0
- package/dist/auth/audit_log_route_schema.js +36 -0
- package/dist/auth/audit_log_routes.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.js +2 -12
- package/dist/auth/bearer_auth.js +1 -1
- package/dist/auth/bootstrap_route_schema.d.ts +85 -0
- package/dist/auth/bootstrap_route_schema.d.ts.map +1 -0
- package/dist/auth/bootstrap_route_schema.js +56 -0
- package/dist/auth/bootstrap_routes.d.ts +0 -20
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +4 -35
- package/dist/auth/signup_route_schema.d.ts +53 -0
- package/dist/auth/signup_route_schema.d.ts.map +1 -0
- package/dist/auth/signup_route_schema.js +59 -0
- package/dist/auth/signup_routes.d.ts +0 -26
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +8 -40
- package/dist/http/CLAUDE.md +2 -1
- package/dist/http/client_ip.d.ts +15 -0
- package/dist/http/client_ip.d.ts.map +1 -0
- package/dist/http/client_ip.js +13 -0
- package/dist/http/proxy.d.ts +0 -7
- package/dist/http/proxy.d.ts.map +1 -1
- package/dist/http/proxy.js +0 -7
- package/dist/realtime/sse.d.ts +0 -2
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +1 -2
- package/dist/realtime/sse_constants.d.ts +17 -0
- package/dist/realtime/sse_constants.d.ts.map +1 -0
- package/dist/realtime/sse_constants.js +16 -0
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +1 -1
- package/dist/testing/app_server.d.ts +0 -15
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +1 -15
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +1 -1
- package/dist/testing/cross_backend/in_process_setup.d.ts +143 -0
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -0
- package/dist/testing/cross_backend/in_process_setup.js +166 -0
- package/dist/testing/cross_backend/setup.d.ts +31 -140
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +11 -171
- package/dist/testing/cross_backend/sse_round_trip.js +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +2 -1
- package/dist/testing/integration.js +2 -2
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +2 -1
- package/dist/testing/sse_round_trip.d.ts +1 -1
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +1 -1
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +7 -9
- package/dist/testing/test_credentials.d.ts +23 -0
- package/dist/testing/test_credentials.d.ts.map +1 -0
- package/dist/testing/test_credentials.js +22 -0
- package/package.json +2 -2
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import '../assert_dev_env.js';
|
|
2
2
|
import { Uuid } from '@fuzdev/fuz_util/id.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type { AppServerContext } from '../../server/app_server_context.js';
|
|
6
|
-
import type { SessionOptions } from '../../auth/session_cookie.js';
|
|
7
|
-
import { type CreateTestAppOptions, type SuiteAppOptions, type TestAccount } from '../app_server.js';
|
|
8
|
-
import { type RpcEndpointsSuiteOption } from '../rpc_helpers.js';
|
|
9
|
-
import { type BackendCapabilities } from './capabilities.js';
|
|
10
|
-
import type { AppSurfaceSpec } from '../../http/surface.js';
|
|
3
|
+
import type { TestAccount } from '../app_server.js';
|
|
4
|
+
import type { BackendCapabilities } from './capabilities.js';
|
|
11
5
|
import { type FetchTransport } from '../transports/fetch_transport.js';
|
|
12
6
|
import type { SchemaSnapshot } from '../schema_introspect.js';
|
|
13
7
|
import type { BackendHandle } from './spawn_backend.js';
|
|
@@ -62,6 +56,28 @@ export interface ExtraAccountFixture {
|
|
|
62
56
|
readonly create_session_headers: (extra?: Record<string, string>) => Record<string, string>;
|
|
63
57
|
readonly create_bearer_headers: (extra?: Record<string, string>) => Record<string, string>;
|
|
64
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Build an `ExtraAccountFixture` from a seeded `{account, actor,
|
|
61
|
+
* api_token, session_cookie}` bundle and the session cookie name.
|
|
62
|
+
*
|
|
63
|
+
* Same shape produced by either path that seeds bootstrap-time
|
|
64
|
+
* secondaries: in-process via `create_test_account_with_credentials`
|
|
65
|
+
* against the live backend's DB, or cross-process via the
|
|
66
|
+
* `_testing_reset` RPC's `extra_accounts` output. Both call this
|
|
67
|
+
* helper so the fixture-side header builders + field plumbing stays
|
|
68
|
+
* in one place.
|
|
69
|
+
*/
|
|
70
|
+
export declare const build_extra_account_fixture: (seeded: {
|
|
71
|
+
account: {
|
|
72
|
+
id: Uuid;
|
|
73
|
+
username: string;
|
|
74
|
+
};
|
|
75
|
+
actor: {
|
|
76
|
+
id: Uuid;
|
|
77
|
+
};
|
|
78
|
+
api_token: string;
|
|
79
|
+
session_cookie: string;
|
|
80
|
+
}, cookie_name: string) => ExtraAccountFixture;
|
|
65
81
|
/**
|
|
66
82
|
* Fields shared by every `TestFixture` regardless of transport. The
|
|
67
83
|
* discriminated union below adds in-process-only fields conditionally.
|
|
@@ -215,48 +231,6 @@ export interface RpcPathCrossSuiteOptions extends CrossSuiteOptions {
|
|
|
215
231
|
/** RPC endpoint path the methods are mounted on. Default `/api/rpc`. */
|
|
216
232
|
readonly rpc_path?: string;
|
|
217
233
|
}
|
|
218
|
-
/**
|
|
219
|
-
* Options for `default_in_process_setup`. Extends `CreateTestAppOptions`
|
|
220
|
-
* with the same `extra_accounts` slot the cross-process variant accepts
|
|
221
|
-
* — both transports observe the same bootstrap-time secondary set so
|
|
222
|
-
* suite bodies can read `fixture.extra_accounts[username]` uniformly.
|
|
223
|
-
*/
|
|
224
|
-
export interface InProcessSetupOptions extends CreateTestAppOptions {
|
|
225
|
-
/**
|
|
226
|
-
* Additional accounts seeded at this transport's bootstrap-equivalent
|
|
227
|
-
* step. See `ExtraAccountSpec` for the cradle-only-bypass rationale.
|
|
228
|
-
* Most suites pass `undefined` / `[]`; the `ROLE_KEEPER` probe (in
|
|
229
|
-
* `describe_standard_admin_integration_tests`) is the primary user.
|
|
230
|
-
*/
|
|
231
|
-
readonly extra_accounts?: ReadonlyArray<ExtraAccountSpec>;
|
|
232
|
-
/**
|
|
233
|
-
* Additional actor names to seed on the bootstrapped keeper — exposed on
|
|
234
|
-
* `fixture.extra_actors`. See `CrossProcessSetupOptions.extra_actors` /
|
|
235
|
-
* `TestFixtureBase.extra_actors`. Seeded directly against the live backend
|
|
236
|
-
* DB (in-process has no wire hop).
|
|
237
|
-
*/
|
|
238
|
-
readonly extra_actors?: ReadonlyArray<string>;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Build a `SetupTest` that creates a fresh `TestApp` per call via
|
|
242
|
-
* `create_test_app` and projects it into the `TestFixture` shape.
|
|
243
|
-
*
|
|
244
|
-
* Same factory inputs `create_test_app` already takes — this helper
|
|
245
|
-
* is a projection layer, not a new lifecycle. fuz_app's own `src/test/`
|
|
246
|
-
* and consumer suites pass `default_in_process_setup({...factory_inputs})`
|
|
247
|
-
* in place of the old per-suite factory-input bundle. The `extra_accounts`
|
|
248
|
-
* slot (see `InProcessSetupOptions`) seeds bootstrap-time secondaries
|
|
249
|
-
* directly via `create_test_account_with_credentials` against the same
|
|
250
|
-
* DB the keeper just landed on — mirrors the cross-process
|
|
251
|
-
* `_testing_reset` cradle so suite bodies read
|
|
252
|
-
* `fixture.extra_accounts[username]` uniformly regardless of transport.
|
|
253
|
-
*
|
|
254
|
-
* The describe-level `auth_integration_truncate_tables` / pglite WASM
|
|
255
|
-
* cache lifecycle stays in `create_pglite_factory` / `create_describe_db`
|
|
256
|
-
* (`testing/db.ts`) — `default_in_process_setup` doesn't manage db state
|
|
257
|
-
* beyond what `create_test_app` already does.
|
|
258
|
-
*/
|
|
259
|
-
export declare const default_in_process_setup: (options: InProcessSetupOptions) => SetupTest;
|
|
260
234
|
/**
|
|
261
235
|
* Cross-process backend handle enriched with the bootstrapped keeper's
|
|
262
236
|
* captured credentials. Consumers compose this in vitest's
|
|
@@ -394,6 +368,13 @@ export interface CrossProcessSetupOptions {
|
|
|
394
368
|
export declare const capture_schema_snapshot: (handle: ReconstructedBootstrappedBackendHandle, options?: {
|
|
395
369
|
exclude_tables?: ReadonlyArray<string>;
|
|
396
370
|
}) => Promise<SchemaSnapshot>;
|
|
371
|
+
/**
|
|
372
|
+
* Backdating offset (seconds) the `mint_expired_session` seam passes to
|
|
373
|
+
* `mint_test_session` / `_testing_mint_session`. A minute in the past is
|
|
374
|
+
* comfortably past `NOW()` for the DB-row expiry gate without depending on
|
|
375
|
+
* clock precision.
|
|
376
|
+
*/
|
|
377
|
+
export declare const EXPIRED_SESSION_OFFSET_SECONDS = -60;
|
|
397
378
|
/**
|
|
398
379
|
* Build a `SetupTest` against a spawned + bootstrapped backend.
|
|
399
380
|
*
|
|
@@ -418,94 +399,4 @@ export declare const capture_schema_snapshot: (handle: ReconstructedBootstrapped
|
|
|
418
399
|
* revoke-all) and hardcoded-username signup tests work uniformly.
|
|
419
400
|
*/
|
|
420
401
|
export declare const default_cross_process_setup: (handle: ReconstructedBootstrappedBackendHandle, options?: CrossProcessSetupOptions) => SetupTest;
|
|
421
|
-
/**
|
|
422
|
-
* Consumer-facing options for `default_in_process_suite_options` — the
|
|
423
|
-
* minimal factory inputs both `default_in_process_setup` and
|
|
424
|
-
* `create_test_app_surface_spec` consume to produce the
|
|
425
|
-
* `{setup_test, surface_source, capabilities}` bundle.
|
|
426
|
-
*/
|
|
427
|
-
export interface DefaultInProcessSuiteOptions {
|
|
428
|
-
session_options: SessionOptions<string>;
|
|
429
|
-
create_route_specs: (ctx: AppServerContext) => Array<RouteSpec>;
|
|
430
|
-
rpc_endpoints?: RpcEndpointsSuiteOption;
|
|
431
|
-
/**
|
|
432
|
-
* Bootstrap config — top-level slot, single source of truth for both
|
|
433
|
-
* surface generation and live dispatch. Same precedent as
|
|
434
|
-
* `rpc_endpoints`. Discriminated by `mode`; omit for the default (no
|
|
435
|
-
* bootstrap route mounted).
|
|
436
|
-
*/
|
|
437
|
-
bootstrap?: BootstrapServerOptions;
|
|
438
|
-
app_options?: SuiteAppOptions;
|
|
439
|
-
/**
|
|
440
|
-
* Additional roles to grant the bootstrapped keeper alongside
|
|
441
|
-
* `ROLE_KEEPER` — additive, never replaces. The keeper account
|
|
442
|
-
* always holds `ROLE_KEEPER` (otherwise daemon-token auth breaks);
|
|
443
|
-
* pass extras here for suites that need additional role coverage.
|
|
444
|
-
*
|
|
445
|
-
* Admin-suite consumers pass `[ROLE_ADMIN]` so the default keeper
|
|
446
|
-
* can hit admin-gated RPC methods.
|
|
447
|
-
* `describe_standard_admin_integration_tests` and
|
|
448
|
-
* `describe_audit_completeness_tests` need this.
|
|
449
|
-
*/
|
|
450
|
-
extra_keeper_roles?: Array<string>;
|
|
451
|
-
/**
|
|
452
|
-
* Bootstrap-time secondary accounts seeded alongside the keeper. See
|
|
453
|
-
* `ExtraAccountSpec` for the cradle-only-bypass rationale. Same shape
|
|
454
|
-
* as the cross-process `extra_accounts` option — suites read seeded
|
|
455
|
-
* accounts from `fixture.extra_accounts[username]` regardless of
|
|
456
|
-
* transport.
|
|
457
|
-
*/
|
|
458
|
-
extra_accounts?: ReadonlyArray<ExtraAccountSpec>;
|
|
459
|
-
/**
|
|
460
|
-
* Additional actor names to seed on the bootstrapped keeper — exposed on
|
|
461
|
-
* `fixture.extra_actors`. See `TestFixtureBase.extra_actors`.
|
|
462
|
-
*/
|
|
463
|
-
extra_actors?: ReadonlyArray<string>;
|
|
464
|
-
/**
|
|
465
|
-
* Pre-built `AppSurfaceSpec` — overrides the default which calls
|
|
466
|
-
* `create_test_app_surface_spec` against the same factory inputs.
|
|
467
|
-
* Pass when surface assembly needs fields outside the shared subset
|
|
468
|
-
* (e.g. `env_schema`, `event_specs`, `ws_endpoints`, `transform_middleware`).
|
|
469
|
-
*/
|
|
470
|
-
surface_source?: AppSurfaceSpec;
|
|
471
|
-
}
|
|
472
|
-
/**
|
|
473
|
-
* Build the full in-process suite bundle in a single helper invocation.
|
|
474
|
-
* Output covers `{setup_test, surface_source, capabilities}` plus every
|
|
475
|
-
* factory input the Tier 1 suites read at their top level
|
|
476
|
-
* (`session_options`, `create_route_specs`, `rpc_endpoints`) — so the
|
|
477
|
-
* call site spreads once and adds only suite-specific extras
|
|
478
|
-
* (`roles`, `skip_routes`, `input_overrides`, `db_factories`, ...).
|
|
479
|
-
*
|
|
480
|
-
* ```ts
|
|
481
|
-
* // Suite-extras-free call: helper output is the entire options bag.
|
|
482
|
-
* describe_round_trip_validation(default_in_process_suite_options({
|
|
483
|
-
* session_options,
|
|
484
|
-
* create_route_specs,
|
|
485
|
-
* rpc_endpoints: [rpc_endpoint_spec],
|
|
486
|
-
* }));
|
|
487
|
-
*
|
|
488
|
-
* // With suite-specific extras: spread and add.
|
|
489
|
-
* describe_standard_admin_integration_tests({
|
|
490
|
-
* ...default_in_process_suite_options({
|
|
491
|
-
* session_options, create_route_specs, rpc_endpoints,
|
|
492
|
-
* extra_keeper_roles: [ROLE_ADMIN],
|
|
493
|
-
* }),
|
|
494
|
-
* roles,
|
|
495
|
-
* });
|
|
496
|
-
* ```
|
|
497
|
-
*
|
|
498
|
-
* Suites that don't read `session_options` / `rpc_endpoints` at their
|
|
499
|
-
* top level (`round_trip`, `data_exposure`) accept the spread anyway —
|
|
500
|
-
* excess properties on spread sources aren't checked by TS, and the
|
|
501
|
-
* uniform shape keeps consumer call sites mechanical.
|
|
502
|
-
*/
|
|
503
|
-
export declare const default_in_process_suite_options: <const O extends DefaultInProcessSuiteOptions>(options: O) => {
|
|
504
|
-
setup_test: SetupTest;
|
|
505
|
-
surface_source: AppSurfaceSpec;
|
|
506
|
-
capabilities: BackendCapabilities;
|
|
507
|
-
session_options: O["session_options"];
|
|
508
|
-
create_route_specs: O["create_route_specs"];
|
|
509
|
-
rpc_endpoints: O["rpc_endpoints"];
|
|
510
|
-
};
|
|
511
402
|
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/setup.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/setup.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA0B9B,OAAO,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAK5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAyB,KAAK,cAAc,EAAC,MAAM,kCAAkC,CAAC;AAC7F,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAA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Ac,CAUxB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,MAAM,CAAC;AAkSlD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,2BAA2B,GACvC,QAAQ,sCAAsC,EAC9C,UAAU,wBAAwB,KAChC,SAsIF,CAAC"}
|
|
@@ -10,24 +10,22 @@ import '../assert_dev_env.js';
|
|
|
10
10
|
* account / actor identity, three header builders, a multi-account mint
|
|
11
11
|
* factory, and (in-process only) the in-memory keyring + raw backend.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* The cross-process producer `default_cross_process_setup` lives here,
|
|
14
|
+
* alongside the spawn-a-backend transport plumbing — it implements the
|
|
15
|
+
* `SetupTest` contract by spawning a binary and bootstrapping over real
|
|
16
|
+
* HTTP. The in-process producers (`default_in_process_setup` /
|
|
17
|
+
* `default_in_process_suite_options`, which wrap `create_test_app`) live
|
|
18
|
+
* in the sibling `in_process_setup.ts` so this module — and the
|
|
19
|
+
* cross-process consumers that import it — stay free of the in-process
|
|
20
|
+
* Hono app and its optional `hono` peer dependency.
|
|
18
21
|
*
|
|
19
22
|
* @module
|
|
20
23
|
*/
|
|
21
24
|
import { z } from 'zod';
|
|
22
25
|
import { Uuid } from '@fuzdev/fuz_util/id.js';
|
|
23
|
-
import { ROLE_KEEPER } from '../../auth/role_schema.js';
|
|
24
|
-
import { query_create_actor } from '../../auth/account_queries.js';
|
|
25
26
|
import { DAEMON_TOKEN_HEADER } from '../../auth/daemon_token.js';
|
|
26
27
|
import { USERNAME_LENGTH_MAX } from '../../primitive_schemas.js';
|
|
27
|
-
import {
|
|
28
|
-
import { create_test_app_surface_spec } from '../stubs.js';
|
|
29
|
-
import { http_transport, } from '../rpc_helpers.js';
|
|
30
|
-
import { in_process_capabilities } from './capabilities.js';
|
|
28
|
+
import { DEFAULT_TEST_PASSWORD } from '../test_credentials.js';
|
|
31
29
|
import { create_fetch_transport } from '../transports/fetch_transport.js';
|
|
32
30
|
/**
|
|
33
31
|
* Build an `ExtraAccountFixture` from a seeded `{account, actor,
|
|
@@ -40,7 +38,7 @@ import { create_fetch_transport } from '../transports/fetch_transport.js';
|
|
|
40
38
|
* helper so the fixture-side header builders + field plumbing stays
|
|
41
39
|
* in one place.
|
|
42
40
|
*/
|
|
43
|
-
const build_extra_account_fixture = (seeded, cookie_name) => ({
|
|
41
|
+
export const build_extra_account_fixture = (seeded, cookie_name) => ({
|
|
44
42
|
account: seeded.account,
|
|
45
43
|
actor: seeded.actor,
|
|
46
44
|
api_token: seeded.api_token,
|
|
@@ -54,99 +52,6 @@ const build_extra_account_fixture = (seeded, cookie_name) => ({
|
|
|
54
52
|
...extra,
|
|
55
53
|
}),
|
|
56
54
|
});
|
|
57
|
-
/**
|
|
58
|
-
* Wrap a Hono-style app into a `FetchTransport`-shaped object so the
|
|
59
|
-
* shared `TestFixtureBase.transport` type holds for both in-process and
|
|
60
|
-
* cross-process setups. In-process has no real cookie jar — the no-op
|
|
61
|
-
* `cookies()` returns `[]`; in-process tests build cookies via
|
|
62
|
-
* `fixture.create_session_headers()` instead.
|
|
63
|
-
*/
|
|
64
|
-
const in_process_fetch_transport = (app) => {
|
|
65
|
-
const call = http_transport(app);
|
|
66
|
-
const transport = ((url, init) => call(url, init));
|
|
67
|
-
return Object.assign(transport, { cookies: () => [] });
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Build a `SetupTest` that creates a fresh `TestApp` per call via
|
|
71
|
-
* `create_test_app` and projects it into the `TestFixture` shape.
|
|
72
|
-
*
|
|
73
|
-
* Same factory inputs `create_test_app` already takes — this helper
|
|
74
|
-
* is a projection layer, not a new lifecycle. fuz_app's own `src/test/`
|
|
75
|
-
* and consumer suites pass `default_in_process_setup({...factory_inputs})`
|
|
76
|
-
* in place of the old per-suite factory-input bundle. The `extra_accounts`
|
|
77
|
-
* slot (see `InProcessSetupOptions`) seeds bootstrap-time secondaries
|
|
78
|
-
* directly via `create_test_account_with_credentials` against the same
|
|
79
|
-
* DB the keeper just landed on — mirrors the cross-process
|
|
80
|
-
* `_testing_reset` cradle so suite bodies read
|
|
81
|
-
* `fixture.extra_accounts[username]` uniformly regardless of transport.
|
|
82
|
-
*
|
|
83
|
-
* The describe-level `auth_integration_truncate_tables` / pglite WASM
|
|
84
|
-
* cache lifecycle stays in `create_pglite_factory` / `create_describe_db`
|
|
85
|
-
* (`testing/db.ts`) — `default_in_process_setup` doesn't manage db state
|
|
86
|
-
* beyond what `create_test_app` already does.
|
|
87
|
-
*/
|
|
88
|
-
export const default_in_process_setup = (options) => async () => {
|
|
89
|
-
// Per-test fresh db. When `options.migration_namespaces` is set,
|
|
90
|
-
// `create_test_app` provisions an auth+extras PGlite (e.g. the cell
|
|
91
|
-
// layer); otherwise the auth-only default. Either way the factory
|
|
92
|
-
// resets + re-migrates on each `create`, so the per-test keeper
|
|
93
|
-
// bootstrap below lands on a clean DB.
|
|
94
|
-
const test_app = await create_test_app(options);
|
|
95
|
-
// Seed bootstrap-time secondaries against the same DB the keeper
|
|
96
|
-
// just landed on. Direct-insert is the only path for roles whose
|
|
97
|
-
// `grant_paths` excludes `'admin'` (e.g. `ROLE_KEEPER`) — see
|
|
98
|
-
// `ExtraAccountSpec` for why this bypass is bootstrap-cradle-only.
|
|
99
|
-
const extra_accounts = {};
|
|
100
|
-
const { cookie_name } = options.session_options;
|
|
101
|
-
for (const spec of options.extra_accounts ?? []) {
|
|
102
|
-
const seeded = await create_test_account_with_credentials({
|
|
103
|
-
db: test_app.backend.deps.db,
|
|
104
|
-
keyring: test_app.backend.keyring,
|
|
105
|
-
session_options: options.session_options,
|
|
106
|
-
password: test_app.backend.deps.password,
|
|
107
|
-
username: spec.username,
|
|
108
|
-
password_value: spec.password_value,
|
|
109
|
-
roles: [...spec.roles],
|
|
110
|
-
});
|
|
111
|
-
extra_accounts[spec.username] = build_extra_account_fixture(seeded, cookie_name);
|
|
112
|
-
}
|
|
113
|
-
// Seed additional keeper actors directly against the same DB. Mirrors
|
|
114
|
-
// the cross-process `_testing_reset` `extra_actors` path; no production
|
|
115
|
-
// wire mints a second actor, so this bootstrap-cradle insert is the
|
|
116
|
-
// only way into a multi-actor keeper state.
|
|
117
|
-
const extra_actors = [];
|
|
118
|
-
for (const name of options.extra_actors ?? []) {
|
|
119
|
-
const seeded_actor = await query_create_actor({ db: test_app.backend.deps.db }, test_app.backend.account.id, name);
|
|
120
|
-
extra_actors.push({ id: seeded_actor.id, name: seeded_actor.name });
|
|
121
|
-
}
|
|
122
|
-
return {
|
|
123
|
-
transport: in_process_fetch_transport(test_app.app),
|
|
124
|
-
// In-process the wrapper is stateless and never auto-adds Origin —
|
|
125
|
-
// `options` is accepted for API symmetry with cross-process but
|
|
126
|
-
// has no observable effect.
|
|
127
|
-
fresh_transport: () => in_process_fetch_transport(test_app.app),
|
|
128
|
-
account: test_app.backend.account,
|
|
129
|
-
actor: test_app.backend.actor,
|
|
130
|
-
create_session_headers: test_app.create_session_headers,
|
|
131
|
-
create_bearer_headers: test_app.create_bearer_headers,
|
|
132
|
-
create_daemon_token_headers: test_app.create_daemon_token_headers,
|
|
133
|
-
create_account: test_app.create_account,
|
|
134
|
-
extra_accounts,
|
|
135
|
-
extra_actors,
|
|
136
|
-
// Forge directly against the live backend's DB + keyring — no wire
|
|
137
|
-
// hop needed in-process.
|
|
138
|
-
mint_expired_session: async () => {
|
|
139
|
-
const { session_cookie } = await mint_test_session({
|
|
140
|
-
db: test_app.backend.deps.db,
|
|
141
|
-
keyring: test_app.backend.keyring,
|
|
142
|
-
session_options: options.session_options,
|
|
143
|
-
account_id: test_app.backend.account.id,
|
|
144
|
-
expires_in_seconds: EXPIRED_SESSION_OFFSET_SECONDS,
|
|
145
|
-
});
|
|
146
|
-
return `${cookie_name}=${session_cookie}`;
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
55
|
/**
|
|
151
56
|
* Strip the non-serializable members so the result can be passed to
|
|
152
57
|
* vitest's `project.provide`. Call in `globalSetup` before provide.
|
|
@@ -266,7 +171,7 @@ export const capture_schema_snapshot = async (handle, options = {}) => {
|
|
|
266
171
|
* comfortably past `NOW()` for the DB-row expiry gate without depending on
|
|
267
172
|
* clock precision.
|
|
268
173
|
*/
|
|
269
|
-
const EXPIRED_SESSION_OFFSET_SECONDS = -60;
|
|
174
|
+
export const EXPIRED_SESSION_OFFSET_SECONDS = -60;
|
|
270
175
|
/** Structural subset of `_testing_mint_session`'s output. */
|
|
271
176
|
const MintSessionResponseShape = z.object({ session_cookie: z.string() });
|
|
272
177
|
/** Structural subset of `_testing_reset`'s output. */
|
|
@@ -582,68 +487,3 @@ export const default_cross_process_setup = (handle, options) => {
|
|
|
582
487
|
};
|
|
583
488
|
};
|
|
584
489
|
};
|
|
585
|
-
// NOTE: bootstrap config is read from `options.bootstrap` — top-level slot,
|
|
586
|
-
// single source of truth for both the surface spec (so the route appears in
|
|
587
|
-
// `expected_public_routes` / attack-surface iteration) AND the live
|
|
588
|
-
// `create_test_app` (so the route exists at dispatch time and returns 403
|
|
589
|
-
// `ERROR_ALREADY_BOOTSTRAPPED` matching its declared 403 schema). Same
|
|
590
|
-
// precedent as `rpc_endpoints`. Discriminated union shape (`mode: 'disabled'`
|
|
591
|
-
// | `'surface_only'` | `'live'`) replaces the old `token_path: string | null`
|
|
592
|
-
// overload that conflated three deployment intents on one channel.
|
|
593
|
-
/**
|
|
594
|
-
* Build the full in-process suite bundle in a single helper invocation.
|
|
595
|
-
* Output covers `{setup_test, surface_source, capabilities}` plus every
|
|
596
|
-
* factory input the Tier 1 suites read at their top level
|
|
597
|
-
* (`session_options`, `create_route_specs`, `rpc_endpoints`) — so the
|
|
598
|
-
* call site spreads once and adds only suite-specific extras
|
|
599
|
-
* (`roles`, `skip_routes`, `input_overrides`, `db_factories`, ...).
|
|
600
|
-
*
|
|
601
|
-
* ```ts
|
|
602
|
-
* // Suite-extras-free call: helper output is the entire options bag.
|
|
603
|
-
* describe_round_trip_validation(default_in_process_suite_options({
|
|
604
|
-
* session_options,
|
|
605
|
-
* create_route_specs,
|
|
606
|
-
* rpc_endpoints: [rpc_endpoint_spec],
|
|
607
|
-
* }));
|
|
608
|
-
*
|
|
609
|
-
* // With suite-specific extras: spread and add.
|
|
610
|
-
* describe_standard_admin_integration_tests({
|
|
611
|
-
* ...default_in_process_suite_options({
|
|
612
|
-
* session_options, create_route_specs, rpc_endpoints,
|
|
613
|
-
* extra_keeper_roles: [ROLE_ADMIN],
|
|
614
|
-
* }),
|
|
615
|
-
* roles,
|
|
616
|
-
* });
|
|
617
|
-
* ```
|
|
618
|
-
*
|
|
619
|
-
* Suites that don't read `session_options` / `rpc_endpoints` at their
|
|
620
|
-
* top level (`round_trip`, `data_exposure`) accept the spread anyway —
|
|
621
|
-
* excess properties on spread sources aren't checked by TS, and the
|
|
622
|
-
* uniform shape keeps consumer call sites mechanical.
|
|
623
|
-
*/
|
|
624
|
-
export const default_in_process_suite_options = (options) => ({
|
|
625
|
-
setup_test: default_in_process_setup({
|
|
626
|
-
session_options: options.session_options,
|
|
627
|
-
create_route_specs: options.create_route_specs,
|
|
628
|
-
rpc_endpoints: options.rpc_endpoints,
|
|
629
|
-
bootstrap: options.bootstrap,
|
|
630
|
-
app_options: options.app_options,
|
|
631
|
-
roles: [ROLE_KEEPER, ...(options.extra_keeper_roles ?? [])],
|
|
632
|
-
extra_accounts: options.extra_accounts,
|
|
633
|
-
extra_actors: options.extra_actors,
|
|
634
|
-
}),
|
|
635
|
-
surface_source: options.surface_source ??
|
|
636
|
-
create_test_app_surface_spec({
|
|
637
|
-
session_options: options.session_options,
|
|
638
|
-
create_route_specs: options.create_route_specs,
|
|
639
|
-
rpc_endpoints: options.rpc_endpoints,
|
|
640
|
-
// Mirror what `create_test_app` → `create_app_server` will mount.
|
|
641
|
-
// Both helpers read from the top-level `bootstrap` slot so surface
|
|
642
|
-
// and live app stay in sync by construction.
|
|
643
|
-
bootstrap: options.bootstrap,
|
|
644
|
-
}),
|
|
645
|
-
capabilities: in_process_capabilities,
|
|
646
|
-
session_options: options.session_options,
|
|
647
|
-
create_route_specs: options.create_route_specs,
|
|
648
|
-
rpc_endpoints: options.rpc_endpoints,
|
|
649
|
-
});
|
|
@@ -51,7 +51,7 @@ import { assert, describe } from 'vitest';
|
|
|
51
51
|
import { account_session_list_action_spec, account_session_revoke_action_spec, account_session_revoke_all_action_spec, } from '../../auth/account_action_specs.js';
|
|
52
52
|
import { admin_session_revoke_all_action_spec } from '../../auth/admin_action_specs.js';
|
|
53
53
|
import { audit_log_event_specs } from '../../realtime/sse_auth_guard.js';
|
|
54
|
-
import { SSE_CONNECTED_COMMENT } from '../../realtime/
|
|
54
|
+
import { SSE_CONNECTED_COMMENT } from '../../realtime/sse_constants.js';
|
|
55
55
|
import { create_sse_transport } from '../transports/sse_transport.js';
|
|
56
56
|
import { create_rpc_post_init } from '../rpc_helpers.js';
|
|
57
57
|
import { test_if } from './capabilities.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing_reset_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/testing_reset_actions.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAa,KAAK,SAAS,EAAC,MAAM,6BAA6B,CAAC;AAIvE,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"testing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AW,2BAA2B;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACjD;;;;;OAKG;IACH,QAAQ,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;IAC9C;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACxD;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,GAClC,MAAM,OAAO,EACb,SAAS,2BAA2B,KAClC,KAAK,CAAC,SAAS,CAqIjB,CAAC;AAEF,0FAA0F;AAC1F,eAAO,MAAM,0BAA0B,UAAmC,CAAC"}
|
|
@@ -67,7 +67,8 @@ import { ROLE_ADMIN, ROLE_KEEPER } from '../../auth/role_schema.js';
|
|
|
67
67
|
import { auth_integration_truncate_tables } from '../db.js';
|
|
68
68
|
import { query_schema_snapshot, SchemaSnapshot } from '../schema_introspect.js';
|
|
69
69
|
import { query_create_actor } from '../../auth/account_queries.js';
|
|
70
|
-
import { create_test_account_with_credentials, mint_test_session
|
|
70
|
+
import { create_test_account_with_credentials, mint_test_session } from '../app_server.js';
|
|
71
|
+
import { DEFAULT_TEST_PASSWORD } from '../test_credentials.js';
|
|
71
72
|
/**
|
|
72
73
|
* Shared `auth` axis for every `_testing_*` action: keeper-only via the
|
|
73
74
|
* daemon-token credential, no acting actor. This is the entire structural
|
|
@@ -23,9 +23,9 @@ import { ErrorCoverageCollector, assert_error_coverage, DEFAULT_INTEGRATION_ERRO
|
|
|
23
23
|
import { is_public_auth } from '../http/auth_shape.js';
|
|
24
24
|
import { account_verify_action_spec, account_session_list_action_spec, account_session_revoke_action_spec, account_session_revoke_all_action_spec, account_token_create_action_spec, account_token_list_action_spec, account_token_revoke_action_spec, } from '../auth/account_action_specs.js';
|
|
25
25
|
import { invite_create_action_spec } from '../auth/admin_action_specs.js';
|
|
26
|
-
import { LoginOutput, AccountStatusOutput } from '../auth/
|
|
26
|
+
import { LoginOutput, AccountStatusOutput } from '../auth/account_route_schema.js';
|
|
27
27
|
import {} from './cross_backend/capabilities.js';
|
|
28
|
-
import { DEFAULT_TEST_PASSWORD } from './
|
|
28
|
+
import { DEFAULT_TEST_PASSWORD } from './test_credentials.js';
|
|
29
29
|
/**
|
|
30
30
|
* Standard integration test suite for fuz_app auth routes.
|
|
31
31
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;GAQG;AAEH,OAAO,EAAC,EAAE,EAAyB,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAC1B,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;GAQG;AAEH,OAAO,EAAC,EAAE,EAAyB,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAC1B,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAe3B,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAsB,KAAK,cAAc,EAAC,MAAM,4BAA4B,CAAC;AA2BpF,gEAAgE;AAChE,MAAM,WAAW,qBAAqB;IACrC,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,oEAAoE;IACpE,WAAW,CAAC,EAAE,cAAc,CAAC;IAC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;;;;;;;;GASG;AACH,eAAO,MAAM,gCAAgC,GAC5C,UAAU,0BAA0B,KAClC,sBA4DF,CAAC"}
|
|
@@ -15,7 +15,8 @@ import { create_bearer_auth_middleware } from '../auth/bearer_auth.js';
|
|
|
15
15
|
import { query_validate_api_token } from '../auth/api_token_queries.js';
|
|
16
16
|
import { query_account_by_id, query_actor_by_id, query_actors_by_account, } from '../auth/account_queries.js';
|
|
17
17
|
import { query_role_grant_find_active_for_actor } from '../auth/role_grant_queries.js';
|
|
18
|
-
import { create_proxy_middleware
|
|
18
|
+
import { create_proxy_middleware } from '../http/proxy.js';
|
|
19
|
+
import { get_client_ip } from '../http/client_ip.js';
|
|
19
20
|
import { verify_request_source, parse_allowed_origins } from '../http/origin.js';
|
|
20
21
|
import { REQUEST_CONTEXT_KEY } from '../auth/request_context.js';
|
|
21
22
|
import { ACCOUNT_ID_KEY, AUTH_API_TOKEN_ID_KEY, CREDENTIAL_TYPE_KEY, TEST_CONTEXT_PRESET_KEY, } from '../hono_context.js';
|
|
@@ -2,7 +2,7 @@ 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
4
|
import type { SessionOptions } from '../auth/session_cookie.js';
|
|
5
|
-
import {
|
|
5
|
+
import type { EventSpec } from '../realtime/sse.js';
|
|
6
6
|
import type { AuditLogEvent } from '../auth/audit_log_schema.js';
|
|
7
7
|
import { type SuiteAppOptions, type TestApp, type TestAccount } from './app_server.js';
|
|
8
8
|
import { type DbFactory } from './db.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse_round_trip.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/sse_round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAmB7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,M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C,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,iDAAiD;IACjD,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,qEAAqE;IACrE,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAChD;;;;;;;;;;;;OAYG;IACH,aAAa,EAAE,uBAAuB,CAAC;IACvC,8BAA8B;IAC9B,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CAChC;AA+CD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS,mBAAmB,KAAG,IAgIvE,CAAC"}
|
|
@@ -14,7 +14,7 @@ import './assert_dev_env.js';
|
|
|
14
14
|
* @module
|
|
15
15
|
*/
|
|
16
16
|
import { describe, test, beforeAll, afterAll, assert } from 'vitest';
|
|
17
|
-
import { SSE_CONNECTED_COMMENT } from '../realtime/
|
|
17
|
+
import { SSE_CONNECTED_COMMENT } from '../realtime/sse_constants.js';
|
|
18
18
|
import { ROLE_ADMIN } from '../auth/role_schema.js';
|
|
19
19
|
import { create_audit_emitter } from '../auth/audit_emitter.js';
|
|
20
20
|
import { create_test_app, } from './app_server.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stubs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/stubs.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAE3B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAC,YAAY,EAAC,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IACH,YAAY,CAAC,EACV,aAAa,CAAC,cAAc,CAAC,GAC7B,CAAC,CAAC,GAAG,EAAE,gBAAgB,KAAK,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC;IAC9D,mFAAmF;IACnF,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,KAAK,CAAC,cAAc,CAAC,CAAC;IAC/E;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,4BAA4B,GACxC,SAAS,+BAA+B,KACtC,cAmDF,CAAC"}
|
package/dist/testing/stubs.js
CHANGED
|
@@ -11,7 +11,7 @@ import { Logger } from '@fuzdev/fuz_util/log.js';
|
|
|
11
11
|
import { ApiError, RateLimitError } from '../http/error_schemas.js';
|
|
12
12
|
import { Db } from '../db/db.js';
|
|
13
13
|
import { prefix_route_specs } from '../http/route_spec.js';
|
|
14
|
-
import {
|
|
14
|
+
import { bootstrap_route_shape } from '../auth/bootstrap_route_schema.js';
|
|
15
15
|
import { create_rpc_endpoint } from '../actions/action_rpc.js';
|
|
16
16
|
import { create_app_surface_spec, } from '../http/surface.js';
|
|
17
17
|
import { AUDIT_LOG_SSE_MAX_PER_SCOPE } from '../realtime/sse_auth_guard.js';
|
|
@@ -244,14 +244,12 @@ export const create_test_app_surface_spec = (options) => {
|
|
|
244
244
|
// short-circuits to 403 ALREADY_BOOTSTRAPPED, which is what surface tests
|
|
245
245
|
// assert on. Live token_path is passed through for shape symmetry only.
|
|
246
246
|
const bootstrap_route_specs = options.bootstrap && options.bootstrap.mode !== 'disabled'
|
|
247
|
-
? prefix_route_specs(options.bootstrap.route_prefix ?? '/api/account',
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
ip_rate_limiter: null,
|
|
254
|
-
}))
|
|
247
|
+
? prefix_route_specs(options.bootstrap.route_prefix ?? '/api/account', [
|
|
248
|
+
// Surface generation reads the route shape only — the live hono
|
|
249
|
+
// handler never runs here, so a stub satisfies the RouteSpec type
|
|
250
|
+
// without pulling the in-process Hono app onto cross-process consumers.
|
|
251
|
+
{ ...bootstrap_route_shape, handler: stub_handler },
|
|
252
|
+
])
|
|
255
253
|
: [];
|
|
256
254
|
const route_specs = [...consumer_routes, ...rpc_route_specs, ...bootstrap_route_specs];
|
|
257
255
|
let middleware_specs = create_stub_api_middleware();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import './assert_dev_env.js';
|
|
2
|
+
/**
|
|
3
|
+
* Shared test credential constants — deliberately hono-free.
|
|
4
|
+
*
|
|
5
|
+
* `DEFAULT_TEST_PASSWORD` is the single source of truth for the password
|
|
6
|
+
* the in-process and cross-process test fixtures bootstrap and log in with.
|
|
7
|
+
* It lives in this leaf module (rather than `app_server.ts`) so the
|
|
8
|
+
* cross-process setup helpers can import it **without** pulling in the
|
|
9
|
+
* in-process Hono test app — `app_server.ts` transitively reaches
|
|
10
|
+
* `create_app_server` (`new Hono()`), so any value import from it forces the
|
|
11
|
+
* optional `hono` peer onto Rust-only consumers whose cross-process suites
|
|
12
|
+
* never spawn the TS backend.
|
|
13
|
+
*
|
|
14
|
+
* Single-sourcing the constant keeps the in-process bootstrap, the
|
|
15
|
+
* cross-process `mint_account` signup/login, and the integration suite's
|
|
16
|
+
* hardcoded login bodies from drifting — a divergence becomes a typecheck
|
|
17
|
+
* miss rather than a runtime password mismatch.
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
21
|
+
/** Default password for test-bootstrapped accounts. */
|
|
22
|
+
export declare const DEFAULT_TEST_PASSWORD = "test-password-123";
|
|
23
|
+
//# sourceMappingURL=test_credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test_credentials.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/test_credentials.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;;;;;;GAkBG;AAEH,uDAAuD;AACvD,eAAO,MAAM,qBAAqB,sBAAsB,CAAC"}
|