@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.
Files changed (181) hide show
  1. package/README.md +2 -1
  2. package/dist/actions/action_event_data.d.ts +1 -1
  3. package/dist/actions/action_rpc.d.ts.map +1 -1
  4. package/dist/actions/action_rpc.js +4 -0
  5. package/dist/actions/action_spec.d.ts +3 -3
  6. package/dist/actions/action_spec.d.ts.map +1 -1
  7. package/dist/auth/CLAUDE.md +1 -1
  8. package/dist/auth/account_route_schema.d.ts +3 -27
  9. package/dist/auth/account_route_schema.d.ts.map +1 -1
  10. package/dist/auth/account_route_schema.js +6 -20
  11. package/dist/auth/admin_action_specs.d.ts +56 -56
  12. package/dist/auth/audit_log_route_schema.d.ts +1 -1
  13. package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
  14. package/dist/auth/audit_log_route_schema.js +4 -5
  15. package/dist/auth/audit_log_schema.d.ts +18 -18
  16. package/dist/auth/bootstrap_route_schema.d.ts +1 -30
  17. package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
  18. package/dist/auth/bootstrap_route_schema.js +3 -8
  19. package/dist/auth/daemon_token.d.ts +4 -4
  20. package/dist/auth/daemon_token.d.ts.map +1 -1
  21. package/dist/auth/daemon_token.js +3 -3
  22. package/dist/auth/daemon_token_middleware.d.ts +1 -1
  23. package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
  24. package/dist/auth/daemon_token_middleware.js +5 -5
  25. package/dist/auth/middleware.js +4 -4
  26. package/dist/auth/role_grant_offer_action_specs.d.ts +2 -2
  27. package/dist/auth/signup_route_schema.d.ts.map +1 -1
  28. package/dist/auth/signup_route_schema.js +3 -7
  29. package/dist/db/CLAUDE.md +2 -1
  30. package/dist/db/file_fact_url.d.ts +11 -6
  31. package/dist/db/file_fact_url.d.ts.map +1 -1
  32. package/dist/db/file_fact_url.js +5 -5
  33. package/dist/db/schema_ready.d.ts +0 -5
  34. package/dist/db/schema_ready.d.ts.map +1 -1
  35. package/dist/db/schema_ready.js +0 -5
  36. package/dist/http/CLAUDE.md +104 -71
  37. package/dist/http/auth_shape.d.ts +48 -29
  38. package/dist/http/auth_shape.d.ts.map +1 -1
  39. package/dist/http/auth_shape.js +12 -85
  40. package/dist/http/body_limit.d.ts +12 -0
  41. package/dist/http/body_limit.d.ts.map +1 -1
  42. package/dist/http/body_limit.js +15 -0
  43. package/dist/http/body_limit_schema.d.ts +20 -0
  44. package/dist/http/body_limit_schema.d.ts.map +1 -0
  45. package/dist/http/body_limit_schema.js +20 -0
  46. package/dist/http/common_routes.d.ts +1 -1
  47. package/dist/http/common_routes.d.ts.map +1 -1
  48. package/dist/http/common_routes.js +11 -14
  49. package/dist/http/db_routes.d.ts.map +1 -1
  50. package/dist/http/db_routes.js +59 -69
  51. package/dist/http/dev_route_error_check.d.ts +70 -0
  52. package/dist/http/dev_route_error_check.d.ts.map +1 -0
  53. package/dist/http/dev_route_error_check.js +119 -0
  54. package/dist/http/error_schemas.d.ts +365 -189
  55. package/dist/http/error_schemas.d.ts.map +1 -1
  56. package/dist/http/error_schemas.js +256 -149
  57. package/dist/http/health_schema.d.ts +10 -6
  58. package/dist/http/health_schema.d.ts.map +1 -1
  59. package/dist/http/health_schema.js +3 -3
  60. package/dist/http/middleware_spec.d.ts +8 -3
  61. package/dist/http/middleware_spec.d.ts.map +1 -1
  62. package/dist/http/origin.d.ts +12 -43
  63. package/dist/http/origin.d.ts.map +1 -1
  64. package/dist/http/origin.js +10 -6
  65. package/dist/http/route_error_check.d.ts +158 -0
  66. package/dist/http/route_error_check.d.ts.map +1 -0
  67. package/dist/http/route_error_check.js +247 -0
  68. package/dist/http/route_errors.d.ts +80 -0
  69. package/dist/http/route_errors.d.ts.map +1 -0
  70. package/dist/http/route_errors.js +83 -0
  71. package/dist/http/route_spec.d.ts +33 -17
  72. package/dist/http/route_spec.d.ts.map +1 -1
  73. package/dist/http/route_spec.js +48 -62
  74. package/dist/http/schema_helpers.d.ts +0 -33
  75. package/dist/http/schema_helpers.d.ts.map +1 -1
  76. package/dist/http/schema_helpers.js +0 -45
  77. package/dist/http/surface.d.ts +19 -12
  78. package/dist/http/surface.d.ts.map +1 -1
  79. package/dist/http/surface.js +25 -38
  80. package/dist/http/surface_query.d.ts +11 -2
  81. package/dist/http/surface_query.d.ts.map +1 -1
  82. package/dist/http/surface_query.js +7 -1
  83. package/dist/primitive_schemas_fuz.d.ts +17 -3
  84. package/dist/primitive_schemas_fuz.d.ts.map +1 -1
  85. package/dist/primitive_schemas_fuz.js +13 -3
  86. package/dist/rate_limiter.d.ts +13 -0
  87. package/dist/rate_limiter.d.ts.map +1 -1
  88. package/dist/rate_limiter.js +20 -2
  89. package/dist/schema_issues.d.ts +29 -11
  90. package/dist/schema_issues.d.ts.map +1 -1
  91. package/dist/schema_issues.js +11 -10
  92. package/dist/schema_meta.d.ts +8 -1
  93. package/dist/schema_meta.d.ts.map +1 -1
  94. package/dist/schema_meta.js +2 -1
  95. package/dist/server/app_server.d.ts +3 -1
  96. package/dist/server/app_server.d.ts.map +1 -1
  97. package/dist/server/app_server.js +24 -10
  98. package/dist/server/serve_fact_route.d.ts.map +1 -1
  99. package/dist/server/serve_fact_route.js +8 -31
  100. package/dist/server/surface_route.d.ts.map +1 -1
  101. package/dist/server/surface_route.js +5 -6
  102. package/dist/server/x_accel.d.ts +12 -7
  103. package/dist/server/x_accel.d.ts.map +1 -1
  104. package/dist/server/x_accel.js +7 -9
  105. package/dist/testing/CLAUDE.md +33 -39
  106. package/dist/testing/admin_integration.js +1 -1
  107. package/dist/testing/adversarial_404.d.ts +4 -18
  108. package/dist/testing/adversarial_404.d.ts.map +1 -1
  109. package/dist/testing/adversarial_404.js +19 -51
  110. package/dist/testing/adversarial_headers.d.ts +3 -4
  111. package/dist/testing/adversarial_headers.d.ts.map +1 -1
  112. package/dist/testing/adversarial_headers.js +8 -6
  113. package/dist/testing/adversarial_input.d.ts.map +1 -1
  114. package/dist/testing/adversarial_input.js +18 -17
  115. package/dist/testing/assertions.d.ts +33 -11
  116. package/dist/testing/assertions.d.ts.map +1 -1
  117. package/dist/testing/assertions.js +52 -12
  118. package/dist/testing/attack_surface.d.ts +5 -35
  119. package/dist/testing/attack_surface.d.ts.map +1 -1
  120. package/dist/testing/attack_surface.js +29 -91
  121. package/dist/testing/auth_apps.d.ts.map +1 -1
  122. package/dist/testing/auth_apps.js +2 -1
  123. package/dist/testing/cross_backend/action_manifest.d.ts +126 -56
  124. package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
  125. package/dist/testing/cross_backend/action_manifest.js +11 -11
  126. package/dist/testing/cross_backend/action_manifest_parity.d.ts +1 -1
  127. package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
  128. package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
  129. package/dist/testing/cross_backend/cell_crud.js +2 -1
  130. package/dist/testing/cross_backend/conformance_table.js +1 -1
  131. package/dist/testing/cross_backend/fact_serving.js +3 -3
  132. package/dist/testing/cross_backend/origin_conformance.d.ts +278 -102
  133. package/dist/testing/cross_backend/origin_conformance.d.ts.map +1 -1
  134. package/dist/testing/cross_backend/origin_conformance.js +21 -21
  135. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
  136. package/dist/testing/cross_backend/rust_spine_consumer_surface.js +7 -1
  137. package/dist/testing/cross_backend/setup.d.ts +13 -0
  138. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  139. package/dist/testing/cross_backend/setup.js +24 -7
  140. package/dist/testing/cross_backend/testing_origin_check.d.ts +147 -71
  141. package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -1
  142. package/dist/testing/cross_backend/testing_origin_check.js +16 -13
  143. package/dist/testing/cross_backend/testing_reset_actions.d.ts +70 -27
  144. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  145. package/dist/testing/data_exposure.d.ts.map +1 -1
  146. package/dist/testing/data_exposure.js +5 -4
  147. package/dist/testing/error_coverage.d.ts +24 -34
  148. package/dist/testing/error_coverage.d.ts.map +1 -1
  149. package/dist/testing/error_coverage.js +46 -89
  150. package/dist/testing/integration.d.ts.map +1 -1
  151. package/dist/testing/integration.js +5 -13
  152. package/dist/testing/integration_helpers.d.ts +37 -9
  153. package/dist/testing/integration_helpers.d.ts.map +1 -1
  154. package/dist/testing/integration_helpers.js +86 -40
  155. package/dist/testing/middleware.d.ts +3 -5
  156. package/dist/testing/middleware.d.ts.map +1 -1
  157. package/dist/testing/middleware.js +5 -4
  158. package/dist/testing/rate_limiting.d.ts +1 -1
  159. package/dist/testing/rate_limiting.d.ts.map +1 -1
  160. package/dist/testing/rate_limiting.js +5 -4
  161. package/dist/testing/round_trip.d.ts.map +1 -1
  162. package/dist/testing/round_trip.js +5 -3
  163. package/dist/testing/schema_generators.d.ts +10 -3
  164. package/dist/testing/schema_generators.d.ts.map +1 -1
  165. package/dist/testing/schema_generators.js +23 -11
  166. package/dist/testing/stubs.d.ts +10 -1
  167. package/dist/testing/stubs.d.ts.map +1 -1
  168. package/dist/testing/stubs.js +15 -5
  169. package/dist/testing/surface_invariants.d.ts +36 -115
  170. package/dist/testing/surface_invariants.d.ts.map +1 -1
  171. package/dist/testing/surface_invariants.js +106 -269
  172. package/dist/ui/CLAUDE.md +4 -2
  173. package/dist/ui/auth_state.svelte.d.ts.map +1 -1
  174. package/dist/ui/auth_state.svelte.js +2 -8
  175. package/dist/ui/backend_probe.svelte.js +3 -3
  176. package/dist/ui/table_state.svelte.d.ts.map +1 -1
  177. package/dist/ui/table_state.svelte.js +1 -8
  178. package/dist/ui/ui_fetch.d.ts +12 -2
  179. package/dist/ui/ui_fetch.d.ts.map +1 -1
  180. package/dist/ui/ui_fetch.js +22 -4
  181. 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`. The shared shape behind the parse-based
193
- * `capture_*` cross-impl parity probes: call a `_testing_*` introspection
194
- * action over the keeper's daemon-token channel, then `parse` so a shape
195
- * drift between the TS and Rust answers fails loud at the boundary.
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.parse(raw);
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 { z } from 'zod';
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: z.ZodObject<{
18
- patterns: z.ZodString;
19
- origin: z.ZodNullable<z.ZodString>;
20
- }, z.core.$strict>;
21
- export type TestingOriginCheckInput = z.infer<typeof TestingOriginCheckInput>;
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`: 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.
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: 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>;
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: 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>]>;
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,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAS3E,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"}
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 { z } from 'zod';
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 = z.strictObject({
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: z.string(),
21
+ patterns: string,
22
22
  /** One `Origin` header's value, or `null` for a request without one. */
23
- origin: z.string().nullable()
23
+ origin: nullable(string)
24
24
  });
25
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.
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 = 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 }))
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: z.ZodObject<{
584
- methods: z.ZodArray<z.ZodObject<{
585
- method: z.ZodString;
586
- input: z.ZodEnum<{
587
- object: "object";
588
- void: "void";
589
- }>;
590
- side_effects: z.ZodBoolean;
591
- account: z.ZodEnum<{
592
- optional: "optional";
593
- none: "none";
594
- required: "required";
595
- }>;
596
- actor: z.ZodEnum<{
597
- optional: "optional";
598
- none: "none";
599
- required: "required";
600
- }>;
601
- roles: z.ZodArray<z.ZodString>;
602
- credential_types: z.ZodArray<z.ZodString>;
603
- rate_limit: z.ZodNullable<z.ZodEnum<{
604
- account: "account";
605
- ip: "ip";
606
- both: "both";
607
- }>>;
608
- }, z.core.$strict>>;
609
- }, z.core.$strict>;
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_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/testing_reset_actions.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC,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
+ {"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8EG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAO3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAsBzC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCQ,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;CAkBA,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;CAwBC,CAAC;AAE/C;;;;;;;;;GASG;AACH,eAA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,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: `${r.method} ${r.path}`,
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 = `${spec.method} ${spec.path}`;
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 = `${spec.method} ${spec.path}`;
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 = `${spec.method} ${spec.path}`;
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