@adaptic/backend-legacy 0.0.995-alignment.554 → 0.0.995
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/esm/middleware/graphql-validation-plugin.d.ts +69 -8
- package/esm/middleware/graphql-validation-plugin.d.ts.map +1 -1
- package/esm/middleware/graphql-validation-plugin.js.map +1 -1
- package/esm/middleware/graphql-validation-plugin.mjs +166 -22
- package/esm/middleware/index.d.ts +1 -1
- package/esm/middleware/index.d.ts.map +1 -1
- package/esm/middleware/index.js.map +1 -1
- package/esm/middleware/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
import { ApolloServerPlugin } from '@apollo/server';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Validation execution mode for the GraphQL mutation-input plugin.
|
|
4
|
+
*
|
|
5
|
+
* - `scoped` (default) — validates ONLY top-level scalar input fields of each
|
|
6
|
+
* mutation variable (unwrapping single-key Prisma atomic `{ set: <scalar> }`
|
|
7
|
+
* update wrappers). Nested objects — relation create/connect inputs and
|
|
8
|
+
* opaque Json audit columns such as `effectivePolicySnapshot` — are engine-
|
|
9
|
+
* or Prisma-validated payloads, not user input, and are never recursed into.
|
|
10
|
+
* Range rules apply only to fields whose schema domain is genuinely bounded.
|
|
11
|
+
* - `legacy` — the pre-2026-07 behavior: name-pattern heuristics applied
|
|
12
|
+
* recursively to every nested non-array object of every mutation variable.
|
|
13
|
+
* Retained solely as an operational rollback lever.
|
|
14
|
+
* - `off` — disables mutation-input validation entirely (kill switch).
|
|
15
|
+
*/
|
|
16
|
+
export type ValidationMode = 'scoped' | 'legacy' | 'off';
|
|
17
|
+
/**
|
|
18
|
+
* Environment variable controlling the plugin mode. Accepted values:
|
|
19
|
+
* `scoped` | `legacy` | `off`. Unset or unrecognized values resolve to
|
|
20
|
+
* `scoped`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const VALIDATION_MODE_ENV_VAR = "GRAPHQL_VALIDATION_MODE";
|
|
23
|
+
/**
|
|
24
|
+
* Resolves the active validation mode from the environment.
|
|
25
|
+
*
|
|
26
|
+
* @returns The configured {@link ValidationMode}, defaulting to `scoped`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveValidationMode(): ValidationMode;
|
|
29
|
+
/**
|
|
30
|
+
* Exact schema field names whose domain is genuinely a bounded share-of-a-whole
|
|
31
|
+
* percentage in `[0, 100]`.
|
|
32
|
+
*
|
|
33
|
+
* This is intentionally an explicit allowlist rather than a `/.*Pct$/` name
|
|
34
|
+
* pattern: many `*Pct` / `*Percent` fields in the Prisma schema are NOT
|
|
35
|
+
* bounded percentages — `maxGrossExposurePct` / `maxNetExposurePct` are
|
|
36
|
+
* leverage-denominated (200 = 2x gross is a legitimate production value) and
|
|
37
|
+
* PnL/return/drawdown fields (`dailyPnlPct`, `netReturnPct`, `changePercent`,
|
|
38
|
+
* `peakToTroughPct`, …) are signed. A blanket 0-100 rule on the name pattern
|
|
39
|
+
* rejected 100% of AccountDecisionRecord writes embedding a leverage policy
|
|
40
|
+
* snapshot (TM-01, 2026-07-01).
|
|
41
|
+
*/
|
|
42
|
+
export declare const BOUNDED_PERCENTAGE_FIELDS: ReadonlySet<string>;
|
|
43
|
+
/**
|
|
44
|
+
* Lower-cased field names that must be non-empty strings when present as
|
|
45
|
+
* top-level scalar inputs.
|
|
46
|
+
*/
|
|
47
|
+
export declare const REQUIRED_NON_EMPTY_STRING_FIELDS: ReadonlySet<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Lower-cased field names that must be strictly positive numbers when present
|
|
50
|
+
* as top-level scalar inputs. Note: `*Threshold` fields are deliberately NOT
|
|
51
|
+
* validated — thresholds are legitimately signed (e.g. reversal-blackout and
|
|
52
|
+
* drawdown-breach thresholds are negative).
|
|
53
|
+
*/
|
|
54
|
+
export declare const POSITIVE_NUMBER_FIELDS: ReadonlySet<string>;
|
|
55
|
+
/**
|
|
56
|
+
* Field validation rules mapped by field name patterns (legacy mode only).
|
|
4
57
|
*/
|
|
5
58
|
interface FieldValidationRule {
|
|
6
59
|
pattern: RegExp;
|
|
@@ -8,15 +61,23 @@ interface FieldValidationRule {
|
|
|
8
61
|
description: string;
|
|
9
62
|
}
|
|
10
63
|
/**
|
|
11
|
-
*
|
|
64
|
+
* Legacy name-pattern validation rules. Preserved verbatim for the `legacy`
|
|
65
|
+
* rollback mode; the default `scoped` mode does NOT use these (the `.*Pct$`,
|
|
66
|
+
* `.*Percent$`, and `.*Threshold$` heuristics reject legitimate leverage-
|
|
67
|
+
* denominated and signed values).
|
|
12
68
|
*/
|
|
13
69
|
declare const VALIDATION_RULES: FieldValidationRule[];
|
|
14
70
|
/**
|
|
15
|
-
* Apollo Server plugin that validates GraphQL mutation inputs
|
|
71
|
+
* Apollo Server plugin that validates GraphQL mutation inputs before they
|
|
72
|
+
* reach the resolver.
|
|
73
|
+
*
|
|
74
|
+
* The active {@link ValidationMode} is resolved from the
|
|
75
|
+
* `GRAPHQL_VALIDATION_MODE` environment variable at request time (defaulting
|
|
76
|
+
* to `scoped`) unless an explicit `modeOverride` is supplied.
|
|
16
77
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
78
|
+
* @param modeOverride - Optional fixed mode, primarily for tests; when
|
|
79
|
+
* omitted the mode is re-resolved from the environment on each request so
|
|
80
|
+
* the toggle can be flipped without code changes.
|
|
20
81
|
*
|
|
21
82
|
* @example
|
|
22
83
|
* ```typescript
|
|
@@ -29,9 +90,9 @@ declare const VALIDATION_RULES: FieldValidationRule[];
|
|
|
29
90
|
* });
|
|
30
91
|
* ```
|
|
31
92
|
*/
|
|
32
|
-
export declare function createValidationPlugin(): ApolloServerPlugin;
|
|
93
|
+
export declare function createValidationPlugin(modeOverride?: ValidationMode): ApolloServerPlugin;
|
|
33
94
|
/**
|
|
34
|
-
* Export validation rules for testing and documentation
|
|
95
|
+
* Export legacy validation rules for testing and documentation.
|
|
35
96
|
*/
|
|
36
97
|
export { VALIDATION_RULES };
|
|
37
98
|
//# sourceMappingURL=graphql-validation-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-validation-plugin.d.ts","sourceRoot":"","sources":["../../../src/middleware/graphql-validation-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA0B,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"graphql-validation-plugin.d.ts","sourceRoot":"","sources":["../../../src/middleware/graphql-validation-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA0B,MAAM,gBAAgB,CAAC;AAW5E;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAEjE;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,cAAc,CAYtD;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,EAAE,WAAW,CAAC,MAAM,CAWxD,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gCAAgC,EAAE,WAAW,CAAC,MAAM,CAO/D,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,WAAW,CAAC,MAAM,CAErD,CAAC;AAEH;;GAEG;AACH,UAAU,mBAAmB;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,QAAA,MAAM,gBAAgB,EAAE,mBAAmB,EA0D1C,CAAC;AAsIF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,CAAC,EAAE,cAAc,GAC5B,kBAAkB,CA8DpB;AAED;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-validation-plugin.js","sourceRoot":"","sources":["../../../src/middleware/graphql-validation-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,GAEhB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"graphql-validation-plugin.js","sourceRoot":"","sources":["../../../src/middleware/graphql-validation-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,GAEhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAkBzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAC;AAEjE;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACvE,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC1D,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;QACpC,MAAM,CAAC,IAAI,CACT,gBAAgB,uBAAuB,gCAAgC,EACvE,EAAE,KAAK,EAAE,GAAG,EAAE,CACf,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAwB,IAAI,GAAG,CAAC;IAC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E,CAAC;4BACvD,+DAA+D;4BAC/D,MAAM,OAAO,GAAG,aAAwC,CAAC;4BAEzD,IAAI,MAAM,IAAI,OAAO,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gCAC1D,MAAM,CAAC,IAAI,CACT,GAAG,UAAU,CACX,OAAO,CAAC,IAA+B,EACvC,YAAY,CACb,CACF,CAAC;4BACJ,CAAC;iCAAM,CAAC;gCACN,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;4BACpD,CAAC;wBACH,CAAC;oBACH,CAAC;oBAED,kEAAkE;oBAClE,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;wBACtB,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;wBACxD,MAAM,IAAI,YAAY,CACpB,+BAA+B,MAAM,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,SAAS,EAAE,EACjG;4BACE,UAAU,EAAE;gCACV,IAAI,EAAE,gBAAgB;gCACtB,gBAAgB,EAAE,MAAM;6BACzB;yBACF,CACF,CAAC;oBACJ,CAAC;gBACH,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,7 +1,78 @@
|
|
|
1
1
|
import { GraphQLError } from 'graphql';
|
|
2
2
|
import { validatePercentage, validatePositiveNumber, validateNonEmpty, ValidationError, } from './input-validator.mjs';
|
|
3
|
+
import { logger } from '../utils/logger.mjs';
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Environment variable controlling the plugin mode. Accepted values:
|
|
6
|
+
* `scoped` | `legacy` | `off`. Unset or unrecognized values resolve to
|
|
7
|
+
* `scoped`.
|
|
8
|
+
*/
|
|
9
|
+
export const VALIDATION_MODE_ENV_VAR = 'GRAPHQL_VALIDATION_MODE';
|
|
10
|
+
/**
|
|
11
|
+
* Resolves the active validation mode from the environment.
|
|
12
|
+
*
|
|
13
|
+
* @returns The configured {@link ValidationMode}, defaulting to `scoped`.
|
|
14
|
+
*/
|
|
15
|
+
export function resolveValidationMode() {
|
|
16
|
+
const raw = process.env[VALIDATION_MODE_ENV_VAR]?.trim().toLowerCase();
|
|
17
|
+
if (raw === 'legacy' || raw === 'off' || raw === 'scoped') {
|
|
18
|
+
return raw;
|
|
19
|
+
}
|
|
20
|
+
if (raw !== undefined && raw !== '') {
|
|
21
|
+
logger.warn(`Unrecognized ${VALIDATION_MODE_ENV_VAR} value; defaulting to 'scoped'`, { value: raw });
|
|
22
|
+
}
|
|
23
|
+
return 'scoped';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Exact schema field names whose domain is genuinely a bounded share-of-a-whole
|
|
27
|
+
* percentage in `[0, 100]`.
|
|
28
|
+
*
|
|
29
|
+
* This is intentionally an explicit allowlist rather than a `/.*Pct$/` name
|
|
30
|
+
* pattern: many `*Pct` / `*Percent` fields in the Prisma schema are NOT
|
|
31
|
+
* bounded percentages — `maxGrossExposurePct` / `maxNetExposurePct` are
|
|
32
|
+
* leverage-denominated (200 = 2x gross is a legitimate production value) and
|
|
33
|
+
* PnL/return/drawdown fields (`dailyPnlPct`, `netReturnPct`, `changePercent`,
|
|
34
|
+
* `peakToTroughPct`, …) are signed. A blanket 0-100 rule on the name pattern
|
|
35
|
+
* rejected 100% of AccountDecisionRecord writes embedding a leverage policy
|
|
36
|
+
* snapshot (TM-01, 2026-07-01).
|
|
37
|
+
*/
|
|
38
|
+
export const BOUNDED_PERCENTAGE_FIELDS = new Set([
|
|
39
|
+
'maxBuyingPowerUtilPct',
|
|
40
|
+
'cashFloorPct',
|
|
41
|
+
'maxSymbolConcentrationPct',
|
|
42
|
+
'maxSectorConcentrationPct',
|
|
43
|
+
'perTradeEquityAllocationPct',
|
|
44
|
+
'perTradeCryptoAllocationPct',
|
|
45
|
+
'cryptoTradeAllocationPct',
|
|
46
|
+
'tradeAllocationPct',
|
|
47
|
+
'trafficSplitControlPercent',
|
|
48
|
+
'trafficSplitTreatmentPercent',
|
|
49
|
+
]);
|
|
50
|
+
/**
|
|
51
|
+
* Lower-cased field names that must be non-empty strings when present as
|
|
52
|
+
* top-level scalar inputs.
|
|
53
|
+
*/
|
|
54
|
+
export const REQUIRED_NON_EMPTY_STRING_FIELDS = new Set([
|
|
55
|
+
'name',
|
|
56
|
+
'title',
|
|
57
|
+
'description',
|
|
58
|
+
'symbol',
|
|
59
|
+
'type',
|
|
60
|
+
'status',
|
|
61
|
+
]);
|
|
62
|
+
/**
|
|
63
|
+
* Lower-cased field names that must be strictly positive numbers when present
|
|
64
|
+
* as top-level scalar inputs. Note: `*Threshold` fields are deliberately NOT
|
|
65
|
+
* validated — thresholds are legitimately signed (e.g. reversal-blackout and
|
|
66
|
+
* drawdown-breach thresholds are negative).
|
|
67
|
+
*/
|
|
68
|
+
export const POSITIVE_NUMBER_FIELDS = new Set([
|
|
69
|
+
'quantity',
|
|
70
|
+
]);
|
|
71
|
+
/**
|
|
72
|
+
* Legacy name-pattern validation rules. Preserved verbatim for the `legacy`
|
|
73
|
+
* rollback mode; the default `scoped` mode does NOT use these (the `.*Pct$`,
|
|
74
|
+
* `.*Percent$`, and `.*Threshold$` heuristics reject legitimate leverage-
|
|
75
|
+
* denominated and signed values).
|
|
5
76
|
*/
|
|
6
77
|
const VALIDATION_RULES = [
|
|
7
78
|
// Percentage fields (0-100)
|
|
@@ -63,7 +134,79 @@ const VALIDATION_RULES = [
|
|
|
63
134
|
},
|
|
64
135
|
];
|
|
65
136
|
/**
|
|
66
|
-
*
|
|
137
|
+
* Returns true when the value is a plain (non-array) object.
|
|
138
|
+
*/
|
|
139
|
+
function isPlainObject(value) {
|
|
140
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Collects a validator's {@link ValidationError} field details into `errors`.
|
|
144
|
+
*/
|
|
145
|
+
function collectValidation(errors, validate) {
|
|
146
|
+
try {
|
|
147
|
+
validate();
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
if (error instanceof ValidationError) {
|
|
151
|
+
errors.push(...error.fields);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
throw error;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Validates ONLY the top-level scalar fields of a mutation input object
|
|
160
|
+
* (scoped mode). Prisma atomic update wrappers of the shape
|
|
161
|
+
* `{ set: <scalar> }` are unwrapped one level so `updateOne*` inputs receive
|
|
162
|
+
* the same scrutiny as `createOne*` inputs. All other nested objects and all
|
|
163
|
+
* arrays are out of scope by design: they are relation inputs or opaque
|
|
164
|
+
* Json-typed columns whose contents are validated by Prisma / the producing
|
|
165
|
+
* service, and name-pattern rules applied inside them reject legitimate data.
|
|
166
|
+
*/
|
|
167
|
+
function validateTopLevelFields(obj, path) {
|
|
168
|
+
const errors = [];
|
|
169
|
+
for (const [key, rawValue] of Object.entries(obj)) {
|
|
170
|
+
if (rawValue === null || rawValue === undefined) {
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
let value = rawValue;
|
|
174
|
+
if (isPlainObject(rawValue)) {
|
|
175
|
+
const keys = Object.keys(rawValue);
|
|
176
|
+
const isAtomicSetWrapper = keys.length === 1 &&
|
|
177
|
+
keys[0] === 'set' &&
|
|
178
|
+
!isPlainObject(rawValue.set) &&
|
|
179
|
+
!Array.isArray(rawValue.set);
|
|
180
|
+
if (!isAtomicSetWrapper) {
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
value = rawValue.set;
|
|
184
|
+
if (value === null || value === undefined) {
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (Array.isArray(value)) {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
const fieldPath = path ? `${path}.${key}` : key;
|
|
192
|
+
const lowerKey = key.toLowerCase();
|
|
193
|
+
if (BOUNDED_PERCENTAGE_FIELDS.has(key) && typeof value === 'number') {
|
|
194
|
+
collectValidation(errors, () => validatePercentage(value, fieldPath));
|
|
195
|
+
}
|
|
196
|
+
else if (POSITIVE_NUMBER_FIELDS.has(lowerKey) &&
|
|
197
|
+
typeof value === 'number') {
|
|
198
|
+
collectValidation(errors, () => validatePositiveNumber(value, fieldPath));
|
|
199
|
+
}
|
|
200
|
+
else if (REQUIRED_NON_EMPTY_STRING_FIELDS.has(lowerKey) &&
|
|
201
|
+
typeof value === 'string') {
|
|
202
|
+
collectValidation(errors, () => validateNonEmpty(value, fieldPath));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return errors;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Recursively validates an object's fields based on the legacy name-pattern
|
|
209
|
+
* rules (legacy mode only).
|
|
67
210
|
*/
|
|
68
211
|
function validateObject(obj, path = '') {
|
|
69
212
|
const errors = [];
|
|
@@ -82,14 +225,7 @@ function validateObject(obj, path = '') {
|
|
|
82
225
|
// Apply validation rules to the field
|
|
83
226
|
for (const rule of VALIDATION_RULES) {
|
|
84
227
|
if (rule.pattern.test(key)) {
|
|
85
|
-
|
|
86
|
-
rule.validator(value, fieldPath);
|
|
87
|
-
}
|
|
88
|
-
catch (error) {
|
|
89
|
-
if (error instanceof ValidationError) {
|
|
90
|
-
errors.push(...error.fields);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
228
|
+
collectValidation(errors, () => rule.validator(value, fieldPath));
|
|
93
229
|
break; // Only apply the first matching rule
|
|
94
230
|
}
|
|
95
231
|
}
|
|
@@ -97,11 +233,16 @@ function validateObject(obj, path = '') {
|
|
|
97
233
|
return errors;
|
|
98
234
|
}
|
|
99
235
|
/**
|
|
100
|
-
* Apollo Server plugin that validates GraphQL mutation inputs
|
|
236
|
+
* Apollo Server plugin that validates GraphQL mutation inputs before they
|
|
237
|
+
* reach the resolver.
|
|
238
|
+
*
|
|
239
|
+
* The active {@link ValidationMode} is resolved from the
|
|
240
|
+
* `GRAPHQL_VALIDATION_MODE` environment variable at request time (defaulting
|
|
241
|
+
* to `scoped`) unless an explicit `modeOverride` is supplied.
|
|
101
242
|
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
243
|
+
* @param modeOverride - Optional fixed mode, primarily for tests; when
|
|
244
|
+
* omitted the mode is re-resolved from the environment on each request so
|
|
245
|
+
* the toggle can be flipped without code changes.
|
|
105
246
|
*
|
|
106
247
|
* @example
|
|
107
248
|
* ```typescript
|
|
@@ -114,11 +255,15 @@ function validateObject(obj, path = '') {
|
|
|
114
255
|
* });
|
|
115
256
|
* ```
|
|
116
257
|
*/
|
|
117
|
-
export function createValidationPlugin() {
|
|
258
|
+
export function createValidationPlugin(modeOverride) {
|
|
118
259
|
return {
|
|
119
260
|
async requestDidStart() {
|
|
120
261
|
return {
|
|
121
262
|
async didResolveOperation(requestContext) {
|
|
263
|
+
const mode = modeOverride ?? resolveValidationMode();
|
|
264
|
+
if (mode === 'off') {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
122
267
|
const { operation, request } = requestContext;
|
|
123
268
|
// Only validate mutations
|
|
124
269
|
if (!operation || operation.operation !== 'mutation') {
|
|
@@ -126,25 +271,24 @@ export function createValidationPlugin() {
|
|
|
126
271
|
}
|
|
127
272
|
const variables = request.variables || {};
|
|
128
273
|
const errors = [];
|
|
274
|
+
const validateFn = mode === 'legacy' ? validateObject : validateTopLevelFields;
|
|
129
275
|
// Validate each mutation's variables
|
|
130
276
|
for (const [variableName, variableValue] of Object.entries(variables)) {
|
|
131
277
|
if (variableValue && typeof variableValue === 'object') {
|
|
132
278
|
// Check if this is a data object (common pattern in mutations)
|
|
133
279
|
const dataObj = variableValue;
|
|
134
280
|
if ('data' in dataObj && typeof dataObj.data === 'object') {
|
|
135
|
-
|
|
136
|
-
errors.push(...validationErrors);
|
|
281
|
+
errors.push(...validateFn(dataObj.data, variableName));
|
|
137
282
|
}
|
|
138
283
|
else {
|
|
139
|
-
|
|
140
|
-
const validationErrors = validateObject(dataObj, variableName);
|
|
141
|
-
errors.push(...validationErrors);
|
|
284
|
+
errors.push(...validateFn(dataObj, variableName));
|
|
142
285
|
}
|
|
143
286
|
}
|
|
144
287
|
}
|
|
145
288
|
// If there are validation errors, throw before resolver execution
|
|
146
289
|
if (errors.length > 0) {
|
|
147
|
-
|
|
290
|
+
const fieldList = errors.map((e) => e.field).join(', ');
|
|
291
|
+
throw new GraphQLError(`Input validation failed for ${errors.length} field${errors.length > 1 ? 's' : ''}: ${fieldList}`, {
|
|
148
292
|
extensions: {
|
|
149
293
|
code: 'BAD_USER_INPUT',
|
|
150
294
|
validationErrors: errors,
|
|
@@ -157,7 +301,7 @@ export function createValidationPlugin() {
|
|
|
157
301
|
};
|
|
158
302
|
}
|
|
159
303
|
/**
|
|
160
|
-
* Export validation rules for testing and documentation
|
|
304
|
+
* Export legacy validation rules for testing and documentation.
|
|
161
305
|
*/
|
|
162
306
|
export { VALIDATION_RULES };
|
|
163
307
|
//# sourceMappingURL=graphql-validation-plugin.js.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* soft-delete handling, and authentication middleware.
|
|
6
6
|
*/
|
|
7
7
|
export { validatePercentage, validatePositiveNumber, validateEmail, validateUrl, validateNonEmpty, validateConfidenceScore, validateFields, ValidationError, ValidationErrorDetail, } from './input-validator';
|
|
8
|
-
export { createValidationPlugin, VALIDATION_RULES, } from './graphql-validation-plugin';
|
|
8
|
+
export { createValidationPlugin, resolveValidationMode, ValidationMode, VALIDATION_MODE_ENV_VAR, BOUNDED_PERCENTAGE_FIELDS, REQUIRED_NON_EMPTY_STRING_FIELDS, POSITIVE_NUMBER_FIELDS, VALIDATION_RULES, } from './graphql-validation-plugin';
|
|
9
9
|
export { authMiddleware, AuthenticatedRequest } from './auth';
|
|
10
10
|
export { createAuditLogPlugin, parseMutationOperation, extractUserId, extractRecordId, extractChangedFields, } from './audit-logger';
|
|
11
11
|
export { SOFT_DELETE_MODELS, softDeleteFilter, deletedOnlyFilter, isSoftDeleteModel, softDeleteRecord, restoreRecord, hardDelete, } from './soft-delete';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/middleware/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAG9D,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,UAAU,GACX,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/middleware/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,gCAAgC,EAChC,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAG9D,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,UAAU,GACX,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/middleware/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,8BAA8B;AAC9B,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,eAAe,GAEhB,MAAM,mBAAmB,CAAC;AAE3B,mCAAmC;AACnC,OAAO,EACL,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAErC,mCAAmC;AACnC,OAAO,EAAE,cAAc,EAAwB,MAAM,QAAQ,CAAC;AAE9D,8BAA8B;AAC9B,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAExB,+BAA+B;AAC/B,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,UAAU,GACX,MAAM,eAAe,CAAC;AAEvB,0CAA0C;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/middleware/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,8BAA8B;AAC9B,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,eAAe,GAEhB,MAAM,mBAAmB,CAAC;AAE3B,mCAAmC;AACnC,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EAErB,uBAAuB,EACvB,yBAAyB,EACzB,gCAAgC,EAChC,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAErC,mCAAmC;AACnC,OAAO,EAAE,cAAc,EAAwB,MAAM,QAAQ,CAAC;AAE9D,8BAA8B;AAC9B,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAExB,+BAA+B;AAC/B,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,UAAU,GACX,MAAM,eAAe,CAAC;AAEvB,0CAA0C;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/esm/middleware/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// Export validation functions
|
|
8
8
|
export { validatePercentage, validatePositiveNumber, validateEmail, validateUrl, validateNonEmpty, validateConfidenceScore, validateFields, ValidationError, } from './input-validator.mjs';
|
|
9
9
|
// Export GraphQL validation plugin
|
|
10
|
-
export { createValidationPlugin, VALIDATION_RULES, } from './graphql-validation-plugin.mjs';
|
|
10
|
+
export { createValidationPlugin, resolveValidationMode, VALIDATION_MODE_ENV_VAR, BOUNDED_PERCENTAGE_FIELDS, REQUIRED_NON_EMPTY_STRING_FIELDS, POSITIVE_NUMBER_FIELDS, VALIDATION_RULES, } from './graphql-validation-plugin.mjs';
|
|
11
11
|
// Export authentication middleware
|
|
12
12
|
export { authMiddleware } from './auth.mjs';
|
|
13
13
|
// Export audit logging plugin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptic/backend-legacy",
|
|
3
|
-
"version": "0.0.995
|
|
3
|
+
"version": "0.0.995",
|
|
4
4
|
"description": "Backend executable CRUD functions with dynamic variables construction, and type definitions for the Adaptic AI platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "index.d.ts",
|