testing/cross_backend/ts_spine_backend_config.ts

Cross-process BackendConfig presets for fuz_app's domain-free TS spine test binary (src/test/cross_backend/testing_spine_server_{node,bun}.ts).

The TS analog of rust_spine_stub_backend_config (which spawns the Rust spine): these spawn fuz_app's own TS impl over real HTTP with no domain layer, so the cross_backend_ts_node / cross_backend_ts_bun self-test projects verify fuz_app's wire path in its own repo on both JS runtimes. All run against in-memory pglet (memory://) — no external Postgres, unlike the Rust path.

The binary writes its daemon token to {FUZ_TESTING_TS_SPINE_DIR}/run/daemon_token; anchoring the dir to paths.root makes that equal paths.daemon_token_path, which spawn_backend reads after the health probe.

view source

Declarations
#

7 declarations

ts_spine_bun_backend_config
#

TS_SPINE_BUN_DEFAULT_PORT
#

TS_SPINE_BUN_ENTRY
#

ts_spine_node_backend_config
#

TS_SPINE_NODE_DEFAULT_PORT
#

TS_SPINE_NODE_ENTRY
#

TsSpineBackendConfigOptions
#

testing/cross_backend/ts_spine_backend_config.ts view source

TsSpineBackendConfigOptions import type {TsSpineBackendConfigOptions} from '@fuzdev/fuz_app/testing/cross_backend/ts_spine_backend_config.js';

port?

Listening port. Defaults per runtime (1178 Node, 1180 Bun).

type number

readonly

database_url?

Database URL. Default 'memory://' (in-memory pglet).

type string

readonly

name?

Backend name — labels the spawn in errors and logs, and names its directory under os.tmpdir() (default_test_backend_paths, namespaced by the running repo). Defaults per runtime (ts_spine_node, ts_spine_bun). Give each backend spawned alongside another of its runtime its own name, so their bootstrap and daemon-token files don't collide.

type string

readonly

enable_login_rate_limit?

Enable the per-IP + per-account login rate limiters on the spawned binary (FUZ_LOGIN_RATE_LIMIT_ENABLED=true). Off by default — the standard cross suites fire many loopback logins a live limiter would 429. Set true only for the dedicated login-security cross project (global_setup_login_security.ts), which drives the 429 + Retry-After path and XFF-keyed bucketing over the wire (login_security.ts). The binary always wires trusted_proxies for 127.0.0.1/::1, so the limiter keys on the resolved X-Forwarded-For client IP. Mirrors SpineStubBackendConfigOptions.enable_login_rate_limit.

type boolean

readonly

enable_action_rate_limit?

Enable the action rate limiters (FUZ_ACTION_RATE_LIMIT_ENABLED=true) — one per-IP and one per-account limiter shared by the RPC and WS endpoints. Off by default, like enable_login_rate_limit; set only for the dedicated security cross project, which drives them through ws_action_rate_limit.ts. Mirrors SpineStubBackendConfigOptions.enable_action_rate_limit.

type boolean

readonly

action_rate_limit_max_attempts?

Replace both action limiters' max_attempts (FUZ_ACTION_RATE_LIMIT_MAX_ATTEMPTS) so a suite reaches the cap in a few calls. Requires enable_action_rate_limit — the binary refuses to boot otherwise. Mirrors SpineStubBackendConfigOptions.action_rate_limit_max_attempts.

type number

readonly

audit_sse_keep_alive_ms?

Replace the audit stream's keep-alive interval (FUZ_AUDIT_SSE_KEEP_ALIVE_MS), so a suite sees keep-alives without waiting out the 15 s default. Mirrors SpineStubBackendConfigOptions.audit_sse_keep_alive_ms.

type number

readonly

ws_receive_timeout_ms?

Replace the WS endpoints' receive timeout (FUZ_WS_RECEIVE_TIMEOUT_MS), so a suite sees a silent socket closed without waiting out the 60 s default. Mirrors SpineStubBackendConfigOptions.ws_receive_timeout_ms.

type number

readonly

db_checkout_timeout_ms?

Replace the request pool checkout bound (FUZ_DB_CHECKOUT_TIMEOUT_MS). Postgres only — over memory:// the binary warns and runs unbounded. Mirrors SpineStubBackendConfigOptions.db_checkout_timeout_ms.

type number

readonly

db_audit_checkout_timeout_ms?

Replace the audit write pool checkout bound (FUZ_DB_AUDIT_CHECKOUT_TIMEOUT_MS), Postgres only. Mirrors SpineStubBackendConfigOptions.db_audit_checkout_timeout_ms.

type number

readonly

Depends on
#