@fuzdev/fuz_app 0.163.0 → 0.165.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/README.md +2 -1
- package/dist/actions/action_event_data.d.ts +1 -1
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +4 -0
- package/dist/actions/action_spec.d.ts +3 -3
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/auth/CLAUDE.md +1 -1
- package/dist/auth/account_route_schema.d.ts +3 -27
- package/dist/auth/account_route_schema.d.ts.map +1 -1
- package/dist/auth/account_route_schema.js +6 -20
- package/dist/auth/admin_action_specs.d.ts +56 -56
- package/dist/auth/audit_log_route_schema.d.ts +1 -1
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_route_schema.js +4 -5
- package/dist/auth/audit_log_schema.d.ts +18 -18
- package/dist/auth/bootstrap_route_schema.d.ts +1 -30
- package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
- package/dist/auth/bootstrap_route_schema.js +3 -8
- package/dist/auth/daemon_token.d.ts +4 -4
- package/dist/auth/daemon_token.d.ts.map +1 -1
- package/dist/auth/daemon_token.js +3 -3
- package/dist/auth/daemon_token_middleware.d.ts +1 -1
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +5 -5
- package/dist/auth/middleware.js +4 -4
- package/dist/auth/role_grant_offer_action_specs.d.ts +2 -2
- package/dist/auth/signup_route_schema.d.ts.map +1 -1
- package/dist/auth/signup_route_schema.js +3 -7
- package/dist/db/CLAUDE.md +2 -1
- package/dist/db/file_fact_url.d.ts +11 -6
- package/dist/db/file_fact_url.d.ts.map +1 -1
- package/dist/db/file_fact_url.js +5 -5
- package/dist/db/schema_ready.d.ts +0 -5
- package/dist/db/schema_ready.d.ts.map +1 -1
- package/dist/db/schema_ready.js +0 -5
- package/dist/http/CLAUDE.md +105 -71
- package/dist/http/auth_shape.d.ts +48 -29
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +12 -85
- package/dist/http/body_limit.d.ts +12 -0
- package/dist/http/body_limit.d.ts.map +1 -1
- package/dist/http/body_limit.js +15 -0
- package/dist/http/body_limit_schema.d.ts +20 -0
- package/dist/http/body_limit_schema.d.ts.map +1 -0
- package/dist/http/body_limit_schema.js +20 -0
- package/dist/http/common_routes.d.ts +1 -1
- package/dist/http/common_routes.d.ts.map +1 -1
- package/dist/http/common_routes.js +11 -14
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +59 -69
- package/dist/http/dev_route_error_check.d.ts +70 -0
- package/dist/http/dev_route_error_check.d.ts.map +1 -0
- package/dist/http/dev_route_error_check.js +119 -0
- package/dist/http/error_schemas.d.ts +365 -189
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +256 -149
- package/dist/http/health_schema.d.ts +10 -6
- package/dist/http/health_schema.d.ts.map +1 -1
- package/dist/http/health_schema.js +3 -3
- package/dist/http/middleware_spec.d.ts +8 -3
- package/dist/http/middleware_spec.d.ts.map +1 -1
- package/dist/http/origin.d.ts +12 -43
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +10 -6
- package/dist/http/route_error_check.d.ts +179 -0
- package/dist/http/route_error_check.d.ts.map +1 -0
- package/dist/http/route_error_check.js +283 -0
- package/dist/http/route_errors.d.ts +80 -0
- package/dist/http/route_errors.d.ts.map +1 -0
- package/dist/http/route_errors.js +83 -0
- package/dist/http/route_spec.d.ts +33 -17
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +48 -62
- package/dist/http/schema_helpers.d.ts +15 -34
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +11 -47
- package/dist/http/surface.d.ts +19 -12
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +25 -38
- package/dist/http/surface_query.d.ts +11 -2
- package/dist/http/surface_query.d.ts.map +1 -1
- package/dist/http/surface_query.js +7 -1
- package/dist/primitive_schemas_fuz.d.ts +17 -3
- package/dist/primitive_schemas_fuz.d.ts.map +1 -1
- package/dist/primitive_schemas_fuz.js +13 -3
- package/dist/rate_limiter.d.ts +13 -0
- package/dist/rate_limiter.d.ts.map +1 -1
- package/dist/rate_limiter.js +20 -2
- package/dist/schema_issues.d.ts +29 -11
- package/dist/schema_issues.d.ts.map +1 -1
- package/dist/schema_issues.js +11 -10
- package/dist/schema_meta.d.ts +8 -1
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +2 -1
- package/dist/server/app_server.d.ts +3 -1
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +24 -10
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +8 -31
- package/dist/server/surface_route.d.ts.map +1 -1
- package/dist/server/surface_route.js +5 -6
- package/dist/server/x_accel.d.ts +12 -7
- package/dist/server/x_accel.d.ts.map +1 -1
- package/dist/server/x_accel.js +7 -9
- package/dist/testing/CLAUDE.md +105 -61
- package/dist/testing/admin_integration.js +2 -2
- package/dist/testing/adversarial_404.d.ts +4 -18
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_404.js +20 -52
- package/dist/testing/adversarial_headers.d.ts +3 -4
- package/dist/testing/adversarial_headers.d.ts.map +1 -1
- package/dist/testing/adversarial_headers.js +8 -6
- package/dist/testing/adversarial_input.d.ts.map +1 -1
- package/dist/testing/adversarial_input.js +20 -19
- package/dist/testing/assertions.d.ts +46 -14
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +73 -16
- package/dist/testing/attack_surface.d.ts +17 -35
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +36 -95
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +2 -1
- package/dist/testing/cross_backend/action_manifest.d.ts +126 -56
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +11 -11
- package/dist/testing/cross_backend/action_manifest_parity.d.ts +1 -1
- package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.js +2 -1
- package/dist/testing/cross_backend/conformance_table.js +1 -1
- package/dist/testing/cross_backend/fact_serving.js +3 -3
- package/dist/testing/cross_backend/in_process_setup.d.ts +7 -3
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.js +11 -4
- package/dist/testing/cross_backend/origin_conformance.d.ts +278 -102
- package/dist/testing/cross_backend/origin_conformance.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin_conformance.js +21 -21
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.js +7 -1
- package/dist/testing/cross_backend/setup.d.ts +13 -0
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +24 -7
- package/dist/testing/cross_backend/spine_suites.d.ts +3 -2
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +5 -2
- package/dist/testing/cross_backend/standard.d.ts +31 -0
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.js +9 -3
- package/dist/testing/cross_backend/testing_origin_check.d.ts +147 -71
- package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_origin_check.js +16 -13
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +70 -27
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/data_exposure.d.ts +7 -0
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +8 -7
- package/dist/testing/error_coverage.d.ts +53 -61
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +86 -119
- package/dist/testing/integration.d.ts +28 -1
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +54 -29
- package/dist/testing/integration_helpers.d.ts +37 -9
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +75 -40
- package/dist/testing/middleware.d.ts +3 -5
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +5 -4
- package/dist/testing/middleware_gate_probes.d.ts +90 -0
- package/dist/testing/middleware_gate_probes.d.ts.map +1 -0
- package/dist/testing/middleware_gate_probes.js +179 -0
- package/dist/testing/rate_limiting.d.ts +1 -1
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +5 -4
- package/dist/testing/round_trip.d.ts +7 -0
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +8 -5
- package/dist/testing/schema_generators.d.ts +40 -11
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +71 -17
- package/dist/testing/stubs.d.ts +10 -1
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +15 -5
- package/dist/testing/surface_invariants.d.ts +36 -115
- package/dist/testing/surface_invariants.d.ts.map +1 -1
- package/dist/testing/surface_invariants.js +106 -269
- package/dist/testing/transports/raw_http.d.ts +10 -2
- package/dist/testing/transports/raw_http.d.ts.map +1 -1
- package/dist/testing/transports/raw_http.js +10 -4
- package/dist/ui/CLAUDE.md +4 -2
- package/dist/ui/auth_state.svelte.d.ts.map +1 -1
- package/dist/ui/auth_state.svelte.js +2 -8
- package/dist/ui/backend_probe.svelte.js +3 -3
- package/dist/ui/table_state.svelte.d.ts.map +1 -1
- package/dist/ui/table_state.svelte.js +1 -8
- package/dist/ui/ui_fetch.d.ts +12 -2
- package/dist/ui/ui_fetch.d.ts.map +1 -1
- package/dist/ui/ui_fetch.js +22 -4
- package/package.json +1 -1
|
@@ -115,9 +115,11 @@ export interface DefaultInProcessSuiteOptions {
|
|
|
115
115
|
* Build the full in-process suite bundle in a single helper invocation.
|
|
116
116
|
* Output covers `{setup_test, surface_source, capabilities}` plus every
|
|
117
117
|
* factory input the Tier 1 suites read at their top level
|
|
118
|
-
* (`session_options`, `create_route_specs`, `rpc_endpoints`)
|
|
119
|
-
*
|
|
120
|
-
* (`
|
|
118
|
+
* (`session_options`, `create_route_specs`, `rpc_endpoints`), and the
|
|
119
|
+
* integration suite's `base_url` (`null`, no socket) and `max_body_bytes`
|
|
120
|
+
* (`app_options.max_body_size`) — so the call site spreads once and adds
|
|
121
|
+
* only suite-specific extras (`roles`, `skip_routes`, `input_overrides`,
|
|
122
|
+
* `db_factories`, ...).
|
|
121
123
|
*
|
|
122
124
|
* ```ts
|
|
123
125
|
* // Suite-extras-free call: helper output is the entire options bag.
|
|
@@ -149,5 +151,7 @@ export declare const default_in_process_suite_options: <const O extends DefaultI
|
|
|
149
151
|
session_options: O["session_options"];
|
|
150
152
|
create_route_specs: O["create_route_specs"];
|
|
151
153
|
rpc_endpoints: O["rpc_endpoints"];
|
|
154
|
+
base_url: null;
|
|
155
|
+
max_body_bytes: number | undefined;
|
|
152
156
|
};
|
|
153
157
|
//# sourceMappingURL=in_process_setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in_process_setup.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/in_process_setup.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAqB9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;A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EjC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,WAAW,4BAA4B;IAC5C,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,kBAAkB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACnC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACjD;;;OAGG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC;;;OAGG;IACH,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C;;;;;OAKG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CAChC;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,gCAAgC,GAAI,KAAK,CAAC,CAAC,SAAS,4BAA4B,EAC5F,SAAS,CAAC,KACR;IACF,UAAU,EAAE,SAAS,CAAC;IACtB,cAAc,EAAE,cAAc,CAAC;IAC/B,YAAY,EAAE,mBAAmB,CAAC;IAClC,eAAe,EAAE,CAAC,CAAC,iBAAiB,CAAC,CAAC;IACtC,kBAAkB,EAAE,CAAC,CAAC,oBAAoB,CAAC,CAAC;IAC5C,aAAa,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC;IAClC,QAAQ,EAAE,IAAI,CAAC;IACf,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CAoClC,CAAC"}
|
|
@@ -113,9 +113,11 @@ export const default_in_process_setup = (options) => async () => {
|
|
|
113
113
|
* Build the full in-process suite bundle in a single helper invocation.
|
|
114
114
|
* Output covers `{setup_test, surface_source, capabilities}` plus every
|
|
115
115
|
* factory input the Tier 1 suites read at their top level
|
|
116
|
-
* (`session_options`, `create_route_specs`, `rpc_endpoints`)
|
|
117
|
-
*
|
|
118
|
-
* (`
|
|
116
|
+
* (`session_options`, `create_route_specs`, `rpc_endpoints`), and the
|
|
117
|
+
* integration suite's `base_url` (`null`, no socket) and `max_body_bytes`
|
|
118
|
+
* (`app_options.max_body_size`) — so the call site spreads once and adds
|
|
119
|
+
* only suite-specific extras (`roles`, `skip_routes`, `input_overrides`,
|
|
120
|
+
* `db_factories`, ...).
|
|
119
121
|
*
|
|
120
122
|
* ```ts
|
|
121
123
|
* // Suite-extras-free call: helper output is the entire options bag.
|
|
@@ -162,11 +164,16 @@ export const default_in_process_suite_options = (options) => ({
|
|
|
162
164
|
// and live app stay in sync by construction.
|
|
163
165
|
bootstrap: options.bootstrap,
|
|
164
166
|
surface_route: options.app_options?.surface_route,
|
|
167
|
+
max_body_size: options.app_options?.max_body_size,
|
|
168
|
+
origin_carve_outs: options.app_options?.origin_carve_outs,
|
|
165
169
|
// `create_test_app` always passes a `daemon_token_state`
|
|
166
170
|
daemon_token: true
|
|
167
171
|
}),
|
|
168
172
|
capabilities: in_process_capabilities,
|
|
169
173
|
session_options: options.session_options,
|
|
170
174
|
create_route_specs: options.create_route_specs,
|
|
171
|
-
rpc_endpoints: options.rpc_endpoints
|
|
175
|
+
rpc_endpoints: options.rpc_endpoints,
|
|
176
|
+
// in-process: no socket, and the limit `create_app_server` mounts
|
|
177
|
+
base_url: null,
|
|
178
|
+
max_body_bytes: options.app_options?.max_body_size ?? undefined
|
|
172
179
|
});
|
|
@@ -1,111 +1,287 @@
|
|
|
1
1
|
import '../assert_dev_env.js';
|
|
2
|
-
import {
|
|
2
|
+
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
3
3
|
import type { RpcPathCrossSuiteOptions } from './setup.js';
|
|
4
4
|
import { TestingOriginCheckOutput, type TestingOriginCheckInput } from './testing_origin_check.js';
|
|
5
5
|
/** One expected refusal of a parse row. */
|
|
6
|
-
export declare const OriginConformanceError:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
unbracketed_ipv6: "unbracketed_ipv6";
|
|
18
|
-
partial_wildcard: "partial_wildcard";
|
|
19
|
-
non_canonical_ipv4: "non_canonical_ipv4";
|
|
20
|
-
unclosed_ipv6: "unclosed_ipv6";
|
|
21
|
-
invalid_ipv6: "invalid_ipv6";
|
|
22
|
-
invalid_after_ipv6: "invalid_after_ipv6";
|
|
23
|
-
invalid_port: "invalid_port";
|
|
24
|
-
default_port: "default_port";
|
|
25
|
-
no_origins: "no_origins";
|
|
26
|
-
}>;
|
|
27
|
-
}, z.core.$strict>;
|
|
28
|
-
export type OriginConformanceError = z.infer<typeof OriginConformanceError>;
|
|
6
|
+
export declare const OriginConformanceError: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
7
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
8
|
+
index?: number | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
11
|
+
index?: number | undefined;
|
|
12
|
+
}, "object", {
|
|
13
|
+
index: import("@fuzdev/fuz_schema/schema.ts").Schema<number | undefined, number | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").PipeSchema<number, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>>>>;
|
|
14
|
+
kind: import("@fuzdev/fuz_schema/schema.ts").Schema<"empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins", "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins", "one_of", readonly ["no_origins", "empty_entry", "not_printable_ascii", "missing_scheme", "unsupported_scheme", "has_path", "has_userinfo", "missing_host", "invalid_host_char", "unbracketed_ipv6", "partial_wildcard", "non_canonical_ipv4", "unclosed_ipv6", "invalid_ipv6", "invalid_after_ipv6", "invalid_port", "default_port"]>;
|
|
15
|
+
}>;
|
|
16
|
+
export type OriginConformanceError = Infer<typeof OriginConformanceError>;
|
|
29
17
|
/** A parse row: the value parses (`ok: true`), or is refused with `errors`. */
|
|
30
|
-
export declare const OriginConformanceParseRow:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
note
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
index
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
18
|
+
export declare const OriginConformanceParseRow: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
19
|
+
ok: true;
|
|
20
|
+
raw: string;
|
|
21
|
+
note?: string | undefined;
|
|
22
|
+
} | {
|
|
23
|
+
errors: {
|
|
24
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
25
|
+
index?: number | undefined;
|
|
26
|
+
}[];
|
|
27
|
+
raw: string;
|
|
28
|
+
note?: string | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
ok: true;
|
|
31
|
+
raw: string;
|
|
32
|
+
note?: string | undefined;
|
|
33
|
+
} | {
|
|
34
|
+
errors: {
|
|
35
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
36
|
+
index?: number | undefined;
|
|
37
|
+
}[];
|
|
38
|
+
raw: string;
|
|
39
|
+
note?: string | undefined;
|
|
40
|
+
}, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
41
|
+
ok: true;
|
|
42
|
+
raw: string;
|
|
43
|
+
note?: string | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
ok: true;
|
|
46
|
+
raw: string;
|
|
47
|
+
note?: string | undefined;
|
|
48
|
+
}, "object", {
|
|
49
|
+
raw: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
50
|
+
ok: import("@fuzdev/fuz_schema/schema.ts").Schema<true, true, "literal", true>;
|
|
51
|
+
note: import("@fuzdev/fuz_schema/schema.ts").Schema<string | undefined, string | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
52
|
+
}>, import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
53
|
+
errors: {
|
|
54
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
55
|
+
index?: number | undefined;
|
|
56
|
+
}[];
|
|
57
|
+
raw: string;
|
|
58
|
+
note?: string | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
errors: {
|
|
61
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
62
|
+
index?: number | undefined;
|
|
63
|
+
}[];
|
|
64
|
+
raw: string;
|
|
65
|
+
note?: string | undefined;
|
|
66
|
+
}, "object", {
|
|
67
|
+
raw: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
68
|
+
errors: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<{
|
|
69
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
70
|
+
index?: number | undefined;
|
|
71
|
+
}[], import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
72
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
73
|
+
index?: number | undefined;
|
|
74
|
+
}[], {
|
|
75
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
76
|
+
index?: number | undefined;
|
|
77
|
+
}[], "array", import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
78
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
79
|
+
index?: number | undefined;
|
|
80
|
+
}, {
|
|
81
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
82
|
+
index?: number | undefined;
|
|
83
|
+
}, "object", {
|
|
84
|
+
index: import("@fuzdev/fuz_schema/schema.ts").Schema<number | undefined, number | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").PipeSchema<number, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>>>>;
|
|
85
|
+
kind: import("@fuzdev/fuz_schema/schema.ts").Schema<"empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins", "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins", "one_of", readonly ["no_origins", "empty_entry", "not_printable_ascii", "missing_scheme", "unsupported_scheme", "has_path", "has_userinfo", "missing_host", "invalid_host_char", "unbracketed_ipv6", "partial_wildcard", "non_canonical_ipv4", "unclosed_ipv6", "invalid_ipv6", "invalid_after_ipv6", "invalid_port", "default_port"]>;
|
|
86
|
+
}>>>;
|
|
87
|
+
note: import("@fuzdev/fuz_schema/schema.ts").Schema<string | undefined, string | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
88
|
+
}>]>;
|
|
89
|
+
export type OriginConformanceParseRow = Infer<typeof OriginConformanceParseRow>;
|
|
61
90
|
/** A match row: a valid allowlist, one `Origin` value or `null`, and the answer. */
|
|
62
|
-
export declare const OriginConformanceMatchRow:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
allowed:
|
|
66
|
-
note
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
patterns:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
91
|
+
export declare const OriginConformanceMatchRow: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
92
|
+
origin: string | null;
|
|
93
|
+
patterns: string;
|
|
94
|
+
allowed: boolean;
|
|
95
|
+
note?: string | undefined;
|
|
96
|
+
}, {
|
|
97
|
+
origin: string | null;
|
|
98
|
+
patterns: string;
|
|
99
|
+
allowed: boolean;
|
|
100
|
+
note?: string | undefined;
|
|
101
|
+
}, "object", {
|
|
102
|
+
patterns: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
103
|
+
origin: import("@fuzdev/fuz_schema/schema.ts").Schema<string | null, string | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
104
|
+
allowed: import("@fuzdev/fuz_schema/schema.ts").Schema<boolean, boolean, "boolean", undefined>;
|
|
105
|
+
note: import("@fuzdev/fuz_schema/schema.ts").Schema<string | undefined, string | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
106
|
+
}>;
|
|
107
|
+
export type OriginConformanceMatchRow = Infer<typeof OriginConformanceMatchRow>;
|
|
108
|
+
/** The conformance table, a `@fuzdev/fuz_schema` `object`. */
|
|
109
|
+
export declare const OriginConformance: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
110
|
+
match: {
|
|
111
|
+
origin: string | null;
|
|
112
|
+
patterns: string;
|
|
113
|
+
allowed: boolean;
|
|
114
|
+
note?: string | undefined;
|
|
115
|
+
}[];
|
|
116
|
+
parse: ({
|
|
117
|
+
ok: true;
|
|
118
|
+
raw: string;
|
|
119
|
+
note?: string | undefined;
|
|
120
|
+
} | {
|
|
121
|
+
errors: {
|
|
122
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
123
|
+
index?: number | undefined;
|
|
124
|
+
}[];
|
|
125
|
+
raw: string;
|
|
126
|
+
note?: string | undefined;
|
|
127
|
+
})[];
|
|
128
|
+
}, {
|
|
129
|
+
match: {
|
|
130
|
+
origin: string | null;
|
|
131
|
+
patterns: string;
|
|
132
|
+
allowed: boolean;
|
|
133
|
+
note?: string | undefined;
|
|
134
|
+
}[];
|
|
135
|
+
parse: ({
|
|
136
|
+
ok: true;
|
|
137
|
+
raw: string;
|
|
138
|
+
note?: string | undefined;
|
|
139
|
+
} | {
|
|
140
|
+
errors: {
|
|
141
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
142
|
+
index?: number | undefined;
|
|
143
|
+
}[];
|
|
144
|
+
raw: string;
|
|
145
|
+
note?: string | undefined;
|
|
146
|
+
})[];
|
|
147
|
+
}, "object", {
|
|
148
|
+
parse: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<({
|
|
149
|
+
ok: true;
|
|
150
|
+
raw: string;
|
|
151
|
+
note?: string | undefined;
|
|
152
|
+
} | {
|
|
153
|
+
errors: {
|
|
154
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
155
|
+
index?: number | undefined;
|
|
156
|
+
}[];
|
|
157
|
+
raw: string;
|
|
158
|
+
note?: string | undefined;
|
|
159
|
+
})[], import("@fuzdev/fuz_schema/schema.ts").Schema<({
|
|
160
|
+
ok: true;
|
|
161
|
+
raw: string;
|
|
162
|
+
note?: string | undefined;
|
|
163
|
+
} | {
|
|
164
|
+
errors: {
|
|
165
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
166
|
+
index?: number | undefined;
|
|
167
|
+
}[];
|
|
168
|
+
raw: string;
|
|
169
|
+
note?: string | undefined;
|
|
170
|
+
})[], ({
|
|
171
|
+
ok: true;
|
|
172
|
+
raw: string;
|
|
173
|
+
note?: string | undefined;
|
|
174
|
+
} | {
|
|
175
|
+
errors: {
|
|
176
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
177
|
+
index?: number | undefined;
|
|
178
|
+
}[];
|
|
179
|
+
raw: string;
|
|
180
|
+
note?: string | undefined;
|
|
181
|
+
})[], "array", import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
182
|
+
ok: true;
|
|
183
|
+
raw: string;
|
|
184
|
+
note?: string | undefined;
|
|
185
|
+
} | {
|
|
186
|
+
errors: {
|
|
187
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
188
|
+
index?: number | undefined;
|
|
189
|
+
}[];
|
|
190
|
+
raw: string;
|
|
191
|
+
note?: string | undefined;
|
|
192
|
+
}, {
|
|
193
|
+
ok: true;
|
|
194
|
+
raw: string;
|
|
195
|
+
note?: string | undefined;
|
|
196
|
+
} | {
|
|
197
|
+
errors: {
|
|
198
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
199
|
+
index?: number | undefined;
|
|
200
|
+
}[];
|
|
201
|
+
raw: string;
|
|
202
|
+
note?: string | undefined;
|
|
203
|
+
}, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
204
|
+
ok: true;
|
|
205
|
+
raw: string;
|
|
206
|
+
note?: string | undefined;
|
|
207
|
+
}, {
|
|
208
|
+
ok: true;
|
|
209
|
+
raw: string;
|
|
210
|
+
note?: string | undefined;
|
|
211
|
+
}, "object", {
|
|
212
|
+
raw: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
213
|
+
ok: import("@fuzdev/fuz_schema/schema.ts").Schema<true, true, "literal", true>;
|
|
214
|
+
note: import("@fuzdev/fuz_schema/schema.ts").Schema<string | undefined, string | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
215
|
+
}>, import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
216
|
+
errors: {
|
|
217
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
218
|
+
index?: number | undefined;
|
|
219
|
+
}[];
|
|
220
|
+
raw: string;
|
|
221
|
+
note?: string | undefined;
|
|
222
|
+
}, {
|
|
223
|
+
errors: {
|
|
224
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
225
|
+
index?: number | undefined;
|
|
226
|
+
}[];
|
|
227
|
+
raw: string;
|
|
228
|
+
note?: string | undefined;
|
|
229
|
+
}, "object", {
|
|
230
|
+
raw: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
231
|
+
errors: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<{
|
|
232
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
233
|
+
index?: number | undefined;
|
|
234
|
+
}[], import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
235
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
236
|
+
index?: number | undefined;
|
|
237
|
+
}[], {
|
|
238
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
239
|
+
index?: number | undefined;
|
|
240
|
+
}[], "array", import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
241
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
242
|
+
index?: number | undefined;
|
|
243
|
+
}, {
|
|
244
|
+
kind: "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins";
|
|
245
|
+
index?: number | undefined;
|
|
246
|
+
}, "object", {
|
|
247
|
+
index: import("@fuzdev/fuz_schema/schema.ts").Schema<number | undefined, number | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").PipeSchema<number, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>>>>;
|
|
248
|
+
kind: import("@fuzdev/fuz_schema/schema.ts").Schema<"empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins", "empty_entry" | "not_printable_ascii" | "missing_scheme" | "unsupported_scheme" | "has_path" | "has_userinfo" | "missing_host" | "invalid_host_char" | "unbracketed_ipv6" | "partial_wildcard" | "non_canonical_ipv4" | "unclosed_ipv6" | "invalid_ipv6" | "invalid_after_ipv6" | "invalid_port" | "default_port" | "no_origins", "one_of", readonly ["no_origins", "empty_entry", "not_printable_ascii", "missing_scheme", "unsupported_scheme", "has_path", "has_userinfo", "missing_host", "invalid_host_char", "unbracketed_ipv6", "partial_wildcard", "non_canonical_ipv4", "unclosed_ipv6", "invalid_ipv6", "invalid_after_ipv6", "invalid_port", "default_port"]>;
|
|
249
|
+
}>>>;
|
|
250
|
+
note: import("@fuzdev/fuz_schema/schema.ts").Schema<string | undefined, string | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
251
|
+
}>]>>>;
|
|
252
|
+
match: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<{
|
|
253
|
+
origin: string | null;
|
|
254
|
+
patterns: string;
|
|
255
|
+
allowed: boolean;
|
|
256
|
+
note?: string | undefined;
|
|
257
|
+
}[], import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
258
|
+
origin: string | null;
|
|
259
|
+
patterns: string;
|
|
260
|
+
allowed: boolean;
|
|
261
|
+
note?: string | undefined;
|
|
262
|
+
}[], {
|
|
263
|
+
origin: string | null;
|
|
264
|
+
patterns: string;
|
|
265
|
+
allowed: boolean;
|
|
266
|
+
note?: string | undefined;
|
|
267
|
+
}[], "array", import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
268
|
+
origin: string | null;
|
|
269
|
+
patterns: string;
|
|
270
|
+
allowed: boolean;
|
|
271
|
+
note?: string | undefined;
|
|
272
|
+
}, {
|
|
273
|
+
origin: string | null;
|
|
274
|
+
patterns: string;
|
|
275
|
+
allowed: boolean;
|
|
276
|
+
note?: string | undefined;
|
|
277
|
+
}, "object", {
|
|
278
|
+
patterns: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
279
|
+
origin: import("@fuzdev/fuz_schema/schema.ts").Schema<string | null, string | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
280
|
+
allowed: import("@fuzdev/fuz_schema/schema.ts").Schema<boolean, boolean, "boolean", undefined>;
|
|
281
|
+
note: import("@fuzdev/fuz_schema/schema.ts").Schema<string | undefined, string | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
282
|
+
}>>>;
|
|
283
|
+
}>;
|
|
284
|
+
export type OriginConformance = Infer<typeof OriginConformance>;
|
|
109
285
|
/** The committed table, resolved relative to this module. */
|
|
110
286
|
export declare const ORIGIN_CONFORMANCE_URL: URL;
|
|
111
287
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"origin_conformance.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/origin_conformance.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA0B9B,OAAO,
|
|
1
|
+
{"version":3,"file":"origin_conformance.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/origin_conformance.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA0B9B,O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B,QAAQ,CAAC,KAAK,EAAE,uBAAuB,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;CAC5C;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACxC,OAAO,iBAAiB,KACtB,KAAK,CAAC,sBAAsB,CAc9B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GACrC,QAAQ,aAAa,CAAC,sBAAsB,CAAC,EAC7C,QAAQ,aAAa,CAAC,OAAO,CAAC,EAC9B,SAAS,MAAM,KACb,IAiBF,CAAC;AAEF,6DAA6D;AAC7D,MAAM,MAAM,iCAAiC,GAAG,wBAAwB,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,uCAAuC,GACnD,SAAS,iCAAiC,KACxC,IA4BF,CAAC"}
|
|
@@ -22,36 +22,36 @@ import '../assert_dev_env.js';
|
|
|
22
22
|
*/
|
|
23
23
|
import { readFileSync } from 'node:fs';
|
|
24
24
|
import { assert, describe, test } from 'vitest';
|
|
25
|
-
import {
|
|
25
|
+
import { array, boolean, literal, min_length, min_value, nullable, number, object, optional, parse, parse_or_throw, pipe, safe_integer, string, union } from '@fuzdev/fuz_schema/schema.ts';
|
|
26
26
|
import { AllowedOriginsErrorKind } from '../../http/origin.js';
|
|
27
27
|
import { cross_rpc_call } from './cross_rpc.js';
|
|
28
28
|
import { SPINE_RPC_PATH } from './spine_surface_constants.js';
|
|
29
29
|
import { TestingOriginCheckOutput, testing_origin_check_action_spec } from './testing_origin_check.js';
|
|
30
30
|
/** One expected refusal of a parse row. */
|
|
31
|
-
export const OriginConformanceError =
|
|
32
|
-
index:
|
|
31
|
+
export const OriginConformanceError = object({
|
|
32
|
+
index: optional(pipe(number, safe_integer, min_value(1))),
|
|
33
33
|
kind: AllowedOriginsErrorKind
|
|
34
34
|
});
|
|
35
35
|
/** A parse row: the value parses (`ok: true`), or is refused with `errors`. */
|
|
36
|
-
export const OriginConformanceParseRow =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
raw:
|
|
40
|
-
errors:
|
|
41
|
-
note:
|
|
36
|
+
export const OriginConformanceParseRow = union([
|
|
37
|
+
object({ raw: string, ok: literal(true), note: optional(string) }),
|
|
38
|
+
object({
|
|
39
|
+
raw: string,
|
|
40
|
+
errors: pipe(array(OriginConformanceError), min_length(1)),
|
|
41
|
+
note: optional(string)
|
|
42
42
|
})
|
|
43
43
|
]);
|
|
44
44
|
/** A match row: a valid allowlist, one `Origin` value or `null`, and the answer. */
|
|
45
|
-
export const OriginConformanceMatchRow =
|
|
46
|
-
patterns:
|
|
47
|
-
origin:
|
|
48
|
-
allowed:
|
|
49
|
-
note:
|
|
45
|
+
export const OriginConformanceMatchRow = object({
|
|
46
|
+
patterns: string,
|
|
47
|
+
origin: nullable(string),
|
|
48
|
+
allowed: boolean,
|
|
49
|
+
note: optional(string)
|
|
50
50
|
});
|
|
51
|
-
/** The conformance table
|
|
52
|
-
export const OriginConformance =
|
|
53
|
-
parse:
|
|
54
|
-
match:
|
|
51
|
+
/** The conformance table, a `@fuzdev/fuz_schema` `object`. */
|
|
52
|
+
export const OriginConformance = object({
|
|
53
|
+
parse: pipe(array(OriginConformanceParseRow), min_length(1)),
|
|
54
|
+
match: pipe(array(OriginConformanceMatchRow), min_length(1))
|
|
55
55
|
});
|
|
56
56
|
/** The committed table, resolved relative to this module. */
|
|
57
57
|
export const ORIGIN_CONFORMANCE_URL = new URL('./origin_conformance.json', import.meta.url);
|
|
@@ -61,7 +61,7 @@ export const ORIGIN_CONFORMANCE_URL = new URL('./origin_conformance.json', impor
|
|
|
61
61
|
* @returns the parsed table
|
|
62
62
|
* @throws Error when the file doesn't match `OriginConformance`
|
|
63
63
|
*/
|
|
64
|
-
export const load_origin_conformance = () => OriginConformance
|
|
64
|
+
export const load_origin_conformance = () => parse_or_throw(OriginConformance, JSON.parse(readFileSync(ORIGIN_CONFORMANCE_URL, 'utf8')));
|
|
65
65
|
/**
|
|
66
66
|
* Flatten the table into action inputs and the answers they must get. A parse
|
|
67
67
|
* row sends a `null` origin, so a value that parses answers
|
|
@@ -127,8 +127,8 @@ export const describe_origin_conformance_cross_tests = (options) => {
|
|
|
127
127
|
for (const check of checks) {
|
|
128
128
|
const res = await cross_rpc_call(transport, rpc_path, testing_origin_check_action_spec.method, check.input, headers);
|
|
129
129
|
assert.ok(res.ok, `${check.label}: RPC failed: ${JSON.stringify(res.error)}`);
|
|
130
|
-
const parsed = TestingOriginCheckOutput
|
|
131
|
-
answers.push(parsed.
|
|
130
|
+
const parsed = parse(TestingOriginCheckOutput, res.result);
|
|
131
|
+
answers.push(parsed.ok ? parsed.value : res.result);
|
|
132
132
|
}
|
|
133
133
|
assert_origin_conformance(checks, answers, 'backend');
|
|
134
134
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rust_spine_consumer_surface.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/rust_spine_consumer_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAA6B,MAAM,8BAA8B,CAAC;AAM/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"rust_spine_consumer_surface.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/rust_spine_consumer_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAA6B,MAAM,8BAA8B,CAAC;AAM/F,OAAO,KA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_shape, create_account_route_shapes } from '../../a
|
|
|
4
4
|
import { create_signup_route_shape } from '../../auth/signup_route_schema.js';
|
|
5
5
|
import { create_standard_rpc_actions } from '../../auth/standard_rpc_actions.js';
|
|
6
6
|
import { create_health_route_spec } from '../../http/common_routes.js';
|
|
7
|
+
import { REST_FORBIDDEN_HOST } from '../../http/error_schemas.js';
|
|
7
8
|
import { prefix_route_specs } from '../../http/route_spec.js';
|
|
8
9
|
import { create_test_app_surface_spec, stub_handler, stub_mw } from '../stubs.js';
|
|
9
10
|
import { SPINE_ACCOUNT_PATH_PREFIX, SPINE_RPC_PATH } from './spine_surface_constants.js';
|
|
@@ -106,7 +107,12 @@ export const create_rust_spine_consumer_surface_spec = (options) => create_test_
|
|
|
106
107
|
daemon_token: true,
|
|
107
108
|
transform_middleware: options.host_gate
|
|
108
109
|
? (specs) => [
|
|
109
|
-
{
|
|
110
|
+
{
|
|
111
|
+
name: 'host_validation',
|
|
112
|
+
path: '*',
|
|
113
|
+
handler: stub_mw,
|
|
114
|
+
errors: [REST_FORBIDDEN_HOST]
|
|
115
|
+
},
|
|
110
116
|
...specs
|
|
111
117
|
]
|
|
112
118
|
: undefined
|