@memberjunction/global 6.1.0-edge.1 → 6.1.0-edge.3
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/LICENSE +180 -4
- package/README.md +2 -2
- package/dist/ClassUtils.d.ts +20 -0
- package/dist/ClassUtils.d.ts.map +1 -1
- package/dist/ClassUtils.js +68 -0
- package/dist/ClassUtils.js.map +1 -1
- package/dist/SQLExpressionValidator.d.ts +28 -1
- package/dist/SQLExpressionValidator.d.ts.map +1 -1
- package/dist/SQLExpressionValidator.js +42 -4
- package/dist/SQLExpressionValidator.js.map +1 -1
- package/dist/SafeExpressionEvaluator.d.ts +131 -6
- package/dist/SafeExpressionEvaluator.d.ts.map +1 -1
- package/dist/SafeExpressionEvaluator.js +344 -41
- package/dist/SafeExpressionEvaluator.js.map +1 -1
- package/dist/TokenEndpointErrors.d.ts +52 -0
- package/dist/TokenEndpointErrors.d.ts.map +1 -0
- package/dist/TokenEndpointErrors.js +87 -0
- package/dist/TokenEndpointErrors.js.map +1 -0
- package/dist/__tests__/ClassUtils.IsMemberOverridden.test.d.ts +2 -0
- package/dist/__tests__/ClassUtils.IsMemberOverridden.test.d.ts.map +1 -0
- package/dist/__tests__/ClassUtils.IsMemberOverridden.test.js +134 -0
- package/dist/__tests__/ClassUtils.IsMemberOverridden.test.js.map +1 -0
- package/dist/__tests__/DeepDiff.test.d.ts +2 -0
- package/dist/__tests__/DeepDiff.test.d.ts.map +1 -0
- package/dist/__tests__/DeepDiff.test.js +229 -0
- package/dist/__tests__/DeepDiff.test.js.map +1 -0
- package/dist/__tests__/IsPlainObject.test.d.ts +2 -0
- package/dist/__tests__/IsPlainObject.test.d.ts.map +1 -0
- package/dist/__tests__/IsPlainObject.test.js +68 -0
- package/dist/__tests__/IsPlainObject.test.js.map +1 -0
- package/dist/__tests__/JSONValidator.test.d.ts +2 -0
- package/dist/__tests__/JSONValidator.test.d.ts.map +1 -0
- package/dist/__tests__/JSONValidator.test.js +221 -0
- package/dist/__tests__/JSONValidator.test.js.map +1 -0
- package/dist/__tests__/MJGlobal.test.js +8 -6
- package/dist/__tests__/MJGlobal.test.js.map +1 -1
- package/dist/__tests__/ResourcePatternUtils.test.d.ts +2 -0
- package/dist/__tests__/ResourcePatternUtils.test.d.ts.map +1 -0
- package/dist/__tests__/ResourcePatternUtils.test.js +50 -0
- package/dist/__tests__/ResourcePatternUtils.test.js.map +1 -0
- package/dist/__tests__/SQLExpressionValidator.security.test.js +62 -1
- package/dist/__tests__/SQLExpressionValidator.security.test.js.map +1 -1
- package/dist/__tests__/SafeExpressionEvaluator.security.test.d.ts +2 -0
- package/dist/__tests__/SafeExpressionEvaluator.security.test.d.ts.map +1 -0
- package/dist/__tests__/SafeExpressionEvaluator.security.test.js +284 -0
- package/dist/__tests__/SafeExpressionEvaluator.security.test.js.map +1 -0
- package/dist/__tests__/SafeExpressionEvaluator.test.d.ts +2 -0
- package/dist/__tests__/SafeExpressionEvaluator.test.d.ts.map +1 -0
- package/dist/__tests__/SafeExpressionEvaluator.test.js +355 -0
- package/dist/__tests__/SafeExpressionEvaluator.test.js.map +1 -0
- package/dist/__tests__/SafeExpressionEvaluator.validateSyntax.test.d.ts +2 -0
- package/dist/__tests__/SafeExpressionEvaluator.validateSyntax.test.d.ts.map +1 -0
- package/dist/__tests__/SafeExpressionEvaluator.validateSyntax.test.js +62 -0
- package/dist/__tests__/SafeExpressionEvaluator.validateSyntax.test.js.map +1 -0
- package/dist/__tests__/TokenEndpointErrors.test.d.ts +2 -0
- package/dist/__tests__/TokenEndpointErrors.test.d.ts.map +1 -0
- package/dist/__tests__/TokenEndpointErrors.test.js +72 -0
- package/dist/__tests__/TokenEndpointErrors.test.js.map +1 -0
- package/dist/__tests__/util.toEpochMs.test.d.ts +2 -0
- package/dist/__tests__/util.toEpochMs.test.d.ts.map +1 -0
- package/dist/__tests__/util.toEpochMs.test.js +57 -0
- package/dist/__tests__/util.toEpochMs.test.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/util/ResourcePatternUtils.d.ts +35 -0
- package/dist/util/ResourcePatternUtils.d.ts.map +1 -0
- package/dist/util/ResourcePatternUtils.js +56 -0
- package/dist/util/ResourcePatternUtils.js.map +1 -0
- package/dist/util.d.ts +36 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +43 -0
- package/dist/util.js.map +1 -1
- package/package.json +3 -2
package/LICENSE
CHANGED
|
@@ -1,7 +1,183 @@
|
|
|
1
|
-
|
|
1
|
+
Business Source License 1.1
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
License text copyright (c) 2024 MariaDB plc, All Rights Reserved.
|
|
4
|
+
"Business Source License" is a trademark of MariaDB plc.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
-----------------------------------------------------------------------------
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Parameters
|
|
9
|
+
|
|
10
|
+
Licensor: Blue Cypress, Inc.
|
|
11
|
+
|
|
12
|
+
Licensed Work: MemberJunction.
|
|
13
|
+
The Licensed Work is (c) 2023-2026 Blue Cypress, Inc.
|
|
14
|
+
|
|
15
|
+
Additional Use Grant: Subject to the terms of this License, Licensor grants
|
|
16
|
+
you the following additional rights to make Production
|
|
17
|
+
Use of the Licensed Work.
|
|
18
|
+
|
|
19
|
+
1. Internal Use
|
|
20
|
+
|
|
21
|
+
You may make production use of the Licensed Work for
|
|
22
|
+
your own internal business or organizational operations.
|
|
23
|
+
|
|
24
|
+
2. Nonprofit Use
|
|
25
|
+
|
|
26
|
+
If you are a Nonprofit, you may make production use of
|
|
27
|
+
the Licensed Work for the operations and activities of
|
|
28
|
+
your Organizational Family.
|
|
29
|
+
|
|
30
|
+
3. MemberJunction Certified Program Use
|
|
31
|
+
|
|
32
|
+
If you are authorized by Licensor under the
|
|
33
|
+
MemberJunction Certified Program to provide professional
|
|
34
|
+
services using the Licensed Work, you may make
|
|
35
|
+
production use of the Licensed Work in providing such
|
|
36
|
+
professional services to a client, provided that:
|
|
37
|
+
|
|
38
|
+
(a) the Licensed Work is deployed in, and the applicable
|
|
39
|
+
production use occurs within, an environment owned,
|
|
40
|
+
leased, licensed, subscribed to, or otherwise controlled
|
|
41
|
+
by that client; and
|
|
42
|
+
|
|
43
|
+
(b) the production use is for that client's own internal
|
|
44
|
+
business or organizational operations or is otherwise
|
|
45
|
+
independently permitted to that client under this
|
|
46
|
+
Additional Use Grant.
|
|
47
|
+
|
|
48
|
+
4. Definitions Applicable to the Additional Use Grant
|
|
49
|
+
|
|
50
|
+
"Affiliate" means, with respect to a specified Person,
|
|
51
|
+
any other Person that directly or indirectly Controls,
|
|
52
|
+
is Controlled by, or is under common Control with such
|
|
53
|
+
specified Person.
|
|
54
|
+
|
|
55
|
+
"Control" (including the terms "Controls," "Controlled
|
|
56
|
+
by," and "under common Control with") means the direct
|
|
57
|
+
or indirect possession of the power to direct or cause
|
|
58
|
+
the direction of the management and policies of a
|
|
59
|
+
Person, whether through ownership of voting interests,
|
|
60
|
+
by contract, or otherwise.
|
|
61
|
+
|
|
62
|
+
"Organizational Family" means, with respect to a Person,
|
|
63
|
+
(a) such Person and its Affiliates, and (b) any
|
|
64
|
+
nonprofit organization, governmental entity, chapter,
|
|
65
|
+
division, local affiliate, regional affiliate, state
|
|
66
|
+
affiliate, national affiliate, or other entity that is
|
|
67
|
+
formally affiliated with such Person through governing
|
|
68
|
+
documents, a charter, bylaws, a membership agreement, or
|
|
69
|
+
another written organizational instrument, and is
|
|
70
|
+
recognized under such documents as part of the same
|
|
71
|
+
organizational structure.
|
|
72
|
+
|
|
73
|
+
"Nonprofit" means a Person recognized by the Internal
|
|
74
|
+
Revenue Service as exempt from federal income taxation
|
|
75
|
+
under Section 501(c)(3), 501(c)(4), 501(c)(5), or
|
|
76
|
+
501(c)(6) of the Internal Revenue Code, or a foreign
|
|
77
|
+
organization recognized under substantially equivalent
|
|
78
|
+
laws.
|
|
79
|
+
|
|
80
|
+
A Person claiming eligibility as a Nonprofit shall, upon
|
|
81
|
+
Licensor's reasonable request, provide documentation
|
|
82
|
+
reasonably sufficient to demonstrate that it qualifies
|
|
83
|
+
as a Nonprofit. If such Person materially misrepresents,
|
|
84
|
+
or is unable to demonstrate, its qualification as a
|
|
85
|
+
Nonprofit, the rights granted to such Person under
|
|
86
|
+
Section 2 of this Additional Use Grant shall terminate.
|
|
87
|
+
|
|
88
|
+
"MemberJunction Certified Program" means Licensor's
|
|
89
|
+
then-current program for certifying and authorizing a
|
|
90
|
+
Person to provide professional services using the
|
|
91
|
+
Licensed Work.
|
|
92
|
+
|
|
93
|
+
"Person" means any individual, corporation, limited
|
|
94
|
+
liability company, partnership, association, nonprofit
|
|
95
|
+
organization, governmental entity, or other legal or
|
|
96
|
+
organizational entity.
|
|
97
|
+
|
|
98
|
+
Change Date: Four (4) years from the date the Licensed Work is first
|
|
99
|
+
made available.
|
|
100
|
+
|
|
101
|
+
Change License: MIT License.
|
|
102
|
+
|
|
103
|
+
For information about alternative licensing arrangements for the Licensed
|
|
104
|
+
Work, please contact Blue Cypress, Inc.
|
|
105
|
+
|
|
106
|
+
-----------------------------------------------------------------------------
|
|
107
|
+
|
|
108
|
+
Terms
|
|
109
|
+
|
|
110
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
111
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
112
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
113
|
+
production use.
|
|
114
|
+
|
|
115
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
116
|
+
available distribution of a specific version of the Licensed Work under this
|
|
117
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
118
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
119
|
+
above terminate.
|
|
120
|
+
|
|
121
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
122
|
+
currently in effect as described in this License, you must purchase a
|
|
123
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
124
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
125
|
+
|
|
126
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
127
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
128
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
129
|
+
for each version of the Licensed Work released by Licensor.
|
|
130
|
+
|
|
131
|
+
You must conspicuously display this License on each original or modified copy
|
|
132
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
133
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
134
|
+
License apply to your use of that work.
|
|
135
|
+
|
|
136
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
137
|
+
terminate your rights under this License for the current and all other
|
|
138
|
+
versions of the Licensed Work.
|
|
139
|
+
|
|
140
|
+
This License does not grant you any right in any trademark or logo of
|
|
141
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
142
|
+
Licensor as expressly required by this License).
|
|
143
|
+
|
|
144
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
145
|
+
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
146
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
147
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
148
|
+
TITLE.
|
|
149
|
+
|
|
150
|
+
MariaDB hereby grants you permission to use this License's text to license
|
|
151
|
+
your works, and to refer to it using the trademark "Business Source License",
|
|
152
|
+
as long as you comply with the Covenants of Licensor below.
|
|
153
|
+
|
|
154
|
+
-----------------------------------------------------------------------------
|
|
155
|
+
|
|
156
|
+
Covenants of Licensor
|
|
157
|
+
|
|
158
|
+
In consideration of the right to use this License's text and the "Business
|
|
159
|
+
Source License" name and trademark, Licensor covenants to MariaDB, and to all
|
|
160
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
161
|
+
|
|
162
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
163
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
164
|
+
where "compatible" means that software provided under the Change License
|
|
165
|
+
can be included in a program with software provided under GPL Version 2.0
|
|
166
|
+
or a later version. Licensor may specify additional Change Licenses without
|
|
167
|
+
limitation.
|
|
168
|
+
|
|
169
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
170
|
+
impose any additional restriction on the right granted in this License, as
|
|
171
|
+
the Additional Use Grant; or (b) insert the text "None".
|
|
172
|
+
|
|
173
|
+
3. To specify a Change Date.
|
|
174
|
+
|
|
175
|
+
4. Not to modify this License in any other way.
|
|
176
|
+
|
|
177
|
+
-----------------------------------------------------------------------------
|
|
178
|
+
|
|
179
|
+
Notice
|
|
180
|
+
|
|
181
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
182
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
183
|
+
under an Open Source License, as stated in this License.
|
package/README.md
CHANGED
|
@@ -343,7 +343,7 @@ if (!result.Success) {
|
|
|
343
343
|
|
|
344
344
|
### SafeExpressionEvaluator
|
|
345
345
|
|
|
346
|
-
Evaluates boolean expressions against context objects securely,
|
|
346
|
+
Evaluates boolean expressions against context objects securely. The expression is parsed and every AST node checked against an **allowlist** before it is compiled, so constructs outside the supported grammar — `eval()`, `require()`, `.constructor`, computed member keys built at runtime, calls to anything unlisted — are refused at validation time and never reach the compiler.
|
|
347
347
|
|
|
348
348
|
```typescript
|
|
349
349
|
import { SafeExpressionEvaluator } from '@memberjunction/global';
|
|
@@ -363,7 +363,7 @@ if (result.success) {
|
|
|
363
363
|
}
|
|
364
364
|
```
|
|
365
365
|
|
|
366
|
-
Supports comparisons (`==`, `!=`, `<`, `>`, `<=`, `>=`), logical operators (`&&`, `||`, `!`), dot-notation property access, bracket-notation
|
|
366
|
+
Supports comparisons (`==`, `!=`, `<`, `>`, `<=`, `>=`), logical operators (`&&`, `||`, `!`), `typeof`, dot-notation property access including optional chaining (`payload?.customer?.tier`), bracket-notation access with a **literal** index/key, safe string/array methods (`.includes()`, `.startsWith()`, `.some()`, `.every()`, etc.), and the safe globals exported as `SAFE_EXPRESSION_GLOBALS` — `Math`, `Number`, `String`, `Boolean`, `Array`, `Object`, `JSON`, `Date`, `parseInt`, `parseFloat`, `isNaN`, `isFinite` — callable as namespace methods (`Math.abs(x)`, `Object.keys(x)`) or bare functions (`Number(x)`). Regex literals, `in`/`instanceof`, and methods outside the safe list are not supported.
|
|
367
367
|
|
|
368
368
|
### SQLExpressionValidator
|
|
369
369
|
|
package/dist/ClassUtils.d.ts
CHANGED
|
@@ -69,4 +69,24 @@ export declare function IsClassConstructor(value: any): boolean;
|
|
|
69
69
|
* @returns The class name or a fallback string
|
|
70
70
|
*/
|
|
71
71
|
export declare function GetClassName(ClassRef: any): string;
|
|
72
|
+
/**
|
|
73
|
+
* Determines whether a subclass has replaced `member` somewhere between `instance` and `BaseClassRef`.
|
|
74
|
+
*
|
|
75
|
+
* Distinguishes "the author made no choice" from "the author chose the value that happens to be the
|
|
76
|
+
* default" — something a getter cannot express on its own. A base class member returning `true`
|
|
77
|
+
* looks identical whether a subclass deliberately opted in or never knew the member existed, so an
|
|
78
|
+
* API whose default sits in the *off* position silently disables the subclasses that most wanted it
|
|
79
|
+
* on. Asking whether the member was overridden recovers the intent.
|
|
80
|
+
*
|
|
81
|
+
* Handles methods and accessors alike by comparing property descriptors, and finds an override
|
|
82
|
+
* declared anywhere in a multi-level chain — a generated class, an application subclass, a
|
|
83
|
+
* server-side subclass layered on top of it.
|
|
84
|
+
*
|
|
85
|
+
* @param instance The object whose class chain is inspected. A non-object returns false.
|
|
86
|
+
* @param member The property name to look for.
|
|
87
|
+
* @param BaseClassRef The class declaring the default implementation. A member `BaseClassRef` does
|
|
88
|
+
* not itself declare returns false — there is no baseline to have overridden.
|
|
89
|
+
* @returns True when some class below `BaseClassRef` declares `member`.
|
|
90
|
+
*/
|
|
91
|
+
export declare function IsMemberOverridden(instance: any, member: string, BaseClassRef: any): boolean;
|
|
72
92
|
//# sourceMappingURL=ClassUtils.d.ts.map
|
package/dist/ClassUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassUtils.d.ts","sourceRoot":"","sources":["../src/ClassUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,SAAS;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,GAAG,GAAG,GAAG,GAAG,IAAI,CAavD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,GAAG,GAAG,GAAG,CAmB/C;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,iBAAiB,EAAE,GAAG,EAAE,iBAAiB,EAAE,GAAG,GAAG,OAAO,CA6BpF;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CASlD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,mBAAmB,EAAE,GAAG,EAAE,iBAAiB,EAAE,GAAG,GAAG,OAAO,CAE7F;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,GAAG,GAAG,SAAS,EAAE,CAwB9D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,GAAG,GAAG,SAAS,EAAE,CAwBhE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAqBtD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,GAAG,GAAG,MAAM,CAkBlD"}
|
|
1
|
+
{"version":3,"file":"ClassUtils.d.ts","sourceRoot":"","sources":["../src/ClassUtils.ts"],"names":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
|
+
* Cache for {@link IsMemberOverridden}. Keyed by the subclass constructor, then by the member name
|
|
188
|
+
* plus the base class, because the answer is a property of that class pair and a hot path should
|
|
189
|
+
* not walk a prototype chain on every call.
|
|
190
|
+
*/
|
|
191
|
+
const __memberOverrideCache = new WeakMap();
|
|
192
|
+
/**
|
|
193
|
+
* Determines whether a subclass has replaced `member` somewhere between `instance` and `BaseClassRef`.
|
|
194
|
+
*
|
|
195
|
+
* Distinguishes "the author made no choice" from "the author chose the value that happens to be the
|
|
196
|
+
* default" — something a getter cannot express on its own. A base class member returning `true`
|
|
197
|
+
* looks identical whether a subclass deliberately opted in or never knew the member existed, so an
|
|
198
|
+
* API whose default sits in the *off* position silently disables the subclasses that most wanted it
|
|
199
|
+
* on. Asking whether the member was overridden recovers the intent.
|
|
200
|
+
*
|
|
201
|
+
* Handles methods and accessors alike by comparing property descriptors, and finds an override
|
|
202
|
+
* declared anywhere in a multi-level chain — a generated class, an application subclass, a
|
|
203
|
+
* server-side subclass layered on top of it.
|
|
204
|
+
*
|
|
205
|
+
* @param instance The object whose class chain is inspected. A non-object returns false.
|
|
206
|
+
* @param member The property name to look for.
|
|
207
|
+
* @param BaseClassRef The class declaring the default implementation. A member `BaseClassRef` does
|
|
208
|
+
* not itself declare returns false — there is no baseline to have overridden.
|
|
209
|
+
* @returns True when some class below `BaseClassRef` declares `member`.
|
|
210
|
+
*/
|
|
211
|
+
export function IsMemberOverridden(instance, member, BaseClassRef) {
|
|
212
|
+
if (!instance || typeof instance !== 'object' || !member || typeof BaseClassRef !== 'function') {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
const ctor = instance.constructor;
|
|
216
|
+
if (typeof ctor !== 'function') {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
// "Overridden relative to a class this object does not descend from" is not a meaningful
|
|
220
|
+
// question, and answering it by walking anyway is actively wrong: the walk terminates on the
|
|
221
|
+
// base prototype, so an unrelated chain is traversed to its end and the first same-named member
|
|
222
|
+
// found anywhere reads as an override.
|
|
223
|
+
if (!(instance instanceof BaseClassRef)) {
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
// The base class is part of the answer's identity, so two different bases asked about the same
|
|
227
|
+
// member on the same class cannot collide in the cache.
|
|
228
|
+
const key = member + ' ' + GetClassName(BaseClassRef);
|
|
229
|
+
let perClass = __memberOverrideCache.get(ctor);
|
|
230
|
+
if (perClass && perClass.has(key)) {
|
|
231
|
+
return perClass.get(key);
|
|
232
|
+
}
|
|
233
|
+
if (!perClass) {
|
|
234
|
+
perClass = new Map();
|
|
235
|
+
__memberOverrideCache.set(ctor, perClass);
|
|
236
|
+
}
|
|
237
|
+
const basePrototype = BaseClassRef.prototype;
|
|
238
|
+
const base = basePrototype ? Object.getOwnPropertyDescriptor(basePrototype, member) : undefined;
|
|
239
|
+
let answer = false;
|
|
240
|
+
if (base) {
|
|
241
|
+
let proto = Object.getPrototypeOf(instance);
|
|
242
|
+
while (proto && proto !== basePrototype) {
|
|
243
|
+
const own = Object.getOwnPropertyDescriptor(proto, member);
|
|
244
|
+
if (own && (own.get !== base.get || own.value !== base.value)) {
|
|
245
|
+
answer = true;
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
proto = Object.getPrototypeOf(proto);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
perClass.set(key, answer);
|
|
252
|
+
return answer;
|
|
253
|
+
}
|
|
186
254
|
//# sourceMappingURL=ClassUtils.js.map
|
package/dist/ClassUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassUtils.js","sourceRoot":"","sources":["../src/ClassUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,QAAa;IACvC,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,UAAU,GA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C,CAAC;IAED,MAAM,aAAa,GAAG,YAAY,CAAC,SAAS,CAAC;IAC7C,MAAM,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAChG,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,IAAI,EAAE,CAAC;QACP,IAAI,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC5C,OAAO,KAAK,IAAI,KAAK,KAAK,aAAa,EAAE,CAAC;YACtC,MAAM,GAAG,GAAG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAC3D,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC5D,MAAM,GAAG,IAAI,CAAC;gBACd,MAAM;YACV,CAAC;YACD,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;IACL,CAAC;IACD,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC1B,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -29,6 +29,31 @@ export declare const FULL_QUERY_ALLOWED_KEYWORDS: readonly ["EXISTS", "ANY", "AL
|
|
|
29
29
|
* String literals are stripped before this check runs, so a literal value like `'sys.x'` is safe.
|
|
30
30
|
*/
|
|
31
31
|
export declare const BLOCKED_SYSTEM_OBJECT_PATTERNS: RegExp[];
|
|
32
|
+
/**
|
|
33
|
+
* Removes SQL string literals from a clause or expression so that a keyword denylist can be
|
|
34
|
+
* applied to the *code* portion without tripping over keywords that appear inside quoted data
|
|
35
|
+
* (e.g. `Comments LIKE '%--%'`).
|
|
36
|
+
*
|
|
37
|
+
* 🚨 SECURITY — this is the single implementation of literal-stripping for MJ's SQL screens, and
|
|
38
|
+
* it MUST stay byte-for-byte consistent with how the database parses literals. If the stripper
|
|
39
|
+
* removes a span the database does NOT treat as a literal, everything hidden inside that span
|
|
40
|
+
* bypasses the denylist while the database still executes it.
|
|
41
|
+
*
|
|
42
|
+
* An earlier version of this logic (duplicated in two places, which is how it survived) honored
|
|
43
|
+
* **backslash escaping** — `/(['"])(?:(?=(\\?))\2[\s\S])*?\1/g`. SQL Server and PostgreSQL do not
|
|
44
|
+
* treat `\` as an escape character, so `x = 'a\') ; DROP TABLE Users; --'` was swallowed whole as
|
|
45
|
+
* one "literal" and stripped to `x = `, which passed every denylist — while the database closed
|
|
46
|
+
* the literal at the real quote and executed the stacked statement.
|
|
47
|
+
*
|
|
48
|
+
* **Do NOT reintroduce backslash-escape handling here, and do NOT inline a second copy of this
|
|
49
|
+
* regex anywhere else — call this function.**
|
|
50
|
+
*
|
|
51
|
+
* @param sql The clause, expression, or query to strip literals from
|
|
52
|
+
* @returns The input with every complete string literal removed. An UNTERMINATED literal is left
|
|
53
|
+
* in place on purpose: the stray quote and everything after it stay visible to the
|
|
54
|
+
* denylist rather than being silently swallowed.
|
|
55
|
+
*/
|
|
56
|
+
export declare function StripSQLStringLiterals(sql: string): string;
|
|
32
57
|
/**
|
|
33
58
|
* Safe SQL functions allowed in expressions, organized by category
|
|
34
59
|
*/
|
|
@@ -117,7 +142,9 @@ export declare class SQLExpressionValidator extends BaseSingleton<SQLExpressionV
|
|
|
117
142
|
validate(expression: string, options: SQLValidationOptions): SQLValidationResult;
|
|
118
143
|
/**
|
|
119
144
|
* Remove string literals to avoid false positives in keyword detection.
|
|
120
|
-
*
|
|
145
|
+
*
|
|
146
|
+
* 🚨 SECURITY: delegates to {@link StripSQLStringLiterals} — read the warning there before
|
|
147
|
+
* changing anything about how literals are matched. This must never grow its own regex again.
|
|
121
148
|
*/
|
|
122
149
|
private removeStringLiterals;
|
|
123
150
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SQLExpressionValidator.d.ts","sourceRoot":"","sources":["../src/SQLExpressionValidator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,sBAAsB,2gBA0CzB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,2BAA2B,wFAe9B,CAAC;AAEX;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,EAAE,MAAM,EAMlD,CAAC;
|
|
1
|
+
{"version":3,"file":"SQLExpressionValidator.d.ts","sourceRoot":"","sources":["../src/SQLExpressionValidator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,sBAAsB,2gBA0CzB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,2BAA2B,wFAe9B,CAAC;AAEX;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,EAAE,MAAM,EAMlD,CAAC;AAcF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;CA2BxB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAC5B,cAAc,GACd,UAAU,GACV,WAAW,GACX,iBAAiB,GACjB,YAAY,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,+CAA+C;IAC/C,KAAK,EAAE,OAAO,CAAC;IACf,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,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**
|
|
80
|
+
* Matches SQL string literals the way SQL Server and PostgreSQL (with the default
|
|
81
|
+
* `standard_conforming_strings=on`) actually parse them: a literal is closed by the next
|
|
82
|
+
* single quote, `''` is an embedded quote, and a backslash is an ORDINARY character that
|
|
83
|
+
* does NOT escape the closing quote. Double-quoted runs are matched with the same doubling
|
|
84
|
+
* rule so a delimited identifier can't hide a payload either.
|
|
85
|
+
*
|
|
86
|
+
* @see StripSQLStringLiterals — use that, not this constant, so every caller gets the
|
|
87
|
+
* documented semantics and the two validators in MJ can never drift apart again.
|
|
88
|
+
*/
|
|
89
|
+
const SQL_STRING_LITERAL_PATTERN = /'(?:[^']|'')*'|"(?:[^"]|"")*"/g;
|
|
90
|
+
/**
|
|
91
|
+
* Removes SQL string literals from a clause or expression so that a keyword denylist can be
|
|
92
|
+
* applied to the *code* portion without tripping over keywords that appear inside quoted data
|
|
93
|
+
* (e.g. `Comments LIKE '%--%'`).
|
|
94
|
+
*
|
|
95
|
+
* 🚨 SECURITY — this is the single implementation of literal-stripping for MJ's SQL screens, and
|
|
96
|
+
* it MUST stay byte-for-byte consistent with how the database parses literals. If the stripper
|
|
97
|
+
* removes a span the database does NOT treat as a literal, everything hidden inside that span
|
|
98
|
+
* bypasses the denylist while the database still executes it.
|
|
99
|
+
*
|
|
100
|
+
* An earlier version of this logic (duplicated in two places, which is how it survived) honored
|
|
101
|
+
* **backslash escaping** — `/(['"])(?:(?=(\\?))\2[\s\S])*?\1/g`. SQL Server and PostgreSQL do not
|
|
102
|
+
* treat `\` as an escape character, so `x = 'a\') ; DROP TABLE Users; --'` was swallowed whole as
|
|
103
|
+
* one "literal" and stripped to `x = `, which passed every denylist — while the database closed
|
|
104
|
+
* the literal at the real quote and executed the stacked statement.
|
|
105
|
+
*
|
|
106
|
+
* **Do NOT reintroduce backslash-escape handling here, and do NOT inline a second copy of this
|
|
107
|
+
* regex anywhere else — call this function.**
|
|
108
|
+
*
|
|
109
|
+
* @param sql The clause, expression, or query to strip literals from
|
|
110
|
+
* @returns The input with every complete string literal removed. An UNTERMINATED literal is left
|
|
111
|
+
* in place on purpose: the stray quote and everything after it stay visible to the
|
|
112
|
+
* denylist rather than being silently swallowed.
|
|
113
|
+
*/
|
|
114
|
+
export function StripSQLStringLiterals(sql) {
|
|
115
|
+
return sql.replace(SQL_STRING_LITERAL_PATTERN, '');
|
|
116
|
+
}
|
|
79
117
|
/**
|
|
80
118
|
* Safe SQL functions allowed in expressions, organized by category
|
|
81
119
|
*/
|
|
@@ -173,12 +211,12 @@ export class SQLExpressionValidator extends BaseSingleton {
|
|
|
173
211
|
}
|
|
174
212
|
/**
|
|
175
213
|
* Remove string literals to avoid false positives in keyword detection.
|
|
176
|
-
*
|
|
214
|
+
*
|
|
215
|
+
* 🚨 SECURITY: delegates to {@link StripSQLStringLiterals} — read the warning there before
|
|
216
|
+
* changing anything about how literals are matched. This must never grow its own regex again.
|
|
177
217
|
*/
|
|
178
218
|
removeStringLiterals(expression) {
|
|
179
|
-
|
|
180
|
-
const stringPattern = /(['"])(?:(?=(\\?))\2[\s\S])*?\1/g;
|
|
181
|
-
return expression.replace(stringPattern, '');
|
|
219
|
+
return StripSQLStringLiterals(expression);
|
|
182
220
|
}
|
|
183
221
|
/**
|
|
184
222
|
* Check for dangerous SQL patterns that indicate injection attempts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SQLExpressionValidator.js","sourceRoot":"","sources":["../src/SQLExpressionValidator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,iCAAiC;IACjC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ;IAE/C,mCAAmC;IACnC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS;IAEhD,8BAA8B;IAC9B,OAAO,EAAE,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