@fuzdev/fuz_app 0.163.0 → 0.164.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 +104 -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 +158 -0
- package/dist/http/route_error_check.d.ts.map +1 -0
- package/dist/http/route_error_check.js +247 -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 +0 -33
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +0 -45
- 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 +33 -39
- package/dist/testing/admin_integration.js +1 -1
- 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 +19 -51
- 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 +18 -17
- package/dist/testing/assertions.d.ts +33 -11
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +52 -12
- package/dist/testing/attack_surface.d.ts +5 -35
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +29 -91
- 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/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/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.map +1 -1
- package/dist/testing/data_exposure.js +5 -4
- package/dist/testing/error_coverage.d.ts +24 -34
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +46 -89
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +5 -13
- 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 +86 -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/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.map +1 -1
- package/dist/testing/round_trip.js +5 -3
- package/dist/testing/schema_generators.d.ts +10 -3
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +23 -11
- 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/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
|
@@ -21,11 +21,10 @@ import '../assert_dev_env.js';
|
|
|
21
21
|
*
|
|
22
22
|
* @module
|
|
23
23
|
*/
|
|
24
|
-
import { z } from 'zod';
|
|
25
24
|
import { array, literal, parse, string, strip_object } from '@fuzdev/fuz_schema/schema.ts';
|
|
26
25
|
import { USERNAME_LENGTH_MAX } from '../../primitive_schemas.js';
|
|
27
26
|
import { Uuid } from '../../primitive_schemas_fuz.js';
|
|
28
|
-
import { format_issues } from '../../schema_issues.js';
|
|
27
|
+
import { format_issues, parse_any } from '../../schema_issues.js';
|
|
29
28
|
import { DAEMON_TOKEN_HEADER } from '../../auth/daemon_token.js';
|
|
30
29
|
import { DEFAULT_TEST_PASSWORD } from '../test_credentials.js';
|
|
31
30
|
import { create_fetch_transport } from '../transports/fetch_transport.js';
|
|
@@ -187,12 +186,30 @@ export const capture_schema_snapshot = async (handle, options = {}) => {
|
|
|
187
186
|
// reconcile first, so it's left as a follow-up.
|
|
188
187
|
return raw;
|
|
189
188
|
};
|
|
189
|
+
/**
|
|
190
|
+
* Parse a `capture_*` probe's answer with `schema`, of either library: the
|
|
191
|
+
* parsed value, or a throw naming `method` with the issues, so a shape drift
|
|
192
|
+
* between the TS and Rust answers fails loud at the boundary.
|
|
193
|
+
*
|
|
194
|
+
* @param method - the `_testing_*` method that answered, named in the error
|
|
195
|
+
* @param schema - the answer's schema
|
|
196
|
+
* @param raw - the answer as it came off the wire
|
|
197
|
+
* @returns the parsed answer, the schema's output
|
|
198
|
+
* @throws Error when `raw` fails `schema`
|
|
199
|
+
*/
|
|
200
|
+
export const parse_capture_answer = (method, schema, raw) => {
|
|
201
|
+
const parsed = parse_any(schema, raw);
|
|
202
|
+
if (!parsed.ok) {
|
|
203
|
+
throw new Error(`${method}: the answer fails its schema:\n${format_issues(parsed.issues)}`);
|
|
204
|
+
}
|
|
205
|
+
return parsed.value;
|
|
206
|
+
};
|
|
190
207
|
/**
|
|
191
208
|
* Capture a no-arg (void-input) daemon-token introspection RPC, sent with no
|
|
192
|
-
* params, and validate the wire response against `schema
|
|
193
|
-
* `capture_*` cross-impl parity
|
|
194
|
-
* action over the keeper's
|
|
195
|
-
*
|
|
209
|
+
* params, and validate the wire response against `schema`, of either library.
|
|
210
|
+
* The shared shape behind the parse-based `capture_*` cross-impl parity
|
|
211
|
+
* probes: call a `_testing_*` introspection action over the keeper's
|
|
212
|
+
* daemon-token channel, then `parse_capture_answer`.
|
|
196
213
|
*
|
|
197
214
|
* (`capture_schema_snapshot` deliberately stays separate: it *casts* rather
|
|
198
215
|
* than parses — narrowing a large snapshot to the Zod model would silently
|
|
@@ -201,7 +218,7 @@ export const capture_schema_snapshot = async (handle, options = {}) => {
|
|
|
201
218
|
*/
|
|
202
219
|
const capture_via_daemon = async (handle, method, schema) => {
|
|
203
220
|
const raw = await rpc_via_transport(handle.keeper_daemon_transport, handle.config.rpc_path, method, undefined, handle.config.name, { [DAEMON_TOKEN_HEADER]: handle.daemon_token });
|
|
204
|
-
return schema
|
|
221
|
+
return parse_capture_answer(method, schema, raw);
|
|
205
222
|
};
|
|
206
223
|
/**
|
|
207
224
|
* Capture a backend's live RPC action manifest over the
|
|
@@ -11,48 +11,86 @@ import '../assert_dev_env.js';
|
|
|
11
11
|
*
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
14
|
+
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
15
15
|
import { type RpcAction } from '../../actions/action_types.js';
|
|
16
|
-
/** Input of `_testing_origin_check`. */
|
|
17
|
-
export declare const TestingOriginCheckInput:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
|
|
16
|
+
/** Input of `_testing_origin_check`, a `@fuzdev/fuz_schema` `object`. */
|
|
17
|
+
export declare const TestingOriginCheckInput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
18
|
+
origin: string | null;
|
|
19
|
+
patterns: string;
|
|
20
|
+
}, {
|
|
21
|
+
origin: string | null;
|
|
22
|
+
patterns: string;
|
|
23
|
+
}, "object", {
|
|
24
|
+
/** An allowlist value, as `FUZ_ALLOWED_ORIGINS` would carry it. */
|
|
25
|
+
patterns: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
26
|
+
/** One `Origin` header's value, or `null` for a request without one. */
|
|
27
|
+
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>>>;
|
|
28
|
+
}>;
|
|
29
|
+
export type TestingOriginCheckInput = Infer<typeof TestingOriginCheckInput>;
|
|
22
30
|
/**
|
|
23
|
-
* Output of `_testing_origin_check
|
|
24
|
-
* parses, else every refusal — `index` the
|
|
25
|
-
* a list-level refusal.
|
|
31
|
+
* Output of `_testing_origin_check`, a `@fuzdev/fuz_schema` `union`: the
|
|
32
|
+
* request-level answer when the list parses, else every refusal — `index` the
|
|
33
|
+
* 1-based entry position, absent for a list-level refusal.
|
|
26
34
|
*/
|
|
27
|
-
export declare const TestingOriginCheckOutput:
|
|
28
|
-
ok:
|
|
29
|
-
allowed:
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
index
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
35
|
+
export declare const TestingOriginCheckOutput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
36
|
+
ok: true;
|
|
37
|
+
allowed: boolean;
|
|
38
|
+
} | {
|
|
39
|
+
errors: {
|
|
40
|
+
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";
|
|
41
|
+
index?: number | undefined;
|
|
42
|
+
}[];
|
|
43
|
+
ok: false;
|
|
44
|
+
}, {
|
|
45
|
+
ok: true;
|
|
46
|
+
allowed: boolean;
|
|
47
|
+
} | {
|
|
48
|
+
errors: {
|
|
49
|
+
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";
|
|
50
|
+
index?: number | undefined;
|
|
51
|
+
}[];
|
|
52
|
+
ok: false;
|
|
53
|
+
}, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
54
|
+
ok: true;
|
|
55
|
+
allowed: boolean;
|
|
56
|
+
}, {
|
|
57
|
+
ok: true;
|
|
58
|
+
allowed: boolean;
|
|
59
|
+
}, "object", {
|
|
60
|
+
ok: import("@fuzdev/fuz_schema/schema.ts").Schema<true, true, "literal", true>;
|
|
61
|
+
allowed: import("@fuzdev/fuz_schema/schema.ts").Schema<boolean, boolean, "boolean", undefined>;
|
|
62
|
+
}>, import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
63
|
+
errors: {
|
|
64
|
+
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";
|
|
65
|
+
index?: number | undefined;
|
|
66
|
+
}[];
|
|
67
|
+
ok: false;
|
|
68
|
+
}, {
|
|
69
|
+
errors: {
|
|
70
|
+
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";
|
|
71
|
+
index?: number | undefined;
|
|
72
|
+
}[];
|
|
73
|
+
ok: false;
|
|
74
|
+
}, "object", {
|
|
75
|
+
ok: import("@fuzdev/fuz_schema/schema.ts").Schema<false, false, "literal", false>;
|
|
76
|
+
errors: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
77
|
+
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";
|
|
78
|
+
index?: number | undefined;
|
|
79
|
+
}[], {
|
|
80
|
+
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";
|
|
81
|
+
index?: number | undefined;
|
|
82
|
+
}[], "array", import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
83
|
+
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";
|
|
84
|
+
index?: number | undefined;
|
|
85
|
+
}, {
|
|
86
|
+
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";
|
|
87
|
+
index?: number | undefined;
|
|
88
|
+
}, "object", {
|
|
89
|
+
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>>>>;
|
|
90
|
+
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"]>;
|
|
91
|
+
}>>;
|
|
92
|
+
}>]>;
|
|
93
|
+
export type TestingOriginCheckOutput = Infer<typeof TestingOriginCheckOutput>;
|
|
56
94
|
/**
|
|
57
95
|
* Answer one `_testing_origin_check` input: parse `patterns` with
|
|
58
96
|
* `parse_allowed_origins`, then run the request-level check for one `Origin`
|
|
@@ -88,38 +126,76 @@ export declare const testing_origin_check_action_spec: {
|
|
|
88
126
|
readonly credential_types: readonly ["daemon_token"];
|
|
89
127
|
};
|
|
90
128
|
readonly side_effects: false;
|
|
91
|
-
readonly input:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
129
|
+
readonly input: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
130
|
+
origin: string | null;
|
|
131
|
+
patterns: string;
|
|
132
|
+
}, {
|
|
133
|
+
origin: string | null;
|
|
134
|
+
patterns: string;
|
|
135
|
+
}, "object", {
|
|
136
|
+
/** An allowlist value, as `FUZ_ALLOWED_ORIGINS` would carry it. */
|
|
137
|
+
patterns: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
138
|
+
/** One `Origin` header's value, or `null` for a request without one. */
|
|
139
|
+
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>>>;
|
|
140
|
+
}>;
|
|
141
|
+
readonly output: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
142
|
+
ok: true;
|
|
143
|
+
allowed: boolean;
|
|
144
|
+
} | {
|
|
145
|
+
errors: {
|
|
146
|
+
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";
|
|
147
|
+
index?: number | undefined;
|
|
148
|
+
}[];
|
|
149
|
+
ok: false;
|
|
150
|
+
}, {
|
|
151
|
+
ok: true;
|
|
152
|
+
allowed: boolean;
|
|
153
|
+
} | {
|
|
154
|
+
errors: {
|
|
155
|
+
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";
|
|
156
|
+
index?: number | undefined;
|
|
157
|
+
}[];
|
|
158
|
+
ok: false;
|
|
159
|
+
}, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
160
|
+
ok: true;
|
|
161
|
+
allowed: boolean;
|
|
162
|
+
}, {
|
|
163
|
+
ok: true;
|
|
164
|
+
allowed: boolean;
|
|
165
|
+
}, "object", {
|
|
166
|
+
ok: import("@fuzdev/fuz_schema/schema.ts").Schema<true, true, "literal", true>;
|
|
167
|
+
allowed: import("@fuzdev/fuz_schema/schema.ts").Schema<boolean, boolean, "boolean", undefined>;
|
|
168
|
+
}>, import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
169
|
+
errors: {
|
|
170
|
+
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";
|
|
171
|
+
index?: number | undefined;
|
|
172
|
+
}[];
|
|
173
|
+
ok: false;
|
|
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
|
+
ok: false;
|
|
180
|
+
}, "object", {
|
|
181
|
+
ok: import("@fuzdev/fuz_schema/schema.ts").Schema<false, false, "literal", false>;
|
|
182
|
+
errors: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
183
|
+
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";
|
|
184
|
+
index?: number | undefined;
|
|
185
|
+
}[], {
|
|
186
|
+
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";
|
|
187
|
+
index?: number | undefined;
|
|
188
|
+
}[], "array", import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
189
|
+
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";
|
|
190
|
+
index?: number | undefined;
|
|
191
|
+
}, {
|
|
192
|
+
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";
|
|
193
|
+
index?: number | undefined;
|
|
194
|
+
}, "object", {
|
|
195
|
+
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>>>>;
|
|
196
|
+
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"]>;
|
|
197
|
+
}>>;
|
|
198
|
+
}>]>;
|
|
123
199
|
readonly async: true;
|
|
124
200
|
readonly description: string;
|
|
125
201
|
};
|
|
@@ -1 +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,
|
|
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,EAaN,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAS3E,yEAAyE;AACzE,eAAO,MAAM,uBAAuB;;;;;;;IACnC,mEAAmE;;IAEnE,wEAAwE;;EAEvE,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE5E;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAWnC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE9E;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,GACpC,OAAO,uBAAuB,KAC5B,wBAcF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;QApE5C,mEAAmE;;QAEnE,wEAAwE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8E3B,CAAC;AAE/C,8EAA8E;AAC9E,eAAO,MAAM,kCAAkC,QAAO,SACyC,CAAC"}
|
|
@@ -11,27 +11,30 @@ import '../assert_dev_env.js';
|
|
|
11
11
|
*
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
14
|
+
import { array, boolean, literal, min_value, nullable, number, object, optional, pipe, safe_integer, string, union } from '@fuzdev/fuz_schema/schema.ts';
|
|
15
15
|
import { rpc_action } from '../../actions/action_types.js';
|
|
16
16
|
import { AllowedOriginsErrorKind, parse_allowed_origins, should_allow_origin } from '../../http/origin.js';
|
|
17
17
|
import { TESTING_ACTION_AUTH } from './spine_surface_constants.js';
|
|
18
|
-
/** Input of `_testing_origin_check`. */
|
|
19
|
-
export const TestingOriginCheckInput =
|
|
18
|
+
/** Input of `_testing_origin_check`, a `@fuzdev/fuz_schema` `object`. */
|
|
19
|
+
export const TestingOriginCheckInput = object({
|
|
20
20
|
/** An allowlist value, as `FUZ_ALLOWED_ORIGINS` would carry it. */
|
|
21
|
-
patterns:
|
|
21
|
+
patterns: string,
|
|
22
22
|
/** One `Origin` header's value, or `null` for a request without one. */
|
|
23
|
-
origin:
|
|
23
|
+
origin: nullable(string)
|
|
24
24
|
});
|
|
25
25
|
/**
|
|
26
|
-
* Output of `_testing_origin_check
|
|
27
|
-
* parses, else every refusal — `index` the
|
|
28
|
-
* a list-level refusal.
|
|
26
|
+
* Output of `_testing_origin_check`, a `@fuzdev/fuz_schema` `union`: the
|
|
27
|
+
* request-level answer when the list parses, else every refusal — `index` the
|
|
28
|
+
* 1-based entry position, absent for a list-level refusal.
|
|
29
29
|
*/
|
|
30
|
-
export const TestingOriginCheckOutput =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
ok:
|
|
34
|
-
errors:
|
|
30
|
+
export const TestingOriginCheckOutput = union([
|
|
31
|
+
object({ ok: literal(true), allowed: boolean }),
|
|
32
|
+
object({
|
|
33
|
+
ok: literal(false),
|
|
34
|
+
errors: array(object({
|
|
35
|
+
index: optional(pipe(number, safe_integer, min_value(1))),
|
|
36
|
+
kind: AllowedOriginsErrorKind
|
|
37
|
+
}))
|
|
35
38
|
})
|
|
36
39
|
]);
|
|
37
40
|
/**
|
|
@@ -580,33 +580,76 @@ export declare const testing_action_manifest_action_spec: {
|
|
|
580
580
|
};
|
|
581
581
|
readonly side_effects: false;
|
|
582
582
|
readonly input: z.ZodVoid;
|
|
583
|
-
readonly output:
|
|
584
|
-
methods:
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
rate_limit:
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
583
|
+
readonly output: import("@fuzdev/fuz_schema/schema.js").Schema<{
|
|
584
|
+
methods: {
|
|
585
|
+
input: "object" | "void";
|
|
586
|
+
account: "optional" | "none" | "required";
|
|
587
|
+
actor: "optional" | "none" | "required";
|
|
588
|
+
roles: string[];
|
|
589
|
+
credential_types: string[];
|
|
590
|
+
method: string;
|
|
591
|
+
side_effects: boolean;
|
|
592
|
+
rate_limit: "account" | "ip" | "both" | null;
|
|
593
|
+
}[];
|
|
594
|
+
}, {
|
|
595
|
+
methods: {
|
|
596
|
+
input: "object" | "void";
|
|
597
|
+
account: "optional" | "none" | "required";
|
|
598
|
+
actor: "optional" | "none" | "required";
|
|
599
|
+
roles: string[];
|
|
600
|
+
credential_types: string[];
|
|
601
|
+
method: string;
|
|
602
|
+
side_effects: boolean;
|
|
603
|
+
rate_limit: "account" | "ip" | "both" | null;
|
|
604
|
+
}[];
|
|
605
|
+
}, "object", {
|
|
606
|
+
methods: import("@fuzdev/fuz_schema/schema.js").Schema<{
|
|
607
|
+
input: "object" | "void";
|
|
608
|
+
account: "optional" | "none" | "required";
|
|
609
|
+
actor: "optional" | "none" | "required";
|
|
610
|
+
roles: string[];
|
|
611
|
+
credential_types: string[];
|
|
612
|
+
method: string;
|
|
613
|
+
side_effects: boolean;
|
|
614
|
+
rate_limit: "account" | "ip" | "both" | null;
|
|
615
|
+
}[], {
|
|
616
|
+
input: "object" | "void";
|
|
617
|
+
account: "optional" | "none" | "required";
|
|
618
|
+
actor: "optional" | "none" | "required";
|
|
619
|
+
roles: string[];
|
|
620
|
+
credential_types: string[];
|
|
621
|
+
method: string;
|
|
622
|
+
side_effects: boolean;
|
|
623
|
+
rate_limit: "account" | "ip" | "both" | null;
|
|
624
|
+
}[], "array", import("@fuzdev/fuz_schema/schema.js").Schema<{
|
|
625
|
+
input: "object" | "void";
|
|
626
|
+
account: "optional" | "none" | "required";
|
|
627
|
+
actor: "optional" | "none" | "required";
|
|
628
|
+
roles: string[];
|
|
629
|
+
credential_types: string[];
|
|
630
|
+
method: string;
|
|
631
|
+
side_effects: boolean;
|
|
632
|
+
rate_limit: "account" | "ip" | "both" | null;
|
|
633
|
+
}, {
|
|
634
|
+
input: "object" | "void";
|
|
635
|
+
account: "optional" | "none" | "required";
|
|
636
|
+
actor: "optional" | "none" | "required";
|
|
637
|
+
roles: string[];
|
|
638
|
+
credential_types: string[];
|
|
639
|
+
method: string;
|
|
640
|
+
side_effects: boolean;
|
|
641
|
+
rate_limit: "account" | "ip" | "both" | null;
|
|
642
|
+
}, "object", {
|
|
643
|
+
method: import("@fuzdev/fuz_schema/schema.js").Schema<string, string, "string", undefined>;
|
|
644
|
+
input: import("@fuzdev/fuz_schema/schema.js").Schema<"object" | "void", "object" | "void", "one_of", readonly ["void", "object"]>;
|
|
645
|
+
side_effects: import("@fuzdev/fuz_schema/schema.js").Schema<boolean, boolean, "boolean", undefined>;
|
|
646
|
+
account: import("@fuzdev/fuz_schema/schema.js").Schema<"optional" | "none" | "required", "optional" | "none" | "required", "one_of", readonly ["none", "optional", "required"]>;
|
|
647
|
+
actor: import("@fuzdev/fuz_schema/schema.js").Schema<"optional" | "none" | "required", "optional" | "none" | "required", "one_of", readonly ["none", "optional", "required"]>;
|
|
648
|
+
roles: import("@fuzdev/fuz_schema/schema.js").Schema<string[], string[], "array", import("@fuzdev/fuz_schema/schema.js").Schema<string, string, "string", undefined>>;
|
|
649
|
+
credential_types: import("@fuzdev/fuz_schema/schema.js").Schema<string[], string[], "array", import("@fuzdev/fuz_schema/schema.js").Schema<string, string, "string", undefined>>;
|
|
650
|
+
rate_limit: import("@fuzdev/fuz_schema/schema.js").Schema<"account" | "ip" | "both" | null, "account" | "ip" | "both" | null, "nullable", import("@fuzdev/fuz_schema/schema.js").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.js").Schema<"account" | "ip" | "both", "account" | "ip" | "both", "one_of", readonly ["ip", "account", "both"]>>>;
|
|
651
|
+
}>>;
|
|
652
|
+
}>;
|
|
610
653
|
readonly async: true;
|
|
611
654
|
readonly description: string;
|
|
612
655
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing_reset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AAkB,EAAE,gBAAgB,CAAC;IAC9C;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACxD;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,GAClC,MAAM,OAAO,EACb,SAAS,2BAA2B,KAClC,KAAK,CAAC,SAAS,CAwJjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_exposure.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/data_exposure.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAwB7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"data_exposure.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/data_exposure.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAwB7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAuBzD,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,0BAA0B,CAAC;AAIvE;;;;;;;;GAQG;AACH,eAAO,MAAM,kCAAkC,GAAI,QAAQ,OAAO,KAAG,GAAG,CAAC,MAAM,CAmC9E,CAAC;AA0HF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,yCAAyC,GACrD,gBAAgB,cAAc,EAC9B,mBAAkB,aAAa,CAAC,MAAM,CAA6B,EACnE,cAAc,aAAa,CAAC,MAAM,CAAC,KACjC,IAOF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wCAAwC,GACpD,gBAAgB,cAAc,EAC9B,oBAAmB,aAAa,CAAC,MAAM,CAA8B,EACrE,cAAc,aAAa,CAAC,MAAM,CAAC,KACjC,IAYF,CAAC;AAIF,kDAAkD;AAClD,MAAM,WAAW,uBAAuB;IACvC,kEAAkE;IAClE,UAAU,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,cAAc,EAAE,cAAc,CAAC;IAC/B,2FAA2F;IAC3F,gBAAgB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACzC,iGAAiG;IACjG,iBAAiB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC1C;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC5B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,GAAI,SAAS,uBAAuB,KAAG,IAiM/E,CAAC"}
|
|
@@ -19,6 +19,7 @@ import './assert_dev_env.js';
|
|
|
19
19
|
* @module
|
|
20
20
|
*/
|
|
21
21
|
import { describe, test, beforeAll, assert } from 'vitest';
|
|
22
|
+
import { format_route_key } from '../http/surface_query.js';
|
|
22
23
|
import { ROLE_ADMIN, ROLE_KEEPER } from '../auth/role_schema.js';
|
|
23
24
|
import { create_test_request_headers } from './test_origin.js';
|
|
24
25
|
import { resolve_valid_path, generate_valid_body, to_route_content_type } from './schema_generators.js';
|
|
@@ -88,7 +89,7 @@ const collect_output_schema_entries = (surface_source) => {
|
|
|
88
89
|
const entries = [];
|
|
89
90
|
for (const r of surface_source.route_specs) {
|
|
90
91
|
entries.push({
|
|
91
|
-
key:
|
|
92
|
+
key: format_route_key(r),
|
|
92
93
|
kind: 'route',
|
|
93
94
|
schema: r.output,
|
|
94
95
|
elevated: is_elevated_auth(r.auth)
|
|
@@ -253,7 +254,7 @@ export const describe_data_exposure_tests = (options) => {
|
|
|
253
254
|
test('unauthenticated error responses contain no sensitive fields', async () => {
|
|
254
255
|
const protected_specs = route_specs.filter((s) => !is_public_auth(s.auth));
|
|
255
256
|
for (const spec of protected_specs) {
|
|
256
|
-
const route_key =
|
|
257
|
+
const route_key = format_route_key(spec);
|
|
257
258
|
if (skip_set.has(route_key))
|
|
258
259
|
continue;
|
|
259
260
|
const url = resolve_valid_path(spec.path, spec.params);
|
|
@@ -282,7 +283,7 @@ export const describe_data_exposure_tests = (options) => {
|
|
|
282
283
|
test('admin routes return 403 for non-admin user', async () => {
|
|
283
284
|
const admin_specs = route_specs.filter((s) => s.auth.roles?.includes('admin') ?? false);
|
|
284
285
|
for (const spec of admin_specs) {
|
|
285
|
-
const route_key =
|
|
286
|
+
const route_key = format_route_key(spec);
|
|
286
287
|
if (skip_set.has(route_key))
|
|
287
288
|
continue;
|
|
288
289
|
const url = resolve_valid_path(spec.path, spec.params);
|
|
@@ -318,7 +319,7 @@ export const describe_data_exposure_tests = (options) => {
|
|
|
318
319
|
return 0;
|
|
319
320
|
});
|
|
320
321
|
for (const spec of sorted_specs) {
|
|
321
|
-
const route_key =
|
|
322
|
+
const route_key = format_route_key(spec);
|
|
322
323
|
if (skip_set.has(route_key))
|
|
323
324
|
continue;
|
|
324
325
|
// keeper auth (daemon token) is strictly more privileged than admin
|