@fuzdev/fuz_app 0.88.0 → 0.90.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/auth/account_action_specs.d.ts +1 -1
- package/dist/auth/account_route_schema.d.ts +12 -6
- package/dist/auth/account_route_schema.d.ts.map +1 -1
- package/dist/auth/account_route_schema.js +11 -5
- package/dist/auth/account_routes.d.ts +18 -4
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +13 -5
- package/dist/auth/account_schema.d.ts +3 -3
- package/dist/auth/admin_action_specs.d.ts +8 -8
- package/dist/auth/audit_log_schema.d.ts +1 -1
- package/dist/auth/invite_schema.d.ts +2 -2
- package/dist/auth/signup_route_schema.d.ts +2 -2
- package/dist/auth/signup_route_schema.d.ts.map +1 -1
- package/dist/auth/signup_route_schema.js +2 -2
- package/dist/primitive_schemas.d.ts +27 -1
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +55 -2
- package/dist/server/env.d.ts +1 -1
- package/dist/server/env.d.ts.map +1 -1
- package/dist/server/env.js +15 -3
- package/dist/testing/CLAUDE.md +62 -2
- package/dist/testing/app_server.d.ts +16 -5
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +3 -1
- package/dist/testing/cross_backend/body_size_smuggling.d.ts +12 -0
- package/dist/testing/cross_backend/body_size_smuggling.d.ts.map +1 -1
- package/dist/testing/cross_backend/body_size_smuggling.js +68 -41
- package/dist/testing/cross_backend/capabilities.d.ts +29 -0
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +15 -0
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +13 -0
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +7 -0
- package/dist/testing/cross_backend/identity_parity.d.ts +13 -0
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -0
- package/dist/testing/cross_backend/identity_parity.js +465 -0
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.js +13 -6
- package/dist/testing/cross_backend/setup.d.ts +9 -0
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +14 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +16 -1
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +13 -16
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +7 -0
- package/package.json +3 -3
|
@@ -48,6 +48,8 @@ export interface CreateTestAccountWithCredentialsOptions {
|
|
|
48
48
|
username?: string;
|
|
49
49
|
password_value?: string;
|
|
50
50
|
roles?: Array<string>;
|
|
51
|
+
/** Optional email stored on the account row — exercises the username-or-email login lookup. */
|
|
52
|
+
email?: string;
|
|
51
53
|
}
|
|
52
54
|
/** Alias for the keeper-flavored call site. Same shape. */
|
|
53
55
|
export type BootstrapTestKeeperOptions = CreateTestAccountWithCredentialsOptions;
|
|
@@ -269,6 +271,19 @@ export interface TestAccount {
|
|
|
269
271
|
/** Build request headers with this account's Bearer token. */
|
|
270
272
|
create_bearer_headers: (extra?: Record<string, string>) => Record<string, string>;
|
|
271
273
|
}
|
|
274
|
+
/**
|
|
275
|
+
* Args for `TestApp.create_account` — mint an additional account alongside the
|
|
276
|
+
* keeper. Mirrors the cross-process `CreateTestAccountOptions` (the two
|
|
277
|
+
* `create_account` paths share a shape so fixture call sites read identically),
|
|
278
|
+
* kept local to avoid a cross-module cycle with `cross_backend/setup.ts`.
|
|
279
|
+
*/
|
|
280
|
+
export interface CreateTestAppAccountArgs {
|
|
281
|
+
username?: string;
|
|
282
|
+
password_value?: string;
|
|
283
|
+
roles?: Array<string>;
|
|
284
|
+
/** Optional email stored on the account row — exercises the username-or-email login lookup. */
|
|
285
|
+
email?: string;
|
|
286
|
+
}
|
|
272
287
|
/**
|
|
273
288
|
* A fully assembled test app — Hono app + backend + helpers.
|
|
274
289
|
*/
|
|
@@ -285,11 +300,7 @@ export interface TestApp {
|
|
|
285
300
|
/** Build request headers with the daemon token (keeper auth). */
|
|
286
301
|
create_daemon_token_headers: (extra?: Record<string, string>) => Record<string, string>;
|
|
287
302
|
/** Create an additional account with credentials. */
|
|
288
|
-
create_account: (options?:
|
|
289
|
-
username?: string;
|
|
290
|
-
password_value?: string;
|
|
291
|
-
roles?: Array<string>;
|
|
292
|
-
}) => Promise<TestAccount>;
|
|
303
|
+
create_account: (options?: CreateTestAppAccountArgs) => Promise<TestAccount>;
|
|
293
304
|
/** Cleanup resources (delegates to TestAppServer.cleanup). */
|
|
294
305
|
cleanup: () => Promise<void>;
|
|
295
306
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app_server.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/app_server.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAG/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAIjD,OAAO,EAA2B,KAAK,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAE1E,OAAO,KAAK,EAAC,EAAE,EAAE,MAAM,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAU1D,OAAO,EAA8B,KAAK,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EAAiB,KAAK,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAEzE,OAAO,EAAwB,KAAK,UAAU,EAAE,KAAK,YAAY,EAAC,MAAM,0BAA0B,CAAC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B,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnF,4EAA4E;IAC5E,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,6BAA6B,GACzC,SAAS,gCAAgC,KACvC,OAAO,CAAC,mBAAmB,CAuE7B,CAAC"}
|
|
@@ -78,12 +78,13 @@ const resolve_fallback_factory = (migration_namespaces) => {
|
|
|
78
78
|
* `role_grant` (one per role), `api_token`, and `auth_session`.
|
|
79
79
|
*/
|
|
80
80
|
export const create_test_account_with_credentials = async (options) => {
|
|
81
|
-
const { db, keyring, session_options, password, username = 'keeper', password_value = DEFAULT_TEST_PASSWORD, roles = [], } = options;
|
|
81
|
+
const { db, keyring, session_options, password, username = 'keeper', password_value = DEFAULT_TEST_PASSWORD, roles = [], email, } = options;
|
|
82
82
|
const deps = { db };
|
|
83
83
|
const password_hash = await password.hash_password(password_value);
|
|
84
84
|
const { account, actor } = await query_create_account_with_actor(deps, {
|
|
85
85
|
username,
|
|
86
86
|
password_hash,
|
|
87
|
+
...(email !== undefined && { email }),
|
|
87
88
|
});
|
|
88
89
|
// Grant roles
|
|
89
90
|
for (const role of roles) {
|
|
@@ -315,6 +316,7 @@ export const create_test_app = async (options) => {
|
|
|
315
316
|
username: account_options?.username ?? `test_user_${account_counter}`,
|
|
316
317
|
password_value: account_options?.password_value ?? DEFAULT_TEST_PASSWORD,
|
|
317
318
|
roles: account_options?.roles ?? [],
|
|
319
|
+
...(account_options?.email !== undefined && { email: account_options.email }),
|
|
318
320
|
});
|
|
319
321
|
return {
|
|
320
322
|
...bootstrapped,
|
|
@@ -5,6 +5,18 @@ export interface BodySizeSmugglingCrossTestOptions {
|
|
|
5
5
|
readonly base_url: string;
|
|
6
6
|
/** RPC endpoint path to target. Default `/api/rpc`. */
|
|
7
7
|
readonly rpc_path?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the backend closes the connection on an oversized-body reject
|
|
10
|
+
* without reading the body (`capabilities.oversized_reject_closes_connection`).
|
|
11
|
+
* `true` (default) demands the strong posture — the pipelined GET is never
|
|
12
|
+
* reached, so **at most one** response comes back. `false` (Bun) relaxes to
|
|
13
|
+
* the no-desync property: the body is drained on `Content-Length` and the
|
|
14
|
+
* pipelined GET is framed correctly, so **at most two** responses come back
|
|
15
|
+
* and the body bytes are never reparsed as a request. Default `true` so a
|
|
16
|
+
* consumer that forgets to declare the flag fails loud rather than silently
|
|
17
|
+
* accepting a drain.
|
|
18
|
+
*/
|
|
19
|
+
readonly closes_connection?: boolean;
|
|
8
20
|
}
|
|
9
21
|
export declare const describe_body_size_smuggling_cross_tests: (options: BodySizeSmugglingCrossTestOptions) => void;
|
|
10
22
|
//# sourceMappingURL=body_size_smuggling.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body_size_smuggling.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/body_size_smuggling.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"body_size_smuggling.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/body_size_smuggling.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA0D9B,4EAA4E;AAC5E,MAAM,WAAW,iCAAiC;IACjD,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACrC;AAqDD,eAAO,MAAM,wCAAwC,GACpD,SAAS,iCAAiC,KACxC,IAiFF,CAAC"}
|
|
@@ -4,37 +4,45 @@ import '../assert_dev_env.js';
|
|
|
4
4
|
* handling — the security sibling of `body_size.ts`.
|
|
5
5
|
*
|
|
6
6
|
* When the server caps the request body it answers `413` on the
|
|
7
|
-
* `Content-Length` header
|
|
8
|
-
*
|
|
9
|
-
* keep-alive connection whose request body wasn't consumed, because
|
|
10
|
-
* body bytes would
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
7
|
+
* `Content-Length` header. The strong (defense-in-depth) posture is to close
|
|
8
|
+
* the connection *without reading the oversized body*: HTTP/1.1 forbids reusing
|
|
9
|
+
* a keep-alive connection whose request body wasn't consumed, because unread
|
|
10
|
+
* body bytes would be parsed as the start of the next request — a classic
|
|
11
|
+
* request-smuggling vector. This suite probes the boundary by **pipelining**:
|
|
12
|
+
* it opens a raw TCP socket and sends, in one write, an oversized `POST`
|
|
13
|
+
* immediately followed by a second `GET`. The assertion forks on the backend's
|
|
14
|
+
* declared `oversized_reject_closes_connection` capability:
|
|
15
|
+
*
|
|
16
|
+
* - **Closes (Node / Deno / hyper)** — the reject closes the socket with the
|
|
17
|
+
* GET bytes unconsumed, so **at most one** response comes back. `<= 1` rather
|
|
18
|
+
* than "exactly the 413" because the impls close differently at the TCP level
|
|
19
|
+
* (node-server graceful close delivers the 413 first; hyper's RST can drop the
|
|
20
|
+
* in-flight 413 before the client reads it), so demanding a cleanly-read 413
|
|
21
|
+
* would be flaky.
|
|
22
|
+
* - **Drains + keepalives (Bun)** — `Bun.serve` reads the full declared
|
|
23
|
+
* `Content-Length` body and answers the *correctly-framed* pipelined GET, so
|
|
24
|
+
* **two** responses come back. This is **not** a smuggle: the GET is delimited
|
|
25
|
+
* by the body's `Content-Length`, not the unread body reinterpreted as a
|
|
26
|
+
* request — Bun answers it with a clean `400` (`missing method`), not the `x`
|
|
27
|
+
* body bytes reparsed. The security property asserted here is **no desync**
|
|
28
|
+
* (`<= 2`): a real desync would reframe the 1 MiB of `x` into bogus request
|
|
29
|
+
* lines and push the count past two.
|
|
30
|
+
*
|
|
31
|
+
* Either way the oversized body is rejected *with* a 413 — pinned reliably over
|
|
32
|
+
* `fetch` by `describe_body_size_cross_tests`; this test owns only the
|
|
33
|
+
* connection-handling half. A **positive control** (two pipelined requests →
|
|
34
|
+
* `>= 2` responses) proves a second response *would* be seen if a trailing
|
|
35
|
+
* request were processed — without it the close-posture `<= 1` would be vacuous
|
|
36
|
+
* on a server that never reuses connections — and that the counter isn't
|
|
37
|
+
* undercounting.
|
|
27
38
|
*
|
|
28
39
|
* Raw-socket by necessity (the `FetchTransport` can't pipeline two requests on
|
|
29
40
|
* one connection), so — unlike `body_size.ts` — this is **cross-process only**
|
|
30
|
-
* (no in-process leg; there is no socket in-process)
|
|
31
|
-
*
|
|
32
|
-
* socket closes or a short read timeout, so a server that closes (the expected
|
|
33
|
-
* path) and one that merely holds the connection open without smuggling both
|
|
34
|
-
* read as one response; only an actual second response fails.
|
|
41
|
+
* (no in-process leg; there is no socket in-process). The connection-close half
|
|
42
|
+
* is capability-gated; the no-desync half holds on every spine.
|
|
35
43
|
*
|
|
36
|
-
* Cited property: `docs/security.md` §"Body Size Limiting" (connection
|
|
37
|
-
* oversized reject).
|
|
44
|
+
* Cited property: `docs/security.md` §"Body Size Limiting" (connection handling
|
|
45
|
+
* on oversized reject).
|
|
38
46
|
*
|
|
39
47
|
* `$lib`-free by contract (relative + `node:` specifiers only).
|
|
40
48
|
*
|
|
@@ -90,6 +98,7 @@ const count_responses = (raw) => (raw.match(/HTTP\/1\.[01] \d{3}/g) ?? []).lengt
|
|
|
90
98
|
export const describe_body_size_smuggling_cross_tests = (options) => {
|
|
91
99
|
const { base_url } = options;
|
|
92
100
|
const rpc_path = options.rpc_path ?? SPINE_RPC_PATH;
|
|
101
|
+
const closes_connection = options.closes_connection ?? true;
|
|
93
102
|
const host = new URL(base_url).host;
|
|
94
103
|
describe('body-size limit — request-smuggling resistance', () => {
|
|
95
104
|
// Positive control: prove the server returns >1 response on a single
|
|
@@ -118,21 +127,39 @@ export const describe_body_size_smuggling_cross_tests = (options) => {
|
|
|
118
127
|
'x'.repeat(oversized_len) +
|
|
119
128
|
`GET ${rpc_path} HTTP/1.1\r\nHost: ${host}\r\n\r\n`;
|
|
120
129
|
const response = await send_raw(base_url, payload, 2000);
|
|
121
|
-
// The security property is "the pipelined GET is not processed", i.e.
|
|
122
|
-
// **at most one** response comes back (the 413, or none if the close
|
|
123
|
-
// raced the read). A *second* response is the smuggle. We assert `<= 1`
|
|
124
|
-
// rather than "exactly the 413" because the two impls close the
|
|
125
|
-
// connection differently at the TCP level — node-server closes
|
|
126
|
-
// gracefully (the 413 is delivered first), hyper sends an RST that can
|
|
127
|
-
// drop the in-flight 413 before the client reads it — and demanding a
|
|
128
|
-
// cleanly-read 413 here would be flaky. That the oversized body is
|
|
129
|
-
// rejected *with* a 413 is pinned reliably (over `fetch`) by
|
|
130
|
-
// `describe_body_size_cross_tests`; this test owns only the no-smuggle
|
|
131
|
-
// half. The control above proves a second response *would* be seen if
|
|
132
|
-
// the GET were processed, so `<= 1` is a real signal, not a vacuous one.
|
|
133
130
|
const n = count_responses(response);
|
|
134
|
-
|
|
135
|
-
|
|
131
|
+
if (closes_connection) {
|
|
132
|
+
// Strong posture (Node / Deno / hyper): the reject closes the
|
|
133
|
+
// connection *without reading the body*, so the pipelined GET is
|
|
134
|
+
// never reached — **at most one** response comes back (the 413, or
|
|
135
|
+
// none if the close raced the read). A *second* response would mean
|
|
136
|
+
// the body was drained and the GET processed. We assert `<= 1` rather
|
|
137
|
+
// than "exactly the 413" because the impls close differently at the
|
|
138
|
+
// TCP level — node-server closes gracefully (413 delivered first),
|
|
139
|
+
// hyper sends an RST that can drop the in-flight 413 before the client
|
|
140
|
+
// reads it — and demanding a cleanly-read 413 would be flaky. The
|
|
141
|
+
// 413-ness itself is pinned reliably (over `fetch`) by
|
|
142
|
+
// `describe_body_size_cross_tests`. The control above proves a second
|
|
143
|
+
// response *would* be seen if the GET were processed, so `<= 1` is a
|
|
144
|
+
// real signal, not vacuous.
|
|
145
|
+
assert.ok(n <= 1, `expected at most one response (oversized reject closes the connection; the ` +
|
|
146
|
+
`pipelined GET must not be reached). Saw ${n}. Raw head: ${response.slice(0, 120)}`);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
// Drain-and-keepalive posture (Bun): `Bun.serve` reads the full
|
|
150
|
+
// declared `Content-Length` body and keeps the socket alive, so it
|
|
151
|
+
// answers the *correctly-framed* pipelined GET — **two** responses
|
|
152
|
+
// (the 413 + a well-formed reply to the GET). This is not a smuggle:
|
|
153
|
+
// the GET is delimited by the body's `Content-Length`, not the unread
|
|
154
|
+
// body reinterpreted as request bytes. The security property here is
|
|
155
|
+
// **no desync** — the body bytes are never reparsed as request(s). A
|
|
156
|
+
// real desync would reframe the 1 MiB of `x` into bogus request
|
|
157
|
+
// lines, pushing the count past two; `<= 2` is the no-desync bound,
|
|
158
|
+
// and the control above proves the counter isn't undercounting.
|
|
159
|
+
assert.ok(n <= 2, `expected at most two responses (the 413 + one framed reply to the ` +
|
|
160
|
+
`pipelined GET); more means the oversized body was reparsed as requests ` +
|
|
161
|
+
`(a desync). Saw ${n}. Raw head: ${response.slice(0, 120)}`);
|
|
162
|
+
}
|
|
136
163
|
});
|
|
137
164
|
});
|
|
138
165
|
};
|
|
@@ -99,6 +99,35 @@ export interface BackendCapabilities {
|
|
|
99
99
|
* readiness parity coverage. The drift → `503` path stays per-impl unit tests.
|
|
100
100
|
*/
|
|
101
101
|
readonly ready: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* The account surface serves `GET /api/account/status` (account info +
|
|
104
|
+
* `bootstrap_available` flag). Bundled into `create_account_route_specs`, so
|
|
105
|
+
* any backend mounting the account routes serves it — `true` for every
|
|
106
|
+
* spine. Gates the `account status response body` case in
|
|
107
|
+
* `describe_standard_integration_tests`: when `true` the case asserts the
|
|
108
|
+
* route is present (fail-loud on 404, no silent skip); when `false` it skips
|
|
109
|
+
* explicitly (a backend that deliberately omits the route).
|
|
110
|
+
*/
|
|
111
|
+
readonly account_status: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* On an oversized-body `413` reject the backend **closes the connection
|
|
114
|
+
* without reading the body** (the defense-in-depth posture), rather than
|
|
115
|
+
* draining the declared `Content-Length` and keeping the socket alive.
|
|
116
|
+
* Gates the strong half of `describe_body_size_smuggling_cross_tests`: when
|
|
117
|
+
* `true`, the pipelined GET is never reached (at most one response); when
|
|
118
|
+
* `false`, the suite instead asserts the weaker but still-load-bearing
|
|
119
|
+
* no-desync property (the body is framed on `Content-Length`, not reparsed
|
|
120
|
+
* as request bytes).
|
|
121
|
+
*
|
|
122
|
+
* `true` for the Node / Deno (`@hono/node-server` graceful close) and Rust
|
|
123
|
+
* (hyper RST) backends; `false` for Bun — `Bun.serve` reads the full body
|
|
124
|
+
* and processes the correctly-framed pipelined request even when the `413`
|
|
125
|
+
* carries `Connection: close`. Bun is not insecure (no desync — it answers
|
|
126
|
+
* the cleanly-delimited GET with a proper `400`); the flag records the
|
|
127
|
+
* connection-handling divergence so the suite stays green without losing the
|
|
128
|
+
* smuggle detector. See `docs/security.md` §"Body Size Limiting".
|
|
129
|
+
*/
|
|
130
|
+
readonly oversized_reject_closes_connection: boolean;
|
|
102
131
|
}
|
|
103
132
|
/**
|
|
104
133
|
* Capability declarations for the in-process Hono transport. Every flag
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAgC9B;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;;;;;;OASG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B;;;;;;;;OAQG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC;;;;;;;OAOG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;;;;;;OAQG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC;;;;;;;;OAQG;IACH,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,kCAAkC,EAAE,OAAO,CAAC;CACrD;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,mBAapC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,OAAO,EAAE,MAAM,MAAM,EAAE,IAAI,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAG,IAMrF,CAAC"}
|
|
@@ -11,6 +11,19 @@ import '../assert_dev_env.js';
|
|
|
11
11
|
* capability `true` (see `in_process_capabilities`). Cross-process
|
|
12
12
|
* backends opt in per-flag on their `BackendConfig`.
|
|
13
13
|
*
|
|
14
|
+
* **Where the per-backend declarations live** (this file owns only the
|
|
15
|
+
* vocabulary + the in-process preset):
|
|
16
|
+
*
|
|
17
|
+
* - `in_process_capabilities` — here; every flag `true`.
|
|
18
|
+
* - `ts_default_capabilities` / `rust_default_capabilities` — consumer-facing
|
|
19
|
+
* family defaults, in `default_backend_configs.ts` (full literals, so adding
|
|
20
|
+
* a capability is a compile error until each family declares it).
|
|
21
|
+
* - `ts_spine_capabilities` / `ts_spine_bun_capabilities` — fuz_app's own TS
|
|
22
|
+
* spine presets, in `ts_spine_backend_config.ts` (deltas off the family
|
|
23
|
+
* default; Bun flips `oversized_reject_closes_connection`).
|
|
24
|
+
* - `rust_spine_stub_capabilities` — fuz_app's Rust spine-stub preset, in
|
|
25
|
+
* `rust_spine_stub_backend_config.ts` (delta off the rust family default).
|
|
26
|
+
*
|
|
14
27
|
* @module
|
|
15
28
|
*/
|
|
16
29
|
import { test } from 'vitest';
|
|
@@ -31,6 +44,8 @@ export const in_process_capabilities = Object.freeze({
|
|
|
31
44
|
account_lifecycle: true,
|
|
32
45
|
fact_serving: true,
|
|
33
46
|
ready: true,
|
|
47
|
+
account_status: true,
|
|
48
|
+
oversized_reject_closes_connection: true,
|
|
34
49
|
});
|
|
35
50
|
/**
|
|
36
51
|
* Conditional `test()` wrapper — registers a vitest case only when
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default_backend_configs.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/default_backend_configs.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAC,sBAAsB,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAC/E,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAA2B,KAAK,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAQ9F;;;;;GAKG;AACH,e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;OAMG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,GAC1C,MAAM,iCAAiC,KACrC,aAoCF,CAAC;AAEF,MAAM,WAAW,mCAAmC;IACnD,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,iEAAiE;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,+CAA+C;IAC/C,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAC5C,wEAAwE;IACxE,QAAQ,CAAC,KAAK,CAAC,EAAE,gBAAgB,CAAC;IAClC,sEAAsE;IACtE,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC/D;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,GAC5C,MAAM,mCAAmC,KACvC,aA4CF,CAAC"}
|
|
@@ -20,6 +20,13 @@ export const ts_default_capabilities = Object.freeze({
|
|
|
20
20
|
// Off by default like `sse` — a generic TS consumer backend may not mount
|
|
21
21
|
// `/ready`. fuz_app's own spine configs (`ts_spine_*`) opt in.
|
|
22
22
|
ready: false,
|
|
23
|
+
// `GET /api/account/status` is bundled into `create_account_route_specs`, so
|
|
24
|
+
// every TS backend mounting account routes serves it.
|
|
25
|
+
account_status: true,
|
|
26
|
+
// Node/Deno close the socket on an oversized-body reject (the default
|
|
27
|
+
// posture). A Bun-served consumer overrides to `false` (see the bun spine
|
|
28
|
+
// config) — fail-loud rather than silently skipping the smuggle detector.
|
|
29
|
+
oversized_reject_closes_connection: true,
|
|
23
30
|
});
|
|
24
31
|
/**
|
|
25
32
|
* Capabilities for the Rust family. Adds `trusted_proxy: true` (the
|
|
@@ -40,6 +47,12 @@ export const rust_default_capabilities = Object.freeze({
|
|
|
40
47
|
// Off by default like `sse`; the spine-stub preset opts in (it mounts
|
|
41
48
|
// `/ready` over the env-supplied fixture path).
|
|
42
49
|
ready: false,
|
|
50
|
+
// The Rust `account_router` bundles `/status` into the account routes, so
|
|
51
|
+
// every Rust spine serving the account surface serves it.
|
|
52
|
+
account_status: true,
|
|
53
|
+
// hyper sends an RST on the oversized-body reject — the connection closes
|
|
54
|
+
// and the pipelined request is never reached.
|
|
55
|
+
oversized_reject_closes_connection: true,
|
|
43
56
|
});
|
|
44
57
|
/** Bootstrap block built from the default secrets + supplied paths. */
|
|
45
58
|
const build_default_bootstrap = (paths, overrides) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default_spine_surface.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/default_spine_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAIpD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAqB,KAAK,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAwB,KAAK,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAIxF,OAAO,EAAqB,KAAK,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAC,cAAc,EAAE,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,oCAAoC,CAAC;AAGzE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAAC,MAAM,CAAwC,CAAC;AAElG;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AAEpD;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,gBAExB,CAAC;AAEH,iEAAiE;AACjE,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,4BAA4B,CAAC;AAExD,+CAA+C;AAC/C,MAAM,WAAW,wBAAwB;IACxC;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACzD;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB,GAC/B,KAAK,gBAAgB,EACrB,UAAU,wBAAwB,KAChC,KAAK,CAAC,eAAe,CAQvB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,GAAI,KAAK,gBAAgB,KAAG,KAAK,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"default_spine_surface.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/default_spine_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAIpD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAqB,KAAK,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAwB,KAAK,cAAc,EAAC,MAAM,8BAA8B,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 0,
|
|
83
|
+
bootstrap_status: ctx.bootstrap_status,
|
|
83
84
|
}),
|
|
84
85
|
...create_signup_route_specs(ctx.deps, {
|
|
85
86
|
session_options: spine_session_options,
|
|
86
87
|
ip_rate_limiter: null,
|
|
87
88
|
signup_account_rate_limiter: null,
|
|
89
|
+
// Disable the denial floor so the identity-parity suite's accepted
|
|
90
|
+
// cases (valid username/email, no invite → 403 no-matching-invite)
|
|
91
|
+
// don't each pay the 250ms timing floor. Mirrors `login_fail_floor_ms: 0`
|
|
92
|
+
// above — the floor is a production timing-oracle defense, not
|
|
93
|
+
// behavior any cross test asserts.
|
|
94
|
+
signup_fail_floor_ms: 0,
|
|
88
95
|
}),
|
|
89
96
|
]),
|
|
90
97
|
...(ctx.audit_sse
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import '../assert_dev_env.js';
|
|
2
|
+
import type { SetupTest } from './setup.js';
|
|
3
|
+
/** Options for the identity-primitive parity suite. */
|
|
4
|
+
export interface IdentityParityCrossTestOptions {
|
|
5
|
+
/** Per-test fixture producer (in-process or cross-process). */
|
|
6
|
+
readonly setup_test: SetupTest;
|
|
7
|
+
/** REST login route path. Default `/api/account/login` (the spine convention). */
|
|
8
|
+
readonly login_path?: string;
|
|
9
|
+
/** REST signup route path. Default `/api/account/signup` (the spine convention). */
|
|
10
|
+
readonly signup_path?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const describe_identity_parity_cross_tests: (options: IdentityParityCrossTestOptions) => void;
|
|
13
|
+
//# sourceMappingURL=identity_parity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity_parity.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/identity_parity.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAqG9B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AAkB1C,uDAAuD;AACvD,MAAM,WAAW,8BAA8B;IAC9C,+DAA+D;IAC/D,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,kFAAkF;IAClF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,oFAAoF;IACpF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B;AA0JD,eAAO,MAAM,oCAAoC,GAChD,SAAS,8BAA8B,KACrC,IA2TF,CAAC"}
|