@prosopo/types-database 5.8.0 → 5.9.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/.turbo/turbo-build$colon$cjs.log +6 -6
- package/.turbo/turbo-build$colon$tsc.log +14 -14
- package/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +34 -0
- package/dist/cjs/index.cjs +5 -0
- package/dist/cjs/types/captcha.cjs +6 -0
- package/dist/cjs/types/client.cjs +88 -6
- package/dist/cjs/types/index.cjs +5 -0
- package/dist/cjs/types/provider.cjs +172 -71
- package/dist/index.js +4 -4
- package/dist/types/captcha.d.ts +6 -2
- package/dist/types/captcha.d.ts.map +1 -1
- package/dist/types/captcha.js +6 -2
- package/dist/types/captcha.js.map +1 -1
- package/dist/types/client.d.ts +598 -137
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/client.js +88 -7
- package/dist/types/client.js.map +1 -1
- package/dist/types/index.js +4 -4
- package/dist/types/provider.d.ts +1163 -207
- package/dist/types/provider.d.ts.map +1 -1
- package/dist/types/provider.js +171 -72
- package/dist/types/provider.js.map +1 -1
- package/dist/types/schemas.test.js +8 -2
- package/dist/types/schemas.test.js.map +1 -1
- package/package.json +5 -5
|
@@ -39,10 +39,10 @@ dist/cjs/types/mongo.cjs 0.00 kB │ gzip: 0.02 kB
|
|
|
39
39
|
dist/cjs/types/userAgent.cjs 0.00 kB │ gzip: 0.02 kB
|
|
40
40
|
dist/cjs/types/bannedDomain.cjs 0.23 kB │ gzip: 0.16 kB
|
|
41
41
|
dist/cjs/types/spamEmailDomain.cjs 0.25 kB │ gzip: 0.17 kB
|
|
42
|
-
dist/cjs/types/captcha.cjs
|
|
43
|
-
dist/cjs/types/index.cjs 2.
|
|
44
|
-
dist/cjs/index.cjs
|
|
45
|
-
dist/cjs/types/client.cjs
|
|
46
|
-
dist/cjs/types/provider.cjs
|
|
42
|
+
dist/cjs/types/captcha.cjs 1.49 kB │ gzip: 0.31 kB
|
|
43
|
+
dist/cjs/types/index.cjs 2.92 kB │ gzip: 0.53 kB
|
|
44
|
+
dist/cjs/index.cjs 3.03 kB │ gzip: 0.59 kB
|
|
45
|
+
dist/cjs/types/client.cjs 9.87 kB │ gzip: 1.96 kB
|
|
46
|
+
dist/cjs/types/provider.cjs 32.62 kB │ gzip: 5.18 kB
|
|
47
47
|
|
|
48
|
-
[32m✓ built in
|
|
48
|
+
[32m✓ built in 37ms[39m
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
$ tsc --build --verbose
|
|
2
|
-
|
|
2
|
+
10:11:49 AM - Projects in this build:
|
|
3
3
|
* ../../dev/config/tsconfig.json
|
|
4
4
|
* ../util/tsconfig.json
|
|
5
5
|
* ../locale/tsconfig.json
|
|
@@ -13,29 +13,29 @@ $ tsc --build --verbose
|
|
|
13
13
|
* ../user-access-policy/tsconfig.json
|
|
14
14
|
* tsconfig.json
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
10:11:49 AM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
10:11:49 AM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/table.ts' is older than output '../util/tsconfig.tsbuildinfo'
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
10:11:49 AM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
10:11:49 AM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/logger.ts' is older than output '../logger/tsconfig.tsbuildinfo'
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
10:11:49 AM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
10:11:49 AM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
10:11:49 AM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/tests/utils/batches.unit.test.ts' is older than output '../common/tsconfig.tsbuildinfo'
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
10:11:49 AM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/apiRoutes.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
10:11:49 AM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/index.ts' is older than output '../redis-client/tsconfig.tsbuildinfo'
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
10:11:49 AM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
10:11:49 AM - Project '../user-access-policy/tsconfig.json' is up to date because newest input '../user-access-policy/src/transformRule.ts' is older than output '../user-access-policy/tsconfig.tsbuildinfo'
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
10:11:49 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
10:11:49 AM - Building project '/home/runner/work/captcha/captcha/packages/types-database/tsconfig.json'...
|
|
41
41
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -41,10 +41,10 @@ dist/types/userAgent.js 0.01 kB │ gzip: 0.03 kB
|
|
|
41
41
|
dist/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
|
|
42
42
|
dist/types/bannedDomain.js 0.22 kB │ gzip: 0.17 kB
|
|
43
43
|
dist/types/spamEmailDomain.js 0.23 kB │ gzip: 0.17 kB
|
|
44
|
-
dist/types/captcha.js
|
|
45
|
-
dist/types/index.js 1.
|
|
46
|
-
dist/index.js
|
|
47
|
-
dist/types/client.js
|
|
48
|
-
dist/types/provider.js
|
|
44
|
+
dist/types/captcha.js 1.24 kB │ gzip: 0.30 kB
|
|
45
|
+
dist/types/index.js 1.95 kB │ gzip: 0.42 kB
|
|
46
|
+
dist/index.js 2.03 kB │ gzip: 0.45 kB
|
|
47
|
+
dist/types/client.js 9.63 kB │ gzip: 2.00 kB
|
|
48
|
+
dist/types/provider.js 31.27 kB │ gzip: 5.17 kB
|
|
49
49
|
|
|
50
|
-
[32m✓ built in
|
|
50
|
+
[32m✓ built in 47ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @prosopo/types-database
|
|
2
2
|
|
|
3
|
+
## 5.9.0
|
|
4
|
+
### Minor Changes
|
|
5
|
+
|
|
6
|
+
- b299a91: An audio challenge, offered only as an accessibility alternative, like reCAPTCHA's audio option. The user hears a short sequence of spoken digits and types them in.
|
|
7
|
+
|
|
8
|
+
It is off by default and needs two switches. Prosopo has to turn on the `captchaTypeFeatureFlags.audio` feature flag for the site, which the site owner cannot do, and the site owner has to set `audioAccessibilityEnabled`. When both are on, image, puzzle and icon-order challenges show a "Use audio instead" button. Pressing it swaps the visual challenge for the audio one. After a wrong answer the user stays on audio and gets a fresh clip.
|
|
9
|
+
|
|
10
|
+
Audio is never a captcha type that can be selected or routed to. A site's `captchaType`, traffic-filter categories, Restrict rules and the site-key CLI all reject it, and routing, PoW escalation and the severity tiers leave it out. The provider only serves audio against the visual session the user was already given, and only on a site with both switches on; any other audio request is refused before the session is used up, and a request without a session is always refused.
|
|
11
|
+
|
|
12
|
+
The spoken digits are synthesised by `@prosopo/audio-assets`, so there is no recorded set of clips to collect. The answer never leaves the provider, and a challenge can be submitted and verified only once, even under concurrent requests. `@prosopo/procaptcha-audio` is the widget. It and the "Use audio instead" button are built on the shared widget code in `@prosopo/procaptcha-common`, and the provider side is built on the shared interactive-captcha code that puzzle and icon-order use.
|
|
13
|
+
|
|
14
|
+
The demo playground has audio pages, and there is an end-to-end test for it.
|
|
15
|
+
- e13d7a8: New captcha type: `iconOrder`. The user is shown a frame of icons and a legend, and clicks the legend's icons in the order given.
|
|
16
|
+
|
|
17
|
+
Icon-order is off by default. Only Prosopo can switch it on for a site, with the `captchaTypeFeatureFlags.iconOrder` feature flag; the site owner cannot. A site without the flag is never served icon-order by any route, and the challenge endpoint refuses it. Once the flag is on, the owner can still keep icon-order out of the frictionless flow with `frictionlessTypes.iconOrder`, the same way as image and puzzle.
|
|
18
|
+
|
|
19
|
+
The answer never leaves the provider. Icon positions are stored on the challenge record, and the widget receives only the rendered frame and legend. Grading checks order as well as position, and each icon's hit radius scales with its size. Verifying a token is single-use under concurrent requests.
|
|
20
|
+
|
|
21
|
+
`@prosopo/icon-order-assets` draws the imagery, and `@prosopo/procaptcha-icon-order` is the widget. Its text is translated into every supported language.
|
|
22
|
+
|
|
23
|
+
Puzzle and icon-order now share their server code: challenge and solution handlers, the verify route, the submit and verify pipeline, and the database record methods. The widget code they have in common moves into `@prosopo/procaptcha-common`: the lazy mount wrapper, manager expiry and dispose, spent-session handling, behavioural data encryption and trusted click coordinates. Puzzle's behaviour is unchanged.
|
|
24
|
+
|
|
25
|
+
The demo playground has icon-order pages, and there is an end-to-end test for it.
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [b299a91]
|
|
30
|
+
- Updated dependencies [e13d7a8]
|
|
31
|
+
- Updated dependencies [270395d]
|
|
32
|
+
- @prosopo/types@5.14.0
|
|
33
|
+
- @prosopo/locale@3.8.0
|
|
34
|
+
- @prosopo/user-access-policy@3.14.16
|
|
35
|
+
- @prosopo/common@3.1.63
|
|
36
|
+
|
|
3
37
|
## 5.8.0
|
|
4
38
|
### Minor Changes
|
|
5
39
|
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -5,6 +5,8 @@ const require_captcha = require("./types/captcha.cjs");
|
|
|
5
5
|
const require_spamEmailDomain = require("./types/spamEmailDomain.cjs");
|
|
6
6
|
const require_bannedDomain = require("./types/bannedDomain.cjs");
|
|
7
7
|
exports.AccountSchema = require_client.AccountSchema;
|
|
8
|
+
exports.AudioCaptchaRecordSchema = require_provider.AudioCaptchaRecordSchema;
|
|
9
|
+
exports.AudioRenderSettingsSchema = require_client.AudioRenderSettingsSchema;
|
|
8
10
|
exports.BannedDomainRecordSchema = require_bannedDomain.BannedDomainRecordSchema;
|
|
9
11
|
exports.CaptchaRecordSchema = require_provider.CaptchaRecordSchema;
|
|
10
12
|
exports.ClientContextEntropyRecordSchema = require_provider.ClientContextEntropyRecordSchema;
|
|
@@ -14,6 +16,7 @@ exports.CompositeIpAddressRecordSchemaObj = require_provider.CompositeIpAddressR
|
|
|
14
16
|
exports.DatasetRecordSchema = require_provider.DatasetRecordSchema;
|
|
15
17
|
exports.DecisionMachineArtifactRecordSchema = require_provider.DecisionMachineArtifactRecordSchema;
|
|
16
18
|
exports.IPValidationRulesSchema = require_client.IPValidationRulesSchema;
|
|
19
|
+
exports.IconOrderCaptchaRecordSchema = require_provider.IconOrderCaptchaRecordSchema;
|
|
17
20
|
exports.PoWCaptchaRecordSchema = require_provider.PoWCaptchaRecordSchema;
|
|
18
21
|
exports.PuzzleCaptchaRecordSchema = require_provider.PuzzleCaptchaRecordSchema;
|
|
19
22
|
exports.PuzzleRenderSettingsSchema = require_client.PuzzleRenderSettingsSchema;
|
|
@@ -23,6 +26,8 @@ exports.ScheduledTaskSchema = require_provider.ScheduledTaskSchema;
|
|
|
23
26
|
exports.SessionRecordSchema = require_provider.SessionRecordSchema;
|
|
24
27
|
exports.SolutionRecordSchema = require_provider.SolutionRecordSchema;
|
|
25
28
|
exports.SpamEmailDomainRecordSchema = require_spamEmailDomain.SpamEmailDomainRecordSchema;
|
|
29
|
+
exports.StoredAudioCaptchaRecordSchema = require_captcha.StoredAudioCaptchaRecordSchema;
|
|
30
|
+
exports.StoredIconOrderCaptchaRecordSchema = require_captcha.StoredIconOrderCaptchaRecordSchema;
|
|
26
31
|
exports.StoredPoWCaptchaRecordSchema = require_captcha.StoredPoWCaptchaRecordSchema;
|
|
27
32
|
exports.StoredPuzzleCaptchaRecordSchema = require_captcha.StoredPuzzleCaptchaRecordSchema;
|
|
28
33
|
exports.StoredSessionRecordSchema = require_captcha.StoredSessionRecordSchema;
|
|
@@ -8,7 +8,13 @@ var StoredPoWCaptchaRecordSchema = new mongoose.Schema({ ...require_provider.PoW
|
|
|
8
8
|
StoredPoWCaptchaRecordSchema.index({ sessionId: 1 });
|
|
9
9
|
var StoredPuzzleCaptchaRecordSchema = new mongoose.Schema({ ...require_provider.PuzzleCaptchaRecordSchema.obj });
|
|
10
10
|
StoredPuzzleCaptchaRecordSchema.index({ sessionId: 1 });
|
|
11
|
+
var StoredAudioCaptchaRecordSchema = new mongoose.Schema({ ...require_provider.AudioCaptchaRecordSchema.obj });
|
|
12
|
+
StoredAudioCaptchaRecordSchema.index({ sessionId: 1 });
|
|
13
|
+
var StoredIconOrderCaptchaRecordSchema = new mongoose.Schema({ ...require_provider.IconOrderCaptchaRecordSchema.obj });
|
|
14
|
+
StoredIconOrderCaptchaRecordSchema.index({ sessionId: 1 });
|
|
11
15
|
//#endregion
|
|
16
|
+
exports.StoredAudioCaptchaRecordSchema = StoredAudioCaptchaRecordSchema;
|
|
17
|
+
exports.StoredIconOrderCaptchaRecordSchema = StoredIconOrderCaptchaRecordSchema;
|
|
12
18
|
exports.StoredPoWCaptchaRecordSchema = StoredPoWCaptchaRecordSchema;
|
|
13
19
|
exports.StoredPuzzleCaptchaRecordSchema = StoredPuzzleCaptchaRecordSchema;
|
|
14
20
|
exports.StoredSessionRecordSchema = StoredSessionRecordSchema;
|
|
@@ -119,6 +119,45 @@ var PuzzleRenderSettingsSchema = new mongoose.Schema({
|
|
|
119
119
|
required: false
|
|
120
120
|
}
|
|
121
121
|
}, { _id: false });
|
|
122
|
+
var AudioRenderSettingsSchema = new mongoose.Schema({
|
|
123
|
+
digitCount: {
|
|
124
|
+
type: Number,
|
|
125
|
+
min: 3,
|
|
126
|
+
max: 8,
|
|
127
|
+
required: false
|
|
128
|
+
},
|
|
129
|
+
noiseSnrDb: {
|
|
130
|
+
type: Number,
|
|
131
|
+
min: 3,
|
|
132
|
+
max: 60,
|
|
133
|
+
required: false
|
|
134
|
+
},
|
|
135
|
+
babbleGain: {
|
|
136
|
+
type: Number,
|
|
137
|
+
min: 0,
|
|
138
|
+
max: .6,
|
|
139
|
+
required: false
|
|
140
|
+
},
|
|
141
|
+
babbleVoices: {
|
|
142
|
+
type: Number,
|
|
143
|
+
min: 0,
|
|
144
|
+
max: 4,
|
|
145
|
+
required: false
|
|
146
|
+
},
|
|
147
|
+
reverbMix: {
|
|
148
|
+
type: Number,
|
|
149
|
+
min: 0,
|
|
150
|
+
max: .6,
|
|
151
|
+
required: false
|
|
152
|
+
},
|
|
153
|
+
gapMs: {
|
|
154
|
+
type: Number,
|
|
155
|
+
min: 0,
|
|
156
|
+
max: 1500,
|
|
157
|
+
required: false
|
|
158
|
+
}
|
|
159
|
+
}, { _id: false });
|
|
160
|
+
var SELECTABLE_CAPTCHA_TYPES = Object.values(_prosopo_types.CaptchaType).filter((captchaType) => captchaType !== _prosopo_types.CaptchaType.audio);
|
|
122
161
|
var TrafficCategoryPolicySchema = new mongoose.Schema({
|
|
123
162
|
action: {
|
|
124
163
|
type: String,
|
|
@@ -127,7 +166,7 @@ var TrafficCategoryPolicySchema = new mongoose.Schema({
|
|
|
127
166
|
},
|
|
128
167
|
captchaType: {
|
|
129
168
|
type: String,
|
|
130
|
-
enum:
|
|
169
|
+
enum: SELECTABLE_CAPTCHA_TYPES,
|
|
131
170
|
required: false
|
|
132
171
|
},
|
|
133
172
|
powDifficulty: {
|
|
@@ -148,15 +187,27 @@ var TrafficCategoryPolicySchema = new mongoose.Schema({
|
|
|
148
187
|
max: _prosopo_types.MAX_PAD_BYTES,
|
|
149
188
|
required: false
|
|
150
189
|
},
|
|
190
|
+
iconOrderTolerance: {
|
|
191
|
+
type: Number,
|
|
192
|
+
required: false
|
|
193
|
+
},
|
|
194
|
+
iconOrder: {
|
|
195
|
+
type: mongoose.Schema.Types.Mixed,
|
|
196
|
+
required: false
|
|
197
|
+
},
|
|
151
198
|
puzzle: {
|
|
152
199
|
type: PuzzleRenderSettingsSchema,
|
|
153
200
|
required: false
|
|
201
|
+
},
|
|
202
|
+
audio: {
|
|
203
|
+
type: AudioRenderSettingsSchema,
|
|
204
|
+
required: false
|
|
154
205
|
}
|
|
155
206
|
}, { _id: false });
|
|
156
207
|
var UserSettingsSchema = new mongoose.Schema({
|
|
157
208
|
captchaType: {
|
|
158
209
|
type: String,
|
|
159
|
-
enum:
|
|
210
|
+
enum: SELECTABLE_CAPTCHA_TYPES,
|
|
160
211
|
default: _prosopo_types.captchaTypeDefault
|
|
161
212
|
},
|
|
162
213
|
verifiedTimeout: {
|
|
@@ -180,15 +231,29 @@ var UserSettingsSchema = new mongoose.Schema({
|
|
|
180
231
|
puzzle: {
|
|
181
232
|
type: Boolean,
|
|
182
233
|
default: true
|
|
234
|
+
},
|
|
235
|
+
iconOrder: {
|
|
236
|
+
type: Boolean,
|
|
237
|
+
default: true
|
|
183
238
|
}
|
|
184
239
|
}, { _id: false }),
|
|
185
240
|
default: () => ({ ..._prosopo_types.frictionlessTypesDefault })
|
|
186
241
|
},
|
|
187
242
|
captchaTypeFeatureFlags: {
|
|
188
|
-
type: new mongoose.Schema({
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
243
|
+
type: new mongoose.Schema({
|
|
244
|
+
puzzle: {
|
|
245
|
+
type: Boolean,
|
|
246
|
+
required: false
|
|
247
|
+
},
|
|
248
|
+
iconOrder: {
|
|
249
|
+
type: Boolean,
|
|
250
|
+
required: false
|
|
251
|
+
},
|
|
252
|
+
audio: {
|
|
253
|
+
type: Boolean,
|
|
254
|
+
required: false
|
|
255
|
+
}
|
|
256
|
+
}, { _id: false }),
|
|
192
257
|
required: false
|
|
193
258
|
},
|
|
194
259
|
powDifficulty: {
|
|
@@ -213,6 +278,14 @@ var UserSettingsSchema = new mongoose.Schema({
|
|
|
213
278
|
type: Number,
|
|
214
279
|
required: false
|
|
215
280
|
},
|
|
281
|
+
iconOrderTolerance: {
|
|
282
|
+
type: Number,
|
|
283
|
+
required: false
|
|
284
|
+
},
|
|
285
|
+
iconOrder: {
|
|
286
|
+
type: mongoose.Schema.Types.Mixed,
|
|
287
|
+
required: false
|
|
288
|
+
},
|
|
216
289
|
puzzleMaxDifficulty: {
|
|
217
290
|
type: Number,
|
|
218
291
|
min: 0,
|
|
@@ -223,6 +296,14 @@ var UserSettingsSchema = new mongoose.Schema({
|
|
|
223
296
|
type: PuzzleRenderSettingsSchema,
|
|
224
297
|
required: false
|
|
225
298
|
},
|
|
299
|
+
audio: {
|
|
300
|
+
type: AudioRenderSettingsSchema,
|
|
301
|
+
required: false
|
|
302
|
+
},
|
|
303
|
+
audioAccessibilityEnabled: {
|
|
304
|
+
type: Boolean,
|
|
305
|
+
required: false
|
|
306
|
+
},
|
|
226
307
|
ipValidationRules: IPValidationRulesSchema,
|
|
227
308
|
domains: {
|
|
228
309
|
type: [String],
|
|
@@ -415,6 +496,7 @@ var TableNames = /* @__PURE__ */ function(TableNames) {
|
|
|
415
496
|
}({});
|
|
416
497
|
//#endregion
|
|
417
498
|
exports.AccountSchema = AccountSchema;
|
|
499
|
+
exports.AudioRenderSettingsSchema = AudioRenderSettingsSchema;
|
|
418
500
|
exports.IPValidationRulesSchema = IPValidationRulesSchema;
|
|
419
501
|
exports.PuzzleRenderSettingsSchema = PuzzleRenderSettingsSchema;
|
|
420
502
|
exports.TableNames = TableNames;
|
package/dist/cjs/types/index.cjs
CHANGED
|
@@ -4,6 +4,8 @@ const require_captcha = require("./captcha.cjs");
|
|
|
4
4
|
const require_spamEmailDomain = require("./spamEmailDomain.cjs");
|
|
5
5
|
const require_bannedDomain = require("./bannedDomain.cjs");
|
|
6
6
|
exports.AccountSchema = require_client.AccountSchema;
|
|
7
|
+
exports.AudioCaptchaRecordSchema = require_provider.AudioCaptchaRecordSchema;
|
|
8
|
+
exports.AudioRenderSettingsSchema = require_client.AudioRenderSettingsSchema;
|
|
7
9
|
exports.BannedDomainRecordSchema = require_bannedDomain.BannedDomainRecordSchema;
|
|
8
10
|
exports.CaptchaRecordSchema = require_provider.CaptchaRecordSchema;
|
|
9
11
|
exports.ClientContextEntropyRecordSchema = require_provider.ClientContextEntropyRecordSchema;
|
|
@@ -13,6 +15,7 @@ exports.CompositeIpAddressRecordSchemaObj = require_provider.CompositeIpAddressR
|
|
|
13
15
|
exports.DatasetRecordSchema = require_provider.DatasetRecordSchema;
|
|
14
16
|
exports.DecisionMachineArtifactRecordSchema = require_provider.DecisionMachineArtifactRecordSchema;
|
|
15
17
|
exports.IPValidationRulesSchema = require_client.IPValidationRulesSchema;
|
|
18
|
+
exports.IconOrderCaptchaRecordSchema = require_provider.IconOrderCaptchaRecordSchema;
|
|
16
19
|
exports.PoWCaptchaRecordSchema = require_provider.PoWCaptchaRecordSchema;
|
|
17
20
|
exports.PuzzleCaptchaRecordSchema = require_provider.PuzzleCaptchaRecordSchema;
|
|
18
21
|
exports.PuzzleRenderSettingsSchema = require_client.PuzzleRenderSettingsSchema;
|
|
@@ -22,6 +25,8 @@ exports.ScheduledTaskSchema = require_provider.ScheduledTaskSchema;
|
|
|
22
25
|
exports.SessionRecordSchema = require_provider.SessionRecordSchema;
|
|
23
26
|
exports.SolutionRecordSchema = require_provider.SolutionRecordSchema;
|
|
24
27
|
exports.SpamEmailDomainRecordSchema = require_spamEmailDomain.SpamEmailDomainRecordSchema;
|
|
28
|
+
exports.StoredAudioCaptchaRecordSchema = require_captcha.StoredAudioCaptchaRecordSchema;
|
|
29
|
+
exports.StoredIconOrderCaptchaRecordSchema = require_captcha.StoredIconOrderCaptchaRecordSchema;
|
|
25
30
|
exports.StoredPoWCaptchaRecordSchema = require_captcha.StoredPoWCaptchaRecordSchema;
|
|
26
31
|
exports.StoredPuzzleCaptchaRecordSchema = require_captcha.StoredPuzzleCaptchaRecordSchema;
|
|
27
32
|
exports.StoredSessionRecordSchema = require_captcha.StoredSessionRecordSchema;
|
|
@@ -340,7 +340,12 @@ PoWCaptchaRecordSchema.index({ blocked: 1 }, {
|
|
|
340
340
|
name: "blocked_partial",
|
|
341
341
|
partialFilterExpression: { blocked: true }
|
|
342
342
|
});
|
|
343
|
-
|
|
343
|
+
/**
|
|
344
|
+
* Fields shared by every interactive captcha record. Kept in one place because
|
|
345
|
+
* the portal and audit views read them generically, so a field missed on one
|
|
346
|
+
* type shows up as an empty column rather than a compile error.
|
|
347
|
+
*/
|
|
348
|
+
var interactiveCaptchaRecordFields = {
|
|
344
349
|
challenge: {
|
|
345
350
|
type: String,
|
|
346
351
|
required: true
|
|
@@ -389,43 +394,6 @@ var PuzzleCaptchaRecordSchema = new mongoose.Schema({
|
|
|
389
394
|
required: false
|
|
390
395
|
}
|
|
391
396
|
},
|
|
392
|
-
targetX: {
|
|
393
|
-
type: Number,
|
|
394
|
-
required: true
|
|
395
|
-
},
|
|
396
|
-
targetY: {
|
|
397
|
-
type: Number,
|
|
398
|
-
required: true
|
|
399
|
-
},
|
|
400
|
-
originX: {
|
|
401
|
-
type: Number,
|
|
402
|
-
required: true
|
|
403
|
-
},
|
|
404
|
-
originY: {
|
|
405
|
-
type: Number,
|
|
406
|
-
required: true
|
|
407
|
-
},
|
|
408
|
-
tolerance: {
|
|
409
|
-
type: Number,
|
|
410
|
-
required: true
|
|
411
|
-
},
|
|
412
|
-
puzzleEvents: {
|
|
413
|
-
type: [new mongoose.Schema({
|
|
414
|
-
x: {
|
|
415
|
-
type: Number,
|
|
416
|
-
required: true
|
|
417
|
-
},
|
|
418
|
-
y: {
|
|
419
|
-
type: Number,
|
|
420
|
-
required: true
|
|
421
|
-
},
|
|
422
|
-
t: {
|
|
423
|
-
type: Number,
|
|
424
|
-
required: true
|
|
425
|
-
}
|
|
426
|
-
}, { _id: false })],
|
|
427
|
-
required: false
|
|
428
|
-
},
|
|
429
397
|
ipAddress: CompositeIpAddressRecordSchemaObj,
|
|
430
398
|
providedIp: {
|
|
431
399
|
type: new mongoose.Schema(CompositeIpAddressRecordSchemaObj, { _id: false }),
|
|
@@ -529,6 +497,43 @@ var PuzzleCaptchaRecordSchema = new mongoose.Schema({
|
|
|
529
497
|
providerSignature: {
|
|
530
498
|
type: String,
|
|
531
499
|
required: true
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
var pointerEventSchema = () => new mongoose.Schema({
|
|
503
|
+
x: {
|
|
504
|
+
type: Number,
|
|
505
|
+
required: true
|
|
506
|
+
},
|
|
507
|
+
y: {
|
|
508
|
+
type: Number,
|
|
509
|
+
required: true
|
|
510
|
+
},
|
|
511
|
+
t: {
|
|
512
|
+
type: Number,
|
|
513
|
+
required: true
|
|
514
|
+
}
|
|
515
|
+
}, { _id: false });
|
|
516
|
+
var PuzzleCaptchaRecordSchema = new mongoose.Schema({
|
|
517
|
+
...interactiveCaptchaRecordFields,
|
|
518
|
+
targetX: {
|
|
519
|
+
type: Number,
|
|
520
|
+
required: true
|
|
521
|
+
},
|
|
522
|
+
targetY: {
|
|
523
|
+
type: Number,
|
|
524
|
+
required: true
|
|
525
|
+
},
|
|
526
|
+
originX: {
|
|
527
|
+
type: Number,
|
|
528
|
+
required: true
|
|
529
|
+
},
|
|
530
|
+
originY: {
|
|
531
|
+
type: Number,
|
|
532
|
+
required: true
|
|
533
|
+
},
|
|
534
|
+
tolerance: {
|
|
535
|
+
type: Number,
|
|
536
|
+
required: true
|
|
532
537
|
},
|
|
533
538
|
render: {
|
|
534
539
|
type: new mongoose.Schema({
|
|
@@ -586,43 +591,125 @@ var PuzzleCaptchaRecordSchema = new mongoose.Schema({
|
|
|
586
591
|
}
|
|
587
592
|
}, { _id: false }),
|
|
588
593
|
required: false
|
|
594
|
+
},
|
|
595
|
+
puzzleEvents: {
|
|
596
|
+
type: [pointerEventSchema()],
|
|
597
|
+
required: false
|
|
589
598
|
}
|
|
590
599
|
});
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
}, {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
600
|
+
var IconOrderCaptchaRecordSchema = new mongoose.Schema({
|
|
601
|
+
...interactiveCaptchaRecordFields,
|
|
602
|
+
tolerance: {
|
|
603
|
+
type: Number,
|
|
604
|
+
required: true
|
|
605
|
+
},
|
|
606
|
+
targets: {
|
|
607
|
+
type: [new mongoose.Schema({
|
|
608
|
+
x: {
|
|
609
|
+
type: Number,
|
|
610
|
+
required: true
|
|
611
|
+
},
|
|
612
|
+
y: {
|
|
613
|
+
type: Number,
|
|
614
|
+
required: true
|
|
615
|
+
},
|
|
616
|
+
size: {
|
|
617
|
+
type: Number,
|
|
618
|
+
required: true
|
|
619
|
+
},
|
|
620
|
+
kind: {
|
|
621
|
+
type: String,
|
|
622
|
+
required: true
|
|
623
|
+
}
|
|
624
|
+
}, { _id: false })],
|
|
625
|
+
required: true
|
|
626
|
+
},
|
|
627
|
+
clicks: {
|
|
628
|
+
type: [new mongoose.Schema({
|
|
629
|
+
x: {
|
|
630
|
+
type: Number,
|
|
631
|
+
required: true
|
|
632
|
+
},
|
|
633
|
+
y: {
|
|
634
|
+
type: Number,
|
|
635
|
+
required: true
|
|
636
|
+
}
|
|
637
|
+
}, { _id: false })],
|
|
638
|
+
required: false
|
|
639
|
+
},
|
|
640
|
+
iconOrderEvents: {
|
|
641
|
+
type: [pointerEventSchema()],
|
|
642
|
+
required: false
|
|
620
643
|
}
|
|
621
644
|
});
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
645
|
+
var indexInteractiveCaptchaRecord = (schema) => {
|
|
646
|
+
schema.index({ challenge: 1 });
|
|
647
|
+
schema.index({ lastUpdatedTimestamp: 1 });
|
|
648
|
+
schema.index({
|
|
649
|
+
dappAccount: 1,
|
|
650
|
+
requestedAtTimestamp: 1
|
|
651
|
+
});
|
|
652
|
+
schema.index({ "ipAddress.lower": 1 });
|
|
653
|
+
schema.index({ "ipAddress.upper": 1 });
|
|
654
|
+
schema.index({ "result.reason": 1 });
|
|
655
|
+
schema.index({ "ipInfo.countryCode": 1 });
|
|
656
|
+
schema.index({ "ipInfo.isVPN": 1 });
|
|
657
|
+
schema.index({ ipInfo: 1 });
|
|
658
|
+
schema.index({ parsedUserAgentInfo: 1 });
|
|
659
|
+
schema.index({
|
|
660
|
+
pendingStage: 1,
|
|
661
|
+
_id: 1
|
|
662
|
+
}, {
|
|
663
|
+
name: "pendingStage_partial",
|
|
664
|
+
partialFilterExpression: { pendingStage: true }
|
|
665
|
+
});
|
|
666
|
+
schema.index({
|
|
667
|
+
dappAccount: 1,
|
|
668
|
+
"metadata.emailNormalised": 1,
|
|
669
|
+
serverChecked: 1
|
|
670
|
+
}, {
|
|
671
|
+
name: "spamEmailCount_partial",
|
|
672
|
+
partialFilterExpression: {
|
|
673
|
+
"metadata.emailNormalised": { $exists: true },
|
|
674
|
+
serverChecked: true
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
schema.index({ blocked: 1 }, {
|
|
678
|
+
name: "blocked_partial",
|
|
679
|
+
partialFilterExpression: { blocked: true }
|
|
680
|
+
});
|
|
681
|
+
};
|
|
682
|
+
var AudioCaptchaRecordSchema = new mongoose.Schema({
|
|
683
|
+
...interactiveCaptchaRecordFields,
|
|
684
|
+
answer: {
|
|
685
|
+
type: String,
|
|
686
|
+
required: true
|
|
687
|
+
},
|
|
688
|
+
submittedAnswer: {
|
|
689
|
+
type: String,
|
|
690
|
+
required: false
|
|
691
|
+
},
|
|
692
|
+
replays: {
|
|
693
|
+
type: Number,
|
|
694
|
+
required: false
|
|
695
|
+
},
|
|
696
|
+
audioEvents: {
|
|
697
|
+
type: [new mongoose.Schema({
|
|
698
|
+
kind: {
|
|
699
|
+
type: String,
|
|
700
|
+
required: true
|
|
701
|
+
},
|
|
702
|
+
t: {
|
|
703
|
+
type: Number,
|
|
704
|
+
required: true
|
|
705
|
+
}
|
|
706
|
+
}, { _id: false })],
|
|
707
|
+
required: false
|
|
708
|
+
}
|
|
625
709
|
});
|
|
710
|
+
indexInteractiveCaptchaRecord(PuzzleCaptchaRecordSchema);
|
|
711
|
+
indexInteractiveCaptchaRecord(IconOrderCaptchaRecordSchema);
|
|
712
|
+
indexInteractiveCaptchaRecord(AudioCaptchaRecordSchema);
|
|
626
713
|
var UserCommitmentRecordSchema = new mongoose.Schema({
|
|
627
714
|
userAccount: {
|
|
628
715
|
type: String,
|
|
@@ -1097,6 +1184,14 @@ var SessionRecordSchema = new mongoose.Schema({
|
|
|
1097
1184
|
type: Object,
|
|
1098
1185
|
required: false
|
|
1099
1186
|
},
|
|
1187
|
+
iconOrderTolerance: {
|
|
1188
|
+
type: Number,
|
|
1189
|
+
required: false
|
|
1190
|
+
},
|
|
1191
|
+
iconOrder: {
|
|
1192
|
+
type: Object,
|
|
1193
|
+
required: false
|
|
1194
|
+
},
|
|
1100
1195
|
puzzleLevel: {
|
|
1101
1196
|
type: Number,
|
|
1102
1197
|
required: false
|
|
@@ -1480,7 +1575,9 @@ var DecisionMachineArtifactRecordSchema = new mongoose.Schema({
|
|
|
1480
1575
|
enum: [
|
|
1481
1576
|
_prosopo_types.CaptchaType.pow,
|
|
1482
1577
|
_prosopo_types.CaptchaType.image,
|
|
1483
|
-
_prosopo_types.CaptchaType.puzzle
|
|
1578
|
+
_prosopo_types.CaptchaType.puzzle,
|
|
1579
|
+
_prosopo_types.CaptchaType.iconOrder,
|
|
1580
|
+
_prosopo_types.CaptchaType.audio
|
|
1484
1581
|
],
|
|
1485
1582
|
required: false
|
|
1486
1583
|
},
|
|
@@ -1589,6 +1686,8 @@ var SESSION_PROJECTION = {
|
|
|
1589
1686
|
solvedImagesCount: 1,
|
|
1590
1687
|
puzzleTolerance: 1,
|
|
1591
1688
|
puzzle: 1,
|
|
1689
|
+
iconOrderTolerance: 1,
|
|
1690
|
+
iconOrder: 1,
|
|
1592
1691
|
puzzleLevel: 1,
|
|
1593
1692
|
powDifficulty: 1,
|
|
1594
1693
|
ruleType: 1,
|
|
@@ -1647,6 +1746,7 @@ var SESSION_PROJECTION = {
|
|
|
1647
1746
|
"headers.x-tls-version": 1
|
|
1648
1747
|
};
|
|
1649
1748
|
//#endregion
|
|
1749
|
+
exports.AudioCaptchaRecordSchema = AudioCaptchaRecordSchema;
|
|
1650
1750
|
exports.CaptchaRecordSchema = CaptchaRecordSchema;
|
|
1651
1751
|
exports.ClientContextEntropyRecordSchema = ClientContextEntropyRecordSchema;
|
|
1652
1752
|
exports.ClientMetaDataRecordSchemaObj = ClientMetaDataRecordSchemaObj;
|
|
@@ -1654,6 +1754,7 @@ exports.ClientRecordSchema = ClientRecordSchema;
|
|
|
1654
1754
|
exports.CompositeIpAddressRecordSchemaObj = CompositeIpAddressRecordSchemaObj;
|
|
1655
1755
|
exports.DatasetRecordSchema = DatasetRecordSchema;
|
|
1656
1756
|
exports.DecisionMachineArtifactRecordSchema = DecisionMachineArtifactRecordSchema;
|
|
1757
|
+
exports.IconOrderCaptchaRecordSchema = IconOrderCaptchaRecordSchema;
|
|
1657
1758
|
exports.PoWCaptchaRecordSchema = PoWCaptchaRecordSchema;
|
|
1658
1759
|
exports.PuzzleCaptchaRecordSchema = PuzzleCaptchaRecordSchema;
|
|
1659
1760
|
exports.SESSION_PROJECTION = SESSION_PROJECTION;
|