@fuzdev/fuz_app 0.142.0 → 0.144.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/CLAUDE.md +8 -0
- package/dist/auth/cell_action_specs.d.ts +13 -0
- package/dist/auth/cell_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_action_specs.js +13 -0
- package/dist/auth/cell_actions.d.ts +7 -0
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_actions.js +30 -0
- package/dist/auth/cell_ref_admission.d.ts +51 -0
- package/dist/auth/cell_ref_admission.d.ts.map +1 -0
- package/dist/auth/cell_ref_admission.js +69 -0
- package/dist/auth/deps.d.ts +6 -3
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/db/CLAUDE.md +34 -21
- package/dist/db/cell_ddl.d.ts +3 -2
- package/dist/db/cell_ddl.d.ts.map +1 -1
- package/dist/db/cell_ddl.js +3 -2
- package/dist/db/cell_queries.d.ts +31 -6
- package/dist/db/cell_queries.d.ts.map +1 -1
- package/dist/db/cell_queries.js +45 -18
- package/dist/db/fact_ddl.d.ts +29 -4
- package/dist/db/fact_ddl.d.ts.map +1 -1
- package/dist/db/fact_ddl.js +43 -4
- package/dist/db/fact_holder_queries.d.ts +66 -0
- package/dist/db/fact_holder_queries.d.ts.map +1 -0
- package/dist/db/fact_holder_queries.js +75 -0
- package/dist/db/fact_queries.d.ts +9 -7
- package/dist/db/fact_queries.d.ts.map +1 -1
- package/dist/db/fact_store.d.ts +65 -9
- package/dist/db/fact_store.d.ts.map +1 -1
- package/dist/db/fact_store.js +49 -20
- package/dist/http/CLAUDE.md +1 -1
- package/dist/http/ip_canonical.d.ts +26 -2
- package/dist/http/ip_canonical.d.ts.map +1 -1
- package/dist/http/ip_canonical.js +107 -42
- package/dist/server/serve_fact_route.d.ts +24 -4
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +24 -4
- package/dist/testing/CLAUDE.md +31 -5
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.js +6 -3
- package/dist/testing/cross_backend/cell_gated_create.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_gated_create.js +25 -16
- package/dist/testing/cross_backend/cell_ref_admission.d.ts +4 -0
- package/dist/testing/cross_backend/cell_ref_admission.d.ts.map +1 -0
- package/dist/testing/cross_backend/cell_ref_admission.js +268 -0
- package/dist/testing/cross_backend/expected_schema.json +66 -10
- package/dist/testing/cross_backend/fact_serving.d.ts +19 -1
- package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
- package/dist/testing/cross_backend/fact_serving.js +31 -9
- package/dist/testing/cross_backend/full_spine_mount.js +2 -1
- package/dist/testing/cross_backend/origin_conformance.d.ts +1 -1
- package/dist/testing/cross_backend/origin_conformance.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin_conformance.js +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.d.ts +12 -20
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.js +12 -20
- package/dist/testing/cross_backend/testing_origin_check.d.ts +128 -0
- package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -0
- package/dist/testing/cross_backend/testing_origin_check.js +87 -0
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +13 -121
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +21 -95
- package/package.json +1 -1
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
import '../assert_dev_env.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* its eager `account_routes.ts` / `signup_routes.ts` imports — and through them
|
|
11
|
-
* `session_middleware` → `hono/cookie` — onto a backend-spawning consumer with
|
|
12
|
-
* no `hono` peer installed (a Rust-only spine consumer). Keeping these constants
|
|
13
|
-
* on this handler-free leaf lets such a consumer import the path without the
|
|
14
|
-
* peer. `default_spine_surface.ts` imports the ones it uses from here.
|
|
15
|
-
*
|
|
16
|
-
* The env-var names live here so both sides of each contract share one
|
|
17
|
-
* constant: the backend configs that set them (`default_backend_configs.ts`,
|
|
18
|
-
* `ts_spine_backend_config.ts`, `rust_spine_stub_backend_config.ts`) and the
|
|
19
|
-
* spawned TS spine binary that reads them, which imports this leaf rather than
|
|
20
|
-
* the config builders.
|
|
21
|
-
*
|
|
22
|
-
* @module
|
|
3
|
+
* Shared `auth` axis for every `_testing_*` action: keeper-only via the
|
|
4
|
+
* daemon-token credential, no acting actor. This is the entire structural
|
|
5
|
+
* fence on the backdoor surface (these actions run direct DB writes the
|
|
6
|
+
* production wire never exposes), so every `_testing_*` spec references this
|
|
7
|
+
* one const rather than re-declaring it — a single source of truth the gate test
|
|
8
|
+
* (`testing_actions_auth.test.ts`) pins. Mirrors the Rust `DAEMON_TOKEN_ONLY`
|
|
9
|
+
* / shared `AuthSpec` in `fuz_testing`.
|
|
23
10
|
*/
|
|
11
|
+
export declare const TESTING_ACTION_AUTH: {
|
|
12
|
+
readonly account: "required";
|
|
13
|
+
readonly actor: "none";
|
|
14
|
+
readonly credential_types: readonly ["daemon_token"];
|
|
15
|
+
};
|
|
24
16
|
/** RPC endpoint mount path — matches the binary's `/api/rpc`. */
|
|
25
17
|
export declare const SPINE_RPC_PATH = "/api/rpc";
|
|
26
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spine_surface_constants.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/spine_surface_constants.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"spine_surface_constants.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/spine_surface_constants.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA4B9B;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB;;;;CAIF,CAAC;AAE/B,iEAAiE;AACjE,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,4BAA4B,CAAC;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AAEpD;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,EAAE,aAAa,CAAC,MAAM,CAG1D,CAAC;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,EAAE,GAAwD,CAAC;AAEjG;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAE3E;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,kCAAkC,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC,uCAAuC,CAAC;AAEvF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,6BAA6B,CAAC"}
|
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
import '../assert_dev_env.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* its eager `account_routes.ts` / `signup_routes.ts` imports — and through them
|
|
11
|
-
* `session_middleware` → `hono/cookie` — onto a backend-spawning consumer with
|
|
12
|
-
* no `hono` peer installed (a Rust-only spine consumer). Keeping these constants
|
|
13
|
-
* on this handler-free leaf lets such a consumer import the path without the
|
|
14
|
-
* peer. `default_spine_surface.ts` imports the ones it uses from here.
|
|
15
|
-
*
|
|
16
|
-
* The env-var names live here so both sides of each contract share one
|
|
17
|
-
* constant: the backend configs that set them (`default_backend_configs.ts`,
|
|
18
|
-
* `ts_spine_backend_config.ts`, `rust_spine_stub_backend_config.ts`) and the
|
|
19
|
-
* spawned TS spine binary that reads them, which imports this leaf rather than
|
|
20
|
-
* the config builders.
|
|
21
|
-
*
|
|
22
|
-
* @module
|
|
3
|
+
* Shared `auth` axis for every `_testing_*` action: keeper-only via the
|
|
4
|
+
* daemon-token credential, no acting actor. This is the entire structural
|
|
5
|
+
* fence on the backdoor surface (these actions run direct DB writes the
|
|
6
|
+
* production wire never exposes), so every `_testing_*` spec references this
|
|
7
|
+
* one const rather than re-declaring it — a single source of truth the gate test
|
|
8
|
+
* (`testing_actions_auth.test.ts`) pins. Mirrors the Rust `DAEMON_TOKEN_ONLY`
|
|
9
|
+
* / shared `AuthSpec` in `fuz_testing`.
|
|
23
10
|
*/
|
|
11
|
+
export const TESTING_ACTION_AUTH = {
|
|
12
|
+
account: 'required',
|
|
13
|
+
actor: 'none',
|
|
14
|
+
credential_types: ['daemon_token']
|
|
15
|
+
};
|
|
24
16
|
/** RPC endpoint mount path — matches the binary's `/api/rpc`. */
|
|
25
17
|
export const SPINE_RPC_PATH = '/api/rpc';
|
|
26
18
|
/**
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import '../assert_dev_env.js';
|
|
2
|
+
/**
|
|
3
|
+
* `_testing_origin_check` — the testing seam behind the cross-impl origin
|
|
4
|
+
* conformance table (`origin_conformance.json`): its input and output schemas,
|
|
5
|
+
* the pure check it answers with, its spec, and the action builder.
|
|
6
|
+
*
|
|
7
|
+
* Split from `testing_reset_actions.ts`, whose other seams reach the
|
|
8
|
+
* in-process app server and through it the optional `hono` peer. This leaf is
|
|
9
|
+
* hono-free, so a consumer whose backend is a spawned Rust binary can run the
|
|
10
|
+
* conformance table without installing `hono`.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
import { type RpcAction } from '../../actions/action_rpc.js';
|
|
16
|
+
/** Input of `_testing_origin_check`. */
|
|
17
|
+
export declare const TestingOriginCheckInput: z.ZodObject<{
|
|
18
|
+
patterns: z.ZodString;
|
|
19
|
+
origin: z.ZodNullable<z.ZodString>;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
export type TestingOriginCheckInput = z.infer<typeof TestingOriginCheckInput>;
|
|
22
|
+
/**
|
|
23
|
+
* Output of `_testing_origin_check`: the request-level answer when the list
|
|
24
|
+
* parses, else every refusal — `index` the 1-based entry position, absent for
|
|
25
|
+
* a list-level refusal.
|
|
26
|
+
*/
|
|
27
|
+
export declare const TestingOriginCheckOutput: z.ZodUnion<readonly [z.ZodObject<{
|
|
28
|
+
ok: z.ZodLiteral<true>;
|
|
29
|
+
allowed: z.ZodBoolean;
|
|
30
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
31
|
+
ok: z.ZodLiteral<false>;
|
|
32
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
33
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
kind: z.ZodEnum<{
|
|
35
|
+
empty_entry: "empty_entry";
|
|
36
|
+
not_printable_ascii: "not_printable_ascii";
|
|
37
|
+
missing_scheme: "missing_scheme";
|
|
38
|
+
unsupported_scheme: "unsupported_scheme";
|
|
39
|
+
has_path: "has_path";
|
|
40
|
+
has_userinfo: "has_userinfo";
|
|
41
|
+
missing_host: "missing_host";
|
|
42
|
+
invalid_host_char: "invalid_host_char";
|
|
43
|
+
unbracketed_ipv6: "unbracketed_ipv6";
|
|
44
|
+
partial_wildcard: "partial_wildcard";
|
|
45
|
+
non_canonical_ipv4: "non_canonical_ipv4";
|
|
46
|
+
unclosed_ipv6: "unclosed_ipv6";
|
|
47
|
+
invalid_ipv6: "invalid_ipv6";
|
|
48
|
+
invalid_after_ipv6: "invalid_after_ipv6";
|
|
49
|
+
invalid_port: "invalid_port";
|
|
50
|
+
default_port: "default_port";
|
|
51
|
+
no_origins: "no_origins";
|
|
52
|
+
}>;
|
|
53
|
+
}, z.core.$strict>>;
|
|
54
|
+
}, z.core.$strict>]>;
|
|
55
|
+
export type TestingOriginCheckOutput = z.infer<typeof TestingOriginCheckOutput>;
|
|
56
|
+
/**
|
|
57
|
+
* Answer one `_testing_origin_check` input: parse `patterns` with
|
|
58
|
+
* `parse_allowed_origins`, then run the request-level check for one `Origin`
|
|
59
|
+
* carrying `origin` (`null` — no `Origin` — passes). The action handler and
|
|
60
|
+
* the conformance table's unit test both call this, so the table checks the
|
|
61
|
+
* same function the wire serves.
|
|
62
|
+
*
|
|
63
|
+
* @param input - the allowlist value and the `Origin` value
|
|
64
|
+
* @returns the answer the Rust twin returns for the same input
|
|
65
|
+
*/
|
|
66
|
+
export declare const run_testing_origin_check: (input: TestingOriginCheckInput) => TestingOriginCheckOutput;
|
|
67
|
+
/**
|
|
68
|
+
* `_testing_origin_check` — run the origin allowlist's parse and request
|
|
69
|
+
* check for one `{patterns, origin}` pair, so the shared conformance table
|
|
70
|
+
* (`origin_conformance.json`) checks each backend's grammar and matcher over
|
|
71
|
+
* the wire, row by row. Pure: no database, no state. The Rust mirror is
|
|
72
|
+
* `fuz_testing::create_testing_origin_check_action_spec`.
|
|
73
|
+
*
|
|
74
|
+
* Like `_testing_action_manifest`, it is **not** bundled by
|
|
75
|
+
* `create_testing_actions`: a consumer whose Rust binary doesn't mount the
|
|
76
|
+
* mirror would fail its action-manifest parity gate. The spine test binary
|
|
77
|
+
* appends it at the full-mount layer (`build_full_spine_rpc_actions`).
|
|
78
|
+
*
|
|
79
|
+
* `auth` gates on the daemon-token credential, matching `_testing_reset`.
|
|
80
|
+
*/
|
|
81
|
+
export declare const testing_origin_check_action_spec: {
|
|
82
|
+
readonly method: "_testing_origin_check";
|
|
83
|
+
readonly kind: "request_response";
|
|
84
|
+
readonly initiator: "frontend";
|
|
85
|
+
readonly auth: {
|
|
86
|
+
readonly account: "required";
|
|
87
|
+
readonly actor: "none";
|
|
88
|
+
readonly credential_types: readonly ["daemon_token"];
|
|
89
|
+
};
|
|
90
|
+
readonly side_effects: false;
|
|
91
|
+
readonly input: z.ZodObject<{
|
|
92
|
+
patterns: z.ZodString;
|
|
93
|
+
origin: z.ZodNullable<z.ZodString>;
|
|
94
|
+
}, z.core.$strict>;
|
|
95
|
+
readonly output: z.ZodUnion<readonly [z.ZodObject<{
|
|
96
|
+
ok: z.ZodLiteral<true>;
|
|
97
|
+
allowed: z.ZodBoolean;
|
|
98
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
99
|
+
ok: z.ZodLiteral<false>;
|
|
100
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
101
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
kind: z.ZodEnum<{
|
|
103
|
+
empty_entry: "empty_entry";
|
|
104
|
+
not_printable_ascii: "not_printable_ascii";
|
|
105
|
+
missing_scheme: "missing_scheme";
|
|
106
|
+
unsupported_scheme: "unsupported_scheme";
|
|
107
|
+
has_path: "has_path";
|
|
108
|
+
has_userinfo: "has_userinfo";
|
|
109
|
+
missing_host: "missing_host";
|
|
110
|
+
invalid_host_char: "invalid_host_char";
|
|
111
|
+
unbracketed_ipv6: "unbracketed_ipv6";
|
|
112
|
+
partial_wildcard: "partial_wildcard";
|
|
113
|
+
non_canonical_ipv4: "non_canonical_ipv4";
|
|
114
|
+
unclosed_ipv6: "unclosed_ipv6";
|
|
115
|
+
invalid_ipv6: "invalid_ipv6";
|
|
116
|
+
invalid_after_ipv6: "invalid_after_ipv6";
|
|
117
|
+
invalid_port: "invalid_port";
|
|
118
|
+
default_port: "default_port";
|
|
119
|
+
no_origins: "no_origins";
|
|
120
|
+
}>;
|
|
121
|
+
}, z.core.$strict>>;
|
|
122
|
+
}, z.core.$strict>]>;
|
|
123
|
+
readonly async: true;
|
|
124
|
+
readonly description: string;
|
|
125
|
+
};
|
|
126
|
+
/** Build the standalone `_testing_origin_check` action (see the spec doc). */
|
|
127
|
+
export declare const create_testing_origin_check_action: () => RpcAction;
|
|
128
|
+
//# sourceMappingURL=testing_origin_check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing_origin_check.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/testing_origin_check.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AASzE,wCAAwC;AACxC,eAAO,MAAM,uBAAuB;;;kBAKlC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAQnC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,GACpC,OAAO,uBAAuB,KAC5B,wBAcF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYC,CAAC;AAE/C,8EAA8E;AAC9E,eAAO,MAAM,kCAAkC,QAAO,SACyC,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import '../assert_dev_env.js';
|
|
2
|
+
/**
|
|
3
|
+
* `_testing_origin_check` — the testing seam behind the cross-impl origin
|
|
4
|
+
* conformance table (`origin_conformance.json`): its input and output schemas,
|
|
5
|
+
* the pure check it answers with, its spec, and the action builder.
|
|
6
|
+
*
|
|
7
|
+
* Split from `testing_reset_actions.ts`, whose other seams reach the
|
|
8
|
+
* in-process app server and through it the optional `hono` peer. This leaf is
|
|
9
|
+
* hono-free, so a consumer whose backend is a spawned Rust binary can run the
|
|
10
|
+
* conformance table without installing `hono`.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
import { rpc_action } from '../../actions/action_rpc.js';
|
|
16
|
+
import { AllowedOriginsErrorKind, parse_allowed_origins, should_allow_origin } from '../../http/origin.js';
|
|
17
|
+
import { TESTING_ACTION_AUTH } from './spine_surface_constants.js';
|
|
18
|
+
/** Input of `_testing_origin_check`. */
|
|
19
|
+
export const TestingOriginCheckInput = z.strictObject({
|
|
20
|
+
/** An allowlist value, as `FUZ_ALLOWED_ORIGINS` would carry it. */
|
|
21
|
+
patterns: z.string(),
|
|
22
|
+
/** One `Origin` header's value, or `null` for a request without one. */
|
|
23
|
+
origin: z.string().nullable()
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Output of `_testing_origin_check`: the request-level answer when the list
|
|
27
|
+
* parses, else every refusal — `index` the 1-based entry position, absent for
|
|
28
|
+
* a list-level refusal.
|
|
29
|
+
*/
|
|
30
|
+
export const TestingOriginCheckOutput = z.union([
|
|
31
|
+
z.strictObject({ ok: z.literal(true), allowed: z.boolean() }),
|
|
32
|
+
z.strictObject({
|
|
33
|
+
ok: z.literal(false),
|
|
34
|
+
errors: z.array(z.strictObject({ index: z.number().int().min(1).optional(), kind: AllowedOriginsErrorKind }))
|
|
35
|
+
})
|
|
36
|
+
]);
|
|
37
|
+
/**
|
|
38
|
+
* Answer one `_testing_origin_check` input: parse `patterns` with
|
|
39
|
+
* `parse_allowed_origins`, then run the request-level check for one `Origin`
|
|
40
|
+
* carrying `origin` (`null` — no `Origin` — passes). The action handler and
|
|
41
|
+
* the conformance table's unit test both call this, so the table checks the
|
|
42
|
+
* same function the wire serves.
|
|
43
|
+
*
|
|
44
|
+
* @param input - the allowlist value and the `Origin` value
|
|
45
|
+
* @returns the answer the Rust twin returns for the same input
|
|
46
|
+
*/
|
|
47
|
+
export const run_testing_origin_check = (input) => {
|
|
48
|
+
const parsed = parse_allowed_origins(input.patterns);
|
|
49
|
+
if (!parsed.ok) {
|
|
50
|
+
return {
|
|
51
|
+
ok: false,
|
|
52
|
+
errors: parsed.errors.map(({ index, kind }) => index === undefined ? { kind } : { index, kind })
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
ok: true,
|
|
57
|
+
allowed: input.origin === null || should_allow_origin(input.origin, parsed.origins)
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* `_testing_origin_check` — run the origin allowlist's parse and request
|
|
62
|
+
* check for one `{patterns, origin}` pair, so the shared conformance table
|
|
63
|
+
* (`origin_conformance.json`) checks each backend's grammar and matcher over
|
|
64
|
+
* the wire, row by row. Pure: no database, no state. The Rust mirror is
|
|
65
|
+
* `fuz_testing::create_testing_origin_check_action_spec`.
|
|
66
|
+
*
|
|
67
|
+
* Like `_testing_action_manifest`, it is **not** bundled by
|
|
68
|
+
* `create_testing_actions`: a consumer whose Rust binary doesn't mount the
|
|
69
|
+
* mirror would fail its action-manifest parity gate. The spine test binary
|
|
70
|
+
* appends it at the full-mount layer (`build_full_spine_rpc_actions`).
|
|
71
|
+
*
|
|
72
|
+
* `auth` gates on the daemon-token credential, matching `_testing_reset`.
|
|
73
|
+
*/
|
|
74
|
+
export const testing_origin_check_action_spec = {
|
|
75
|
+
method: '_testing_origin_check',
|
|
76
|
+
kind: 'request_response',
|
|
77
|
+
initiator: 'frontend',
|
|
78
|
+
auth: TESTING_ACTION_AUTH,
|
|
79
|
+
side_effects: false,
|
|
80
|
+
input: TestingOriginCheckInput,
|
|
81
|
+
output: TestingOriginCheckOutput,
|
|
82
|
+
async: true,
|
|
83
|
+
description: "Test-binary only — answer the origin allowlist's parse and request check for one " +
|
|
84
|
+
'{patterns, origin} pair, for the cross-impl origin conformance table.'
|
|
85
|
+
};
|
|
86
|
+
/** Build the standalone `_testing_origin_check` action (see the spec doc). */
|
|
87
|
+
export const create_testing_origin_check_action = () => rpc_action(testing_origin_check_action_spec, async (input) => run_testing_origin_check(input));
|
|
@@ -15,17 +15,17 @@ import '../assert_dev_env.js';
|
|
|
15
15
|
* of notifications onto the caller's own WebSocket connection, to push its
|
|
16
16
|
* outbound queue past its byte budget).
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* Two further daemon-token actions live here but are **not** bundled by
|
|
19
19
|
* `create_testing_actions`, and are appended at the full-mount layer
|
|
20
20
|
* (`build_full_spine_rpc_actions`) instead: **`_testing_action_manifest`**
|
|
21
21
|
* (dump the live RPC registry for cross-impl method-set + auth-shape parity —
|
|
22
22
|
* it must enumerate *every* mounted method, so it goes where the complete list
|
|
23
|
-
* exists)
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
23
|
+
* exists) and **`_testing_shorten_credential_expiry`** (pull an account's
|
|
24
|
+
* credential expiries in to seconds from now, shorten-only, for the
|
|
25
|
+
* credential-deadline cases) — the latter kept out of the bundle so a consumer
|
|
26
|
+
* whose Rust binary doesn't mount its mirror keeps a green manifest gate.
|
|
27
|
+
* `_testing_origin_check`, mounted the same way, lives in the hono-free
|
|
28
|
+
* `testing_origin_check.ts`.
|
|
29
29
|
*
|
|
30
30
|
* `_testing_reset` — full DB wipe + keeper re-seed + optional
|
|
31
31
|
* secondary-account seeding. The
|
|
@@ -261,8 +261,11 @@ export declare const create_testing_drain_effects_action: (audit: AuditEmitter)
|
|
|
261
261
|
* cross-process fact-serving suite, which drives over real HTTP and has no
|
|
262
262
|
* `PgFactStore` to call. Hashes the UTF-8 `content` (blake3, via
|
|
263
263
|
* `fact_hash_bytes` — the same hash the Rust `_testing_put_fact` computes),
|
|
264
|
-
* inserts the row idempotently, and returns `{hash}`.
|
|
265
|
-
*
|
|
264
|
+
* inserts the row idempotently, and returns `{hash}`. `holder` names the actor
|
|
265
|
+
* the put is on behalf of — recorded in `fact_holder` (deduplicated puts
|
|
266
|
+
* included), as a real upload records its uploader, so the suites can drive
|
|
267
|
+
* cell ref admission; absent, the put is a system put with no holder. The
|
|
268
|
+
* referencing cell is seeded separately via the `cell_create` RPC. Embedded-only is enough for the
|
|
266
269
|
* authz assertions (cell-scoped admit, cross-owner-no-leak, 404-mask, bare-hash
|
|
267
270
|
* admin-only); external / X-Accel parity stays covered by the forge's own gate.
|
|
268
271
|
*
|
|
@@ -283,6 +286,7 @@ export declare const testing_put_fact_action_spec: {
|
|
|
283
286
|
readonly input: z.ZodObject<{
|
|
284
287
|
content: z.ZodString;
|
|
285
288
|
content_type: z.ZodOptional<z.ZodString>;
|
|
289
|
+
holder: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
286
290
|
}, z.core.$strict>;
|
|
287
291
|
readonly output: z.ZodObject<{
|
|
288
292
|
hash: z.ZodString & z.ZodType<import("@fuzdev/fuz_util/hash_schemas.js").FactHash, string, z.core.$ZodTypeInternals<import("@fuzdev/fuz_util/hash_schemas.js").FactHash, string>>;
|
|
@@ -472,118 +476,6 @@ export declare const testing_migration_tracker_action_spec: {
|
|
|
472
476
|
* `create_testing_actions`; mount directly for in-process use.
|
|
473
477
|
*/
|
|
474
478
|
export declare const create_testing_migration_tracker_action: () => RpcAction;
|
|
475
|
-
/** Input of `_testing_origin_check`. */
|
|
476
|
-
export declare const TestingOriginCheckInput: z.ZodObject<{
|
|
477
|
-
patterns: z.ZodString;
|
|
478
|
-
origin: z.ZodNullable<z.ZodString>;
|
|
479
|
-
}, z.core.$strict>;
|
|
480
|
-
export type TestingOriginCheckInput = z.infer<typeof TestingOriginCheckInput>;
|
|
481
|
-
/**
|
|
482
|
-
* Output of `_testing_origin_check`: the request-level answer when the list
|
|
483
|
-
* parses, else every refusal — `index` the 1-based entry position, absent for
|
|
484
|
-
* a list-level refusal.
|
|
485
|
-
*/
|
|
486
|
-
export declare const TestingOriginCheckOutput: z.ZodUnion<readonly [z.ZodObject<{
|
|
487
|
-
ok: z.ZodLiteral<true>;
|
|
488
|
-
allowed: z.ZodBoolean;
|
|
489
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
490
|
-
ok: z.ZodLiteral<false>;
|
|
491
|
-
errors: z.ZodArray<z.ZodObject<{
|
|
492
|
-
index: z.ZodOptional<z.ZodNumber>;
|
|
493
|
-
kind: z.ZodEnum<{
|
|
494
|
-
empty_entry: "empty_entry";
|
|
495
|
-
not_printable_ascii: "not_printable_ascii";
|
|
496
|
-
missing_scheme: "missing_scheme";
|
|
497
|
-
unsupported_scheme: "unsupported_scheme";
|
|
498
|
-
has_path: "has_path";
|
|
499
|
-
has_userinfo: "has_userinfo";
|
|
500
|
-
missing_host: "missing_host";
|
|
501
|
-
invalid_host_char: "invalid_host_char";
|
|
502
|
-
unbracketed_ipv6: "unbracketed_ipv6";
|
|
503
|
-
partial_wildcard: "partial_wildcard";
|
|
504
|
-
non_canonical_ipv4: "non_canonical_ipv4";
|
|
505
|
-
unclosed_ipv6: "unclosed_ipv6";
|
|
506
|
-
invalid_ipv6: "invalid_ipv6";
|
|
507
|
-
invalid_after_ipv6: "invalid_after_ipv6";
|
|
508
|
-
invalid_port: "invalid_port";
|
|
509
|
-
default_port: "default_port";
|
|
510
|
-
no_origins: "no_origins";
|
|
511
|
-
}>;
|
|
512
|
-
}, z.core.$strict>>;
|
|
513
|
-
}, z.core.$strict>]>;
|
|
514
|
-
export type TestingOriginCheckOutput = z.infer<typeof TestingOriginCheckOutput>;
|
|
515
|
-
/**
|
|
516
|
-
* Answer one `_testing_origin_check` input: parse `patterns` with
|
|
517
|
-
* `parse_allowed_origins`, then run the request-level check for one `Origin`
|
|
518
|
-
* carrying `origin` (`null` — no `Origin` — passes). The action handler and
|
|
519
|
-
* the conformance table's unit test both call this, so the table checks the
|
|
520
|
-
* same function the wire serves.
|
|
521
|
-
*
|
|
522
|
-
* @param input - the allowlist value and the `Origin` value
|
|
523
|
-
* @returns the answer the Rust twin returns for the same input
|
|
524
|
-
*/
|
|
525
|
-
export declare const run_testing_origin_check: (input: TestingOriginCheckInput) => TestingOriginCheckOutput;
|
|
526
|
-
/**
|
|
527
|
-
* `_testing_origin_check` — run the origin allowlist's parse and request
|
|
528
|
-
* check for one `{patterns, origin}` pair, so the shared conformance table
|
|
529
|
-
* (`origin_conformance.json`) checks each backend's grammar and matcher over
|
|
530
|
-
* the wire, row by row. Pure: no database, no state. The Rust mirror is
|
|
531
|
-
* `fuz_testing::create_testing_origin_check_action_spec`.
|
|
532
|
-
*
|
|
533
|
-
* Like `_testing_action_manifest`, it is **not** bundled by
|
|
534
|
-
* `create_testing_actions`: a consumer whose Rust binary doesn't mount the
|
|
535
|
-
* mirror would fail its action-manifest parity gate. The spine test binary
|
|
536
|
-
* appends it at the full-mount layer (`build_full_spine_rpc_actions`).
|
|
537
|
-
*
|
|
538
|
-
* `auth` gates on the daemon-token credential, matching `_testing_reset`.
|
|
539
|
-
*/
|
|
540
|
-
export declare const testing_origin_check_action_spec: {
|
|
541
|
-
readonly method: "_testing_origin_check";
|
|
542
|
-
readonly kind: "request_response";
|
|
543
|
-
readonly initiator: "frontend";
|
|
544
|
-
readonly auth: {
|
|
545
|
-
readonly account: "required";
|
|
546
|
-
readonly actor: "none";
|
|
547
|
-
readonly credential_types: readonly ["daemon_token"];
|
|
548
|
-
};
|
|
549
|
-
readonly side_effects: false;
|
|
550
|
-
readonly input: z.ZodObject<{
|
|
551
|
-
patterns: z.ZodString;
|
|
552
|
-
origin: z.ZodNullable<z.ZodString>;
|
|
553
|
-
}, z.core.$strict>;
|
|
554
|
-
readonly output: z.ZodUnion<readonly [z.ZodObject<{
|
|
555
|
-
ok: z.ZodLiteral<true>;
|
|
556
|
-
allowed: z.ZodBoolean;
|
|
557
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
558
|
-
ok: z.ZodLiteral<false>;
|
|
559
|
-
errors: z.ZodArray<z.ZodObject<{
|
|
560
|
-
index: z.ZodOptional<z.ZodNumber>;
|
|
561
|
-
kind: z.ZodEnum<{
|
|
562
|
-
empty_entry: "empty_entry";
|
|
563
|
-
not_printable_ascii: "not_printable_ascii";
|
|
564
|
-
missing_scheme: "missing_scheme";
|
|
565
|
-
unsupported_scheme: "unsupported_scheme";
|
|
566
|
-
has_path: "has_path";
|
|
567
|
-
has_userinfo: "has_userinfo";
|
|
568
|
-
missing_host: "missing_host";
|
|
569
|
-
invalid_host_char: "invalid_host_char";
|
|
570
|
-
unbracketed_ipv6: "unbracketed_ipv6";
|
|
571
|
-
partial_wildcard: "partial_wildcard";
|
|
572
|
-
non_canonical_ipv4: "non_canonical_ipv4";
|
|
573
|
-
unclosed_ipv6: "unclosed_ipv6";
|
|
574
|
-
invalid_ipv6: "invalid_ipv6";
|
|
575
|
-
invalid_after_ipv6: "invalid_after_ipv6";
|
|
576
|
-
invalid_port: "invalid_port";
|
|
577
|
-
default_port: "default_port";
|
|
578
|
-
no_origins: "no_origins";
|
|
579
|
-
}>;
|
|
580
|
-
}, z.core.$strict>>;
|
|
581
|
-
}, z.core.$strict>]>;
|
|
582
|
-
readonly async: true;
|
|
583
|
-
readonly description: string;
|
|
584
|
-
};
|
|
585
|
-
/** Build the standalone `_testing_origin_check` action (see the spec doc). */
|
|
586
|
-
export declare const create_testing_origin_check_action: () => RpcAction;
|
|
587
479
|
/** The shortest expiry `_testing_shorten_credential_expiry` sets, in seconds from now. */
|
|
588
480
|
export declare const TESTING_SHORTEN_CREDENTIAL_EXPIRY_MIN_SECONDS = 1;
|
|
589
481
|
/**
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CA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