@fuzdev/fuz_app 0.153.0 → 0.155.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/CLAUDE.md +2 -2
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +14 -14
- package/dist/actions/peer_ping.js +3 -3
- package/dist/actions/perform_action.d.ts +12 -10
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +19 -16
- package/dist/auth/cell_actions.d.ts +6 -4
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_actions.js +10 -9
- package/dist/env/env_schemas.d.ts +41 -0
- package/dist/env/env_schemas.d.ts.map +1 -0
- package/dist/env/env_schemas.js +55 -0
- package/dist/env/load.d.ts +23 -15
- package/dist/env/load.d.ts.map +1 -1
- package/dist/env/load.js +38 -22
- package/dist/http/CLAUDE.md +14 -8
- package/dist/http/schema_helpers.d.ts +102 -23
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +241 -38
- package/dist/http/surface.d.ts +20 -11
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +59 -32
- package/dist/primitive_schemas.d.ts +13 -4
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +13 -4
- package/dist/schema_issues.d.ts +96 -0
- package/dist/schema_issues.d.ts.map +1 -0
- package/dist/schema_issues.js +110 -0
- package/dist/schema_meta.d.ts +38 -13
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +63 -13
- package/dist/sensitivity.d.ts +34 -1
- package/dist/sensitivity.d.ts.map +1 -1
- package/dist/sensitivity.js +32 -2
- package/dist/server/app_server.d.ts +6 -5
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +0 -1
- package/dist/server/env.d.ts +52 -30
- package/dist/server/env.d.ts.map +1 -1
- package/dist/server/env.js +38 -43
- package/dist/testing/CLAUDE.md +23 -10
- package/dist/testing/adversarial_404.d.ts +15 -0
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_404.js +26 -19
- package/dist/testing/adversarial_input_cases.d.ts.map +1 -1
- package/dist/testing/adversarial_input_cases.js +2 -2
- package/dist/testing/app_server.js +2 -2
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.js +7 -5
- package/dist/testing/cross_backend/identity_parity.js +2 -2
- package/dist/testing/cross_backend/standard.d.ts +3 -2
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/daemon_info.d.ts +7 -2
- package/dist/testing/daemon_info.d.ts.map +1 -1
- package/dist/testing/daemon_info.js +8 -3
- package/dist/testing/data_exposure.d.ts +43 -9
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +151 -35
- package/dist/testing/schema_generators.d.ts +21 -9
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +52 -47
- package/dist/testing/stubs.d.ts +2 -2
- package/dist/testing/stubs.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1,21 +1,49 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AppSurfaceSpec } from '../http/surface.js';
|
|
3
3
|
import type { SetupTest } from './cross_backend/setup.js';
|
|
4
4
|
/**
|
|
5
5
|
* Recursively collect all property names from a JSON Schema.
|
|
6
6
|
*
|
|
7
|
-
* Walks `properties`, `
|
|
8
|
-
* `
|
|
7
|
+
* Walks `properties`, `patternProperties`, `additionalProperties`, `items`,
|
|
8
|
+
* `prefixItems`, `contains`, `allOf`/`anyOf`/`oneOf`, `not`/`if`/`then`/`else`,
|
|
9
|
+
* and the values of `$defs`/`definitions` (where a recursive or registered
|
|
10
|
+
* schema's body sits behind a `$ref`) to find every declared field name at
|
|
11
|
+
* any depth.
|
|
9
12
|
*/
|
|
10
13
|
export declare const collect_json_schema_property_names: (schema: unknown) => Set<string>;
|
|
11
14
|
/**
|
|
12
|
-
* Assert that no output schema
|
|
15
|
+
* Assert that no output schema — of a route, an RPC method, or a WebSocket
|
|
16
|
+
* method, or the params of a message the server pushes over WebSocket (a
|
|
17
|
+
* `remote_notification`, or a `request_response` the backend initiates) —
|
|
18
|
+
* contains sensitive field names.
|
|
19
|
+
*
|
|
20
|
+
* Each output is read on both sides (`schema_to_surface`): the output side the
|
|
21
|
+
* surface records, and the input side, since a transform's output has no JSON
|
|
22
|
+
* Schema form and a field inside a transformed subtree shows only there. The
|
|
23
|
+
* input side is a superset, so a transform that deliberately drops a
|
|
24
|
+
* sensitive field is flagged too; skip that output by its key.
|
|
25
|
+
*
|
|
26
|
+
* @param surface_source - the surface with the specs it was generated from
|
|
27
|
+
* @param sensitive_fields - field names no output may carry
|
|
28
|
+
* @param skip_routes - outputs to skip: `'METHOD /path'` for a route, `'/path method_name'` for an RPC or WS method, `'/path method_name params'` for pushed params
|
|
29
|
+
* @throws Error when an output schema can't be written as JSON Schema on either side
|
|
13
30
|
*/
|
|
14
|
-
export declare const assert_output_schemas_no_sensitive_fields: (
|
|
31
|
+
export declare const assert_output_schemas_no_sensitive_fields: (surface_source: AppSurfaceSpec, sensitive_fields?: ReadonlyArray<string>, skip_routes?: ReadonlyArray<string>) => void;
|
|
15
32
|
/**
|
|
16
|
-
* Assert that non-admin
|
|
33
|
+
* Assert that route output schemas a non-admin can reach — routes without an
|
|
34
|
+
* admin or keeper gate — don't contain admin-only field names. Reads both
|
|
35
|
+
* sides of each output, as `assert_output_schemas_no_sensitive_fields` does.
|
|
36
|
+
*
|
|
37
|
+
* Routes only: the default blocklist matches by name (`created_by`,
|
|
38
|
+
* `updated_by`), and RPC and WebSocket methods return domain shapes that
|
|
39
|
+
* carry those columns legitimately (cells, invites a member created).
|
|
40
|
+
*
|
|
41
|
+
* @param surface_source - the surface with the specs it was generated from
|
|
42
|
+
* @param admin_only_fields - field names no non-admin route output may carry
|
|
43
|
+
* @param skip_routes - routes to skip, as `'METHOD /path'`
|
|
44
|
+
* @throws Error when an output schema can't be written as JSON Schema on either side
|
|
17
45
|
*/
|
|
18
|
-
export declare const assert_non_admin_schemas_no_admin_fields: (
|
|
46
|
+
export declare const assert_non_admin_schemas_no_admin_fields: (surface_source: AppSurfaceSpec, admin_only_fields?: ReadonlyArray<string>, skip_routes?: ReadonlyArray<string>) => void;
|
|
19
47
|
/** Options for `describe_data_exposure_tests`. */
|
|
20
48
|
export interface DataExposureTestOptions {
|
|
21
49
|
/** Per-test fixture-producing function (per-describe cadence). */
|
|
@@ -29,14 +57,20 @@ export interface DataExposureTestOptions {
|
|
|
29
57
|
sensitive_fields?: ReadonlyArray<string>;
|
|
30
58
|
/** Fields that must not appear in non-admin responses. Default: `admin_only_field_blocklist`. */
|
|
31
59
|
admin_only_fields?: ReadonlyArray<string>;
|
|
32
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* Routes to skip, in `'METHOD /path'` format, and RPC or WebSocket method
|
|
62
|
+
* outputs to skip in the schema-level checks, as `'/path method_name'`
|
|
63
|
+
* (`'/path method_name params'` for params the server pushes over WebSocket).
|
|
64
|
+
*/
|
|
33
65
|
skip_routes?: Array<string>;
|
|
34
66
|
}
|
|
35
67
|
/**
|
|
36
68
|
* Composable data exposure test suite.
|
|
37
69
|
*
|
|
38
70
|
* Three test groups:
|
|
39
|
-
* 1. Schema-level — walk
|
|
71
|
+
* 1. Schema-level — walk route, RPC, and WebSocket output schemas (both sides
|
|
72
|
+
* of a transform), pushed WebSocket params, and route error schemas for
|
|
73
|
+
* sensitive field names, and non-admin route outputs for admin-only ones
|
|
40
74
|
* 2. Runtime — fire real requests and check response bodies against blocklists
|
|
41
75
|
* 3. Cross-privilege — admin routes return 403 for non-admin, error responses
|
|
42
76
|
* contain no sensitive fields
|
|
@@ -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;
|
|
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;AAsBzD,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"}
|
|
@@ -3,7 +3,10 @@ import './assert_dev_env.js';
|
|
|
3
3
|
* Composable data exposure test suite.
|
|
4
4
|
*
|
|
5
5
|
* Verifies that sensitive database fields never leak through HTTP responses:
|
|
6
|
-
* - Schema-level: walks JSON Schema
|
|
6
|
+
* - Schema-level: walks the JSON Schema of every route, RPC, and WebSocket
|
|
7
|
+
* output (both sides of a transform), the params the server pushes over
|
|
8
|
+
* WebSocket, and every route error schema for sensitive property names,
|
|
9
|
+
* and non-admin route outputs for admin-only ones
|
|
7
10
|
* - Runtime: fires real requests and checks response bodies against field blocklists
|
|
8
11
|
* - Cross-privilege: verifies admin routes return 403 for non-admin users,
|
|
9
12
|
* and non-admin responses exclude admin-only fields
|
|
@@ -16,18 +19,21 @@ import './assert_dev_env.js';
|
|
|
16
19
|
* @module
|
|
17
20
|
*/
|
|
18
21
|
import { describe, test, beforeAll, assert } from 'vitest';
|
|
19
|
-
import { ROLE_ADMIN } from '../auth/role_schema.js';
|
|
22
|
+
import { ROLE_ADMIN, ROLE_KEEPER } from '../auth/role_schema.js';
|
|
20
23
|
import { create_test_request_headers } from './test_origin.js';
|
|
21
24
|
import { resolve_valid_path, generate_valid_body, to_route_content_type } from './schema_generators.js';
|
|
22
|
-
import { is_null_schema, is_strict_object_schema } from '../http/schema_helpers.js';
|
|
25
|
+
import { is_null_schema, is_strict_object_schema, schema_to_surface } from '../http/schema_helpers.js';
|
|
23
26
|
import { is_keeper_auth, is_public_auth } from '../http/auth_shape.js';
|
|
24
27
|
import { sensitive_field_blocklist, admin_only_field_blocklist, assert_no_sensitive_fields_in_json, pick_auth_headers } from './integration_helpers.js';
|
|
25
28
|
// --- Schema introspection ---
|
|
26
29
|
/**
|
|
27
30
|
* Recursively collect all property names from a JSON Schema.
|
|
28
31
|
*
|
|
29
|
-
* Walks `properties`, `
|
|
30
|
-
* `
|
|
32
|
+
* Walks `properties`, `patternProperties`, `additionalProperties`, `items`,
|
|
33
|
+
* `prefixItems`, `contains`, `allOf`/`anyOf`/`oneOf`, `not`/`if`/`then`/`else`,
|
|
34
|
+
* and the values of `$defs`/`definitions` (where a recursive or registered
|
|
35
|
+
* schema's body sits behind a `$ref`) to find every declared field name at
|
|
36
|
+
* any depth.
|
|
31
37
|
*/
|
|
32
38
|
export const collect_json_schema_property_names = (schema) => {
|
|
33
39
|
const names = new Set();
|
|
@@ -41,54 +47,164 @@ export const collect_json_schema_property_names = (schema) => {
|
|
|
41
47
|
walk(prop_schema);
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
// `items` is a schema, or an array of them in older drafts
|
|
51
|
+
for (const key of ['items', 'additionalProperties', 'contains', 'not', 'if', 'then', 'else']) {
|
|
52
|
+
const sub = obj[key];
|
|
53
|
+
if (Array.isArray(sub)) {
|
|
54
|
+
for (const item of sub)
|
|
55
|
+
walk(item);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
walk(sub);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
for (const key of ['prefixItems', 'allOf', 'anyOf', 'oneOf']) {
|
|
47
62
|
if (Array.isArray(obj[key])) {
|
|
48
63
|
for (const sub of obj[key])
|
|
49
64
|
walk(sub);
|
|
50
65
|
}
|
|
51
66
|
}
|
|
52
|
-
|
|
53
|
-
|
|
67
|
+
// schema maps: walk the values, the keys aren't field names
|
|
68
|
+
for (const key of ['patternProperties', '$defs', 'definitions']) {
|
|
69
|
+
const map = obj[key];
|
|
70
|
+
if (map && typeof map === 'object') {
|
|
71
|
+
for (const sub of Object.values(map))
|
|
72
|
+
walk(sub);
|
|
73
|
+
}
|
|
54
74
|
}
|
|
55
75
|
};
|
|
56
76
|
walk(schema);
|
|
57
77
|
return names;
|
|
58
78
|
};
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
79
|
+
// any-of roles gate only admins and the keeper when every role is one of them
|
|
80
|
+
const is_elevated_roles = (roles) => !!roles?.length && roles.every((r) => r === ROLE_ADMIN || r === ROLE_KEEPER);
|
|
81
|
+
const is_elevated_auth = (auth) => auth !== null && (is_keeper_auth(auth) || is_elevated_roles(auth.roles));
|
|
82
|
+
// every schema a caller can receive: route outputs, RPC method outputs, and
|
|
83
|
+
// over WS the method outputs plus the params the server pushes — a
|
|
84
|
+
// `remote_notification`'s payload, and the request of a `request_response`
|
|
85
|
+
// the backend can initiate (`local_call` specs never dispatch over WS, as in
|
|
86
|
+
// `generate_app_surface`)
|
|
87
|
+
const collect_output_schema_entries = (surface_source) => {
|
|
88
|
+
const entries = [];
|
|
89
|
+
for (const r of surface_source.route_specs) {
|
|
90
|
+
entries.push({
|
|
91
|
+
key: `${r.method} ${r.path}`,
|
|
92
|
+
kind: 'route',
|
|
93
|
+
schema: r.output,
|
|
94
|
+
elevated: is_elevated_auth(r.auth)
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
for (const ep of surface_source.rpc_endpoints) {
|
|
98
|
+
for (const a of ep.actions) {
|
|
99
|
+
entries.push({
|
|
100
|
+
key: `${ep.path} ${a.spec.method}`,
|
|
101
|
+
kind: 'rpc',
|
|
102
|
+
schema: a.spec.output,
|
|
103
|
+
elevated: is_elevated_auth(a.spec.auth)
|
|
104
|
+
});
|
|
70
105
|
}
|
|
71
106
|
}
|
|
107
|
+
for (const ep of surface_source.ws_endpoints) {
|
|
108
|
+
// the upgrade gate holds for every message on the socket
|
|
109
|
+
const endpoint_elevated = is_elevated_roles(ep.required_roles);
|
|
110
|
+
for (const a of ep.actions) {
|
|
111
|
+
const { spec } = a;
|
|
112
|
+
if (spec.kind === 'local_call')
|
|
113
|
+
continue;
|
|
114
|
+
const params_entry = {
|
|
115
|
+
key: `${ep.path} ${spec.method} params`,
|
|
116
|
+
kind: 'ws',
|
|
117
|
+
schema: spec.input,
|
|
118
|
+
// a pushed message reaches every socket on the endpoint
|
|
119
|
+
elevated: endpoint_elevated
|
|
120
|
+
};
|
|
121
|
+
if (spec.kind === 'remote_notification') {
|
|
122
|
+
// its `output` is `z.void()`: the payload is its params
|
|
123
|
+
entries.push(params_entry);
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
entries.push({
|
|
127
|
+
key: `${ep.path} ${spec.method}`,
|
|
128
|
+
kind: 'ws',
|
|
129
|
+
schema: spec.output,
|
|
130
|
+
elevated: endpoint_elevated || is_elevated_auth(spec.auth)
|
|
131
|
+
});
|
|
132
|
+
if (spec.initiator === 'backend' || spec.initiator === 'both')
|
|
133
|
+
entries.push(params_entry);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return entries;
|
|
72
137
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
138
|
+
// the property names an output schema can carry on each side: its output
|
|
139
|
+
// side, as the surface writes it, and its input side — a transform's output
|
|
140
|
+
// has no JSON Schema form and is written as `{}` on the output side, so a
|
|
141
|
+
// field inside a transformed subtree is only seen on the input side, the
|
|
142
|
+
// pre-transform shape and a conservative superset
|
|
143
|
+
const collect_output_property_names = (entry) => ({
|
|
144
|
+
output: collect_json_schema_property_names(schema_to_surface(entry.schema, { io: 'output', source: `${entry.key} output` })),
|
|
145
|
+
input: collect_json_schema_property_names(schema_to_surface(entry.schema, { io: 'input', source: `${entry.key} output (input side)` }))
|
|
146
|
+
});
|
|
147
|
+
const assert_output_entries_exclude = (entries, fields, skip_routes, label) => {
|
|
148
|
+
const skip_set = new Set(skip_routes);
|
|
149
|
+
for (const entry of entries) {
|
|
150
|
+
if (skip_set.has(entry.key))
|
|
80
151
|
continue;
|
|
81
|
-
const
|
|
82
|
-
for (const field of
|
|
83
|
-
assert.ok(!
|
|
152
|
+
const names = collect_output_property_names(entry);
|
|
153
|
+
for (const field of fields) {
|
|
154
|
+
assert.ok(!names.output.has(field), `${entry.key}: ${label} '${field}'`);
|
|
155
|
+
assert.ok(!names.input.has(field), `${entry.key}: ${label} '${field}' on its input side, inside a transformed ` +
|
|
156
|
+
`subtree — if the transform drops it, add '${entry.key}' to skip_routes`);
|
|
84
157
|
}
|
|
85
158
|
}
|
|
86
159
|
};
|
|
160
|
+
/**
|
|
161
|
+
* Assert that no output schema — of a route, an RPC method, or a WebSocket
|
|
162
|
+
* method, or the params of a message the server pushes over WebSocket (a
|
|
163
|
+
* `remote_notification`, or a `request_response` the backend initiates) —
|
|
164
|
+
* contains sensitive field names.
|
|
165
|
+
*
|
|
166
|
+
* Each output is read on both sides (`schema_to_surface`): the output side the
|
|
167
|
+
* surface records, and the input side, since a transform's output has no JSON
|
|
168
|
+
* Schema form and a field inside a transformed subtree shows only there. The
|
|
169
|
+
* input side is a superset, so a transform that deliberately drops a
|
|
170
|
+
* sensitive field is flagged too; skip that output by its key.
|
|
171
|
+
*
|
|
172
|
+
* @param surface_source - the surface with the specs it was generated from
|
|
173
|
+
* @param sensitive_fields - field names no output may carry
|
|
174
|
+
* @param skip_routes - outputs to skip: `'METHOD /path'` for a route, `'/path method_name'` for an RPC or WS method, `'/path method_name params'` for pushed params
|
|
175
|
+
* @throws Error when an output schema can't be written as JSON Schema on either side
|
|
176
|
+
*/
|
|
177
|
+
export const assert_output_schemas_no_sensitive_fields = (surface_source, sensitive_fields = sensitive_field_blocklist, skip_routes) => {
|
|
178
|
+
assert_output_entries_exclude(collect_output_schema_entries(surface_source), sensitive_fields, skip_routes, 'output schema contains sensitive field');
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Assert that route output schemas a non-admin can reach — routes without an
|
|
182
|
+
* admin or keeper gate — don't contain admin-only field names. Reads both
|
|
183
|
+
* sides of each output, as `assert_output_schemas_no_sensitive_fields` does.
|
|
184
|
+
*
|
|
185
|
+
* Routes only: the default blocklist matches by name (`created_by`,
|
|
186
|
+
* `updated_by`), and RPC and WebSocket methods return domain shapes that
|
|
187
|
+
* carry those columns legitimately (cells, invites a member created).
|
|
188
|
+
*
|
|
189
|
+
* @param surface_source - the surface with the specs it was generated from
|
|
190
|
+
* @param admin_only_fields - field names no non-admin route output may carry
|
|
191
|
+
* @param skip_routes - routes to skip, as `'METHOD /path'`
|
|
192
|
+
* @throws Error when an output schema can't be written as JSON Schema on either side
|
|
193
|
+
*/
|
|
194
|
+
export const assert_non_admin_schemas_no_admin_fields = (surface_source, admin_only_fields = admin_only_field_blocklist, skip_routes) => {
|
|
195
|
+
assert_output_entries_exclude(
|
|
196
|
+
// TODO: replace name-matching with schema identity — flag a non-admin output
|
|
197
|
+
// (route, RPC, or WS) that embeds `AdminAccountJson`, `InviteJson`, or
|
|
198
|
+
// `AppSettingsJson`, which would also cover RPC and WS outputs
|
|
199
|
+
collect_output_schema_entries(surface_source).filter((entry) => !entry.elevated && entry.kind === 'route'), admin_only_fields, skip_routes, 'non-admin output schema contains admin-only field');
|
|
200
|
+
};
|
|
87
201
|
/**
|
|
88
202
|
* Composable data exposure test suite.
|
|
89
203
|
*
|
|
90
204
|
* Three test groups:
|
|
91
|
-
* 1. Schema-level — walk
|
|
205
|
+
* 1. Schema-level — walk route, RPC, and WebSocket output schemas (both sides
|
|
206
|
+
* of a transform), pushed WebSocket params, and route error schemas for
|
|
207
|
+
* sensitive field names, and non-admin route outputs for admin-only ones
|
|
92
208
|
* 2. Runtime — fire real requests and check response bodies against blocklists
|
|
93
209
|
* 3. Cross-privilege — admin routes return 403 for non-admin, error responses
|
|
94
210
|
* contain no sensitive fields
|
|
@@ -99,10 +215,10 @@ export const describe_data_exposure_tests = (options) => {
|
|
|
99
215
|
const skip_set = new Set(options.skip_routes);
|
|
100
216
|
describe('data exposure — schema-level', () => {
|
|
101
217
|
test('no sensitive fields in any output schema', () => {
|
|
102
|
-
assert_output_schemas_no_sensitive_fields(
|
|
218
|
+
assert_output_schemas_no_sensitive_fields(options.surface_source, sensitive_fields, options.skip_routes);
|
|
103
219
|
});
|
|
104
220
|
test('no admin-only fields in non-admin output schemas', () => {
|
|
105
|
-
assert_non_admin_schemas_no_admin_fields(
|
|
221
|
+
assert_non_admin_schemas_no_admin_fields(options.surface_source, admin_only_fields, options.skip_routes);
|
|
106
222
|
});
|
|
107
223
|
test('no sensitive fields in any error schema', () => {
|
|
108
224
|
for (const route of surface.routes) {
|
|
@@ -206,7 +322,7 @@ export const describe_data_exposure_tests = (options) => {
|
|
|
206
322
|
if (skip_set.has(route_key))
|
|
207
323
|
continue;
|
|
208
324
|
// keeper auth (daemon token) is strictly more privileged than admin
|
|
209
|
-
const is_elevated =
|
|
325
|
+
const is_elevated = is_elevated_auth(spec.auth);
|
|
210
326
|
const url = resolve_valid_path(spec.path, spec.params);
|
|
211
327
|
const body = generate_valid_body(spec.input);
|
|
212
328
|
const headers = pick_auth_headers(spec, fixture, authed_account, admin_account);
|
|
@@ -10,29 +10,41 @@ import './assert_dev_env.js';
|
|
|
10
10
|
*/
|
|
11
11
|
import { z } from 'zod';
|
|
12
12
|
import { type ZodFieldInfo } from '../zod.js';
|
|
13
|
+
import type { ValidationSchema } from '../schema_issues.js';
|
|
13
14
|
/**
|
|
14
15
|
* The JSON Schema of a field's input side — where its format, pattern and
|
|
15
|
-
* bounds live
|
|
16
|
-
* of it (`z.date()`, `z.custom()`, a union with a `z.date()` branch).
|
|
16
|
+
* bounds live. Takes a Zod or a `@fuzdev/fuz_schema` field.
|
|
17
17
|
*
|
|
18
18
|
* Rendered with `io: 'input'`, so a field carrying a `.transform()` or a pipe
|
|
19
19
|
* (`Username`) still yields the constraints its input is checked against;
|
|
20
20
|
* the default output side throws on a transform. A pipe yields its input
|
|
21
21
|
* side only, so constraints of the stage after it are not here. A
|
|
22
22
|
* `.nullable()` / `.nullish()` field renders as
|
|
23
|
-
* `anyOf: [{…}, {type: 'null'}]
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
23
|
+
* `anyOf: [{…}, {type: 'null'}]`, or a bare type as `type: [type, 'null']`;
|
|
24
|
+
* its one non-null branch or type is returned, so the bounds, pattern and
|
|
25
|
+
* `type` read the same as on the bare field. A union of two or more non-null
|
|
26
|
+
* branches returns the whole schema — its branches' bounds are no single
|
|
27
|
+
* field's bounds.
|
|
28
|
+
*
|
|
29
|
+
* Either library renders with `unrepresentable: 'any'`: a part JSON Schema
|
|
30
|
+
* can't say (a `z.date()`, a `z.custom()`, a fuz_schema `check` or `bigint`)
|
|
31
|
+
* is left out or `{}`, and the bounds around it still read, so a
|
|
32
|
+
* `pipe(string, max_length(n), check(…))` keeps its `maxLength` and a union
|
|
33
|
+
* with a `z.date()` branch keeps its other branches — every case the
|
|
34
|
+
* generators build from it is checked against the field itself before it's
|
|
35
|
+
* used. What an emitter refuses even then (a fuz_schema entry named like a
|
|
36
|
+
* member of `Object.prototype`, metadata that isn't JSON) throws: a mistake in
|
|
37
|
+
* the schema, not a gap in JSON Schema.
|
|
27
38
|
*
|
|
28
39
|
* A `.refine()` is never here: JSON Schema can't express one, so a bound a
|
|
29
40
|
* refinement enforces (a code-point length, a cross-field rule) generates no
|
|
30
41
|
* boundary case.
|
|
31
42
|
*
|
|
32
43
|
* @param field_schema - the field to read
|
|
33
|
-
* @returns the field's input-side JSON Schema
|
|
44
|
+
* @returns the field's input-side JSON Schema
|
|
45
|
+
* @throws Error when the emitter refuses `field_schema` with `unrepresentable: 'any'`
|
|
34
46
|
*/
|
|
35
|
-
export declare const to_field_json_schema: (field_schema:
|
|
47
|
+
export declare const to_field_json_schema: (field_schema: ValidationSchema) => Record<string, unknown>;
|
|
36
48
|
/**
|
|
37
49
|
* The format constraint a field's input-side JSON Schema carries: its
|
|
38
50
|
* `format` (e.g. `'uuid'`, `'email'`), `'pattern'` for a regex, or `null`.
|
|
@@ -49,7 +61,7 @@ export declare const detect_json_schema_format: (json: Record<string, unknown>)
|
|
|
49
61
|
* (`to_field_json_schema`). Returns the format string (e.g. `'uuid'`,
|
|
50
62
|
* `'email'`), `'pattern'` for a regex, or `null`.
|
|
51
63
|
*/
|
|
52
|
-
export declare const detect_format: (field_schema:
|
|
64
|
+
export declare const detect_format: (field_schema: ValidationSchema) => string | null;
|
|
53
65
|
/** Generate a valid-ish value for a field based on its base type. */
|
|
54
66
|
export declare const generate_valid_value: (field: ZodFieldInfo, field_schema: z.ZodType) => unknown;
|
|
55
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema_generators.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/schema_generators.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schema_generators.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/schema_generators.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAKN,KAAK,YAAY,EACjB,MAAM,WAAW,CAAC;AAGnB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,oBAAoB,GAAI,cAAc,gBAAgB,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAe3F,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,GAAI,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,MAAM,GAAG,IAWlF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,cAAc,gBAAgB,KAAG,MAAM,GAAG,IACV,CAAC;AAmH/D,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,GAAI,OAAO,YAAY,EAAE,cAAc,CAAC,CAAC,OAAO,KAAG,OAgGnF,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qBAAqB,GACjC,eAAe,CAAC,CAAC,SAAS,EAC1B,QAAQ,CAAC,CAAC,OAAO,KACf;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,MAAM,EAAE,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAA;CASzE,CAAC;AAsCF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gCAAgC,GAC5C,eAAe,CAAC,CAAC,SAAS,EAC1B,QAAQ,CAAC,CAAC,OAAO,EACjB,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,YAAY,KACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IA0B5B,CAAC;AAIF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,2BAA2B,GACvC,OAAO,YAAY,EACnB,cAAc,CAAC,CAAC,OAAO,KACrB,MAAM,GAAG,IA2BX,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,CAAC,CAAC,QAAQ,KAAG,MACkB,CAAC;AAEzE;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,KAAG,MACL,CAAC;AAElE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,gBAAgB,CAAC,CAAC,SAAS,KAAG,MAiB9E,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAC/B,cAAc,CAAC,CAAC,OAAO,KACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAY5B,CAAC"}
|
|
@@ -9,43 +9,57 @@ import './assert_dev_env.js';
|
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
11
|
import { z } from 'zod';
|
|
12
|
+
import { is_schema } from '@fuzdev/fuz_schema/schema.ts';
|
|
13
|
+
import { to_json_schema } from '@fuzdev/fuz_schema/json_schema.ts';
|
|
12
14
|
import { zod_unwrap_def, zod_get_base_type, zod_unwrap_to_object, zod_extract_fields } from '../zod.js';
|
|
13
15
|
import { is_null_schema } from '../http/schema_helpers.js';
|
|
14
16
|
/**
|
|
15
17
|
* The JSON Schema of a field's input side — where its format, pattern and
|
|
16
|
-
* bounds live
|
|
17
|
-
* of it (`z.date()`, `z.custom()`, a union with a `z.date()` branch).
|
|
18
|
+
* bounds live. Takes a Zod or a `@fuzdev/fuz_schema` field.
|
|
18
19
|
*
|
|
19
20
|
* Rendered with `io: 'input'`, so a field carrying a `.transform()` or a pipe
|
|
20
21
|
* (`Username`) still yields the constraints its input is checked against;
|
|
21
22
|
* the default output side throws on a transform. A pipe yields its input
|
|
22
23
|
* side only, so constraints of the stage after it are not here. A
|
|
23
24
|
* `.nullable()` / `.nullish()` field renders as
|
|
24
|
-
* `anyOf: [{…}, {type: 'null'}]
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* `anyOf: [{…}, {type: 'null'}]`, or a bare type as `type: [type, 'null']`;
|
|
26
|
+
* its one non-null branch or type is returned, so the bounds, pattern and
|
|
27
|
+
* `type` read the same as on the bare field. A union of two or more non-null
|
|
28
|
+
* branches returns the whole schema — its branches' bounds are no single
|
|
29
|
+
* field's bounds.
|
|
30
|
+
*
|
|
31
|
+
* Either library renders with `unrepresentable: 'any'`: a part JSON Schema
|
|
32
|
+
* can't say (a `z.date()`, a `z.custom()`, a fuz_schema `check` or `bigint`)
|
|
33
|
+
* is left out or `{}`, and the bounds around it still read, so a
|
|
34
|
+
* `pipe(string, max_length(n), check(…))` keeps its `maxLength` and a union
|
|
35
|
+
* with a `z.date()` branch keeps its other branches — every case the
|
|
36
|
+
* generators build from it is checked against the field itself before it's
|
|
37
|
+
* used. What an emitter refuses even then (a fuz_schema entry named like a
|
|
38
|
+
* member of `Object.prototype`, metadata that isn't JSON) throws: a mistake in
|
|
39
|
+
* the schema, not a gap in JSON Schema.
|
|
28
40
|
*
|
|
29
41
|
* A `.refine()` is never here: JSON Schema can't express one, so a bound a
|
|
30
42
|
* refinement enforces (a code-point length, a cross-field rule) generates no
|
|
31
43
|
* boundary case.
|
|
32
44
|
*
|
|
33
45
|
* @param field_schema - the field to read
|
|
34
|
-
* @returns the field's input-side JSON Schema
|
|
46
|
+
* @returns the field's input-side JSON Schema
|
|
47
|
+
* @throws Error when the emitter refuses `field_schema` with `unrepresentable: 'any'`
|
|
35
48
|
*/
|
|
36
49
|
export const to_field_json_schema = (field_schema) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
return null; // a type JSON Schema can't represent
|
|
43
|
-
}
|
|
50
|
+
const json = is_schema(field_schema)
|
|
51
|
+
? to_json_schema(field_schema, { io: 'input', unrepresentable: 'any' })
|
|
52
|
+
: z.toJSONSchema(field_schema, { io: 'input', unrepresentable: 'any' });
|
|
44
53
|
if (Array.isArray(json.anyOf)) {
|
|
45
54
|
const branches = json.anyOf.filter((branch) => branch.type !== 'null');
|
|
46
55
|
if (branches.length === 1)
|
|
47
56
|
return branches[0];
|
|
48
57
|
}
|
|
58
|
+
if (Array.isArray(json.type)) {
|
|
59
|
+
const types = json.type.filter((t) => t !== 'null');
|
|
60
|
+
if (types.length === 1)
|
|
61
|
+
return { ...json, type: types[0] };
|
|
62
|
+
}
|
|
49
63
|
return json;
|
|
50
64
|
};
|
|
51
65
|
/**
|
|
@@ -80,10 +94,7 @@ export const detect_json_schema_format = (json) => {
|
|
|
80
94
|
* (`to_field_json_schema`). Returns the format string (e.g. `'uuid'`,
|
|
81
95
|
* `'email'`), `'pattern'` for a regex, or `null`.
|
|
82
96
|
*/
|
|
83
|
-
export const detect_format = (field_schema) =>
|
|
84
|
-
const json = to_field_json_schema(field_schema);
|
|
85
|
-
return json && detect_json_schema_format(json);
|
|
86
|
-
};
|
|
97
|
+
export const detect_format = (field_schema) => detect_json_schema_format(to_field_json_schema(field_schema));
|
|
87
98
|
/**
|
|
88
99
|
* Extract a candidate value from a JSON Schema `pattern` when the shape is a
|
|
89
100
|
* fixed-length hex character class, optionally behind a literal prefix —
|
|
@@ -155,14 +166,12 @@ const generate_valid_string = (field_schema) => {
|
|
|
155
166
|
let max_length = Infinity;
|
|
156
167
|
let pattern = null;
|
|
157
168
|
const json = to_field_json_schema(field_schema);
|
|
158
|
-
if (json)
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
pattern = json.pattern;
|
|
165
|
-
}
|
|
169
|
+
if (typeof json.minLength === 'number')
|
|
170
|
+
min_length = json.minLength;
|
|
171
|
+
if (typeof json.maxLength === 'number')
|
|
172
|
+
max_length = json.maxLength;
|
|
173
|
+
if (typeof json.pattern === 'string')
|
|
174
|
+
pattern = json.pattern;
|
|
166
175
|
const target = Math.max(min_length, Math.min(10, max_length));
|
|
167
176
|
const base = 'x'.repeat(target) || 'test_value';
|
|
168
177
|
// Validate against the full schema (including refinements/brands).
|
|
@@ -226,23 +235,21 @@ export const generate_valid_value = (field, field_schema) => {
|
|
|
226
235
|
return candidate;
|
|
227
236
|
}
|
|
228
237
|
const json = to_field_json_schema(field_schema);
|
|
229
|
-
if (json)
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
return Math.ceil(json.exclusiveMaximum) - 1;
|
|
238
|
-
}
|
|
238
|
+
if (typeof json.minimum === 'number')
|
|
239
|
+
return Math.ceil(json.minimum);
|
|
240
|
+
if (typeof json.exclusiveMinimum === 'number')
|
|
241
|
+
return Math.floor(json.exclusiveMinimum) + 1;
|
|
242
|
+
if (typeof json.maximum === 'number')
|
|
243
|
+
return Math.floor(json.maximum);
|
|
244
|
+
if (typeof json.exclusiveMaximum === 'number')
|
|
245
|
+
return Math.ceil(json.exclusiveMaximum) - 1;
|
|
239
246
|
return 1; // fall through — generate_valid_body will report the failure
|
|
240
247
|
}
|
|
241
248
|
case 'boolean':
|
|
242
249
|
return true;
|
|
243
250
|
case 'array': {
|
|
244
251
|
const json = to_field_json_schema(field_schema);
|
|
245
|
-
const min_items = typeof json
|
|
252
|
+
const min_items = typeof json.minItems === 'number' ? json.minItems : 0;
|
|
246
253
|
if (min_items === 0)
|
|
247
254
|
return [];
|
|
248
255
|
const def = zod_unwrap_def(field_schema);
|
|
@@ -453,16 +460,14 @@ export const generate_valid_string_param = (field, field_schema) => {
|
|
|
453
460
|
candidates.push('1', '0', 'true', 'false');
|
|
454
461
|
// a number the URL string is preprocessed into: its default or its lower bound
|
|
455
462
|
const json = to_field_json_schema(field_schema);
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
candidates.push(String(Math.floor(json.exclusiveMinimum) + 1));
|
|
465
|
-
}
|
|
463
|
+
const fallback = json.default;
|
|
464
|
+
if (typeof fallback === 'number' || typeof fallback === 'string') {
|
|
465
|
+
candidates.push(String(fallback));
|
|
466
|
+
}
|
|
467
|
+
if (typeof json.minimum === 'number')
|
|
468
|
+
candidates.push(String(Math.ceil(json.minimum)));
|
|
469
|
+
if (typeof json.exclusiveMinimum === 'number') {
|
|
470
|
+
candidates.push(String(Math.floor(json.exclusiveMinimum) + 1));
|
|
466
471
|
}
|
|
467
472
|
candidates.push(generate_valid_string(field_schema));
|
|
468
473
|
return candidates.find((c) => field_schema.safeParse(c).success) ?? null;
|
package/dist/testing/stubs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AnySchema } from '@fuzdev/fuz_schema/schema.ts';
|
|
3
3
|
import type { SessionOptions } from '../auth/session_cookie.js';
|
|
4
4
|
import type { MiddlewareCarveOut, MiddlewareSpec } from '../http/middleware_spec.js';
|
|
5
5
|
import type { AppDeps } from '../auth/deps.js';
|
|
@@ -131,7 +131,7 @@ export interface CreateTestAppSurfaceSpecOptions {
|
|
|
131
131
|
/** Consumer's route factory — receives the same `AppServerContext` as production. */
|
|
132
132
|
create_route_specs: (ctx: AppServerContext) => Array<RouteSpec>;
|
|
133
133
|
/** Env schema for surface generation (default: `BaseServerEnv`). */
|
|
134
|
-
env_schema?:
|
|
134
|
+
env_schema?: AnySchema;
|
|
135
135
|
/** SSE event specs for surface generation. */
|
|
136
136
|
event_specs?: Array<EventSpec>;
|
|
137
137
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stubs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/stubs.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"stubs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/stubs.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAErF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAI3E,OAAO,EAEN,KAAK,cAAc,EACnB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