testing/cross_backend/origin.ts

Cross-backend parity suite for Origin verification.

Origin checking is middleware that runs *before* the RPC dispatcher and refuses only an Origin it doesn't allow. The case here needs a transport that sends no Origin at all (fresh_transport({origin: null})), so this is an imperative suite rather than a conformance-table row. The case:

  • absent Origin → request passes — non-browser / direct-access clients (curl, CLI, server-to-server) carry no Origin and must not be blocked; token auth is the control for those callers.

A disallowed Origin → 403 forbidden_origin, on every transport, is pinned by the front-door table (transport_composition.ts).

Runs both legs via the shared setup_test protocol: the in-process leg (auth/origin_parity.db.test.ts, plain gro test) and the cross-process leg (cross_backend/spine_suites.cross.test.ts, the TS spine binaries + Rust testing_spine_stub over real HTTP). Origin middleware is on every spine, so the suite is ungated.

view source

Declarations
#

2 declarations

describe_origin_cross_tests
#

OriginCrossTestOptions
#

testing/cross_backend/origin.ts view source

RpcPathCrossSuiteOptions import type {OriginCrossTestOptions} from '@fuzdev/fuz_app/testing/cross_backend/origin.js';

Options for the origin parity suite. The standard RPC-dispatched cross-suite shape (setup_test / rpc_path); aliases the shared RpcPathCrossSuiteOptions rather than minting a duplicate. Origin middleware is on every spine, so no case is capability-gated and the flag bundle is not on the shape.

rpc_path?

RPC endpoint path the methods are mounted on. Default /api/rpc.

type string

readonly

setup_test

Per-test fixture-producing function (fresh keeper + db per call).

type (): Promise<TestFixture>

readonly
returns Promise<TestFixture>

Depends on
#

Imported by
#