@webdecoy/node 0.14.0 → 0.15.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.
@@ -2670,11 +2670,8 @@ function calculateLocalScore(suspiciousHeaders, missingSecCHUA, datacenterIP) {
2670
2670
  if (datacenterIP) score += 40;
2671
2671
  return Math.min(score, 100);
2672
2672
  }
2673
- function needsVerification(localScore, hasTLSInfo) {
2674
- if (hasTLSInfo) {
2675
- return true;
2676
- }
2677
- return localScore >= 30;
2673
+ function needsVerification(suspiciousHeaders, hasTLSInfo) {
2674
+ return hasTLSInfo || suspiciousHeaders;
2678
2675
  }
2679
2676
  function buildFlags(suspiciousHeaders, missingSecCHUA, datacenterIP, metadata) {
2680
2677
  const flags = [];
@@ -2702,7 +2699,7 @@ function analyzeRequest(metadata) {
2702
2699
  const datacenterIP = isDatacenterIP(metadata.ip);
2703
2700
  const localScore = calculateLocalScore(suspiciousHeaders, missingSecCHUA, datacenterIP);
2704
2701
  const hasTLSInfo = Boolean(metadata.tls_info);
2705
- const needsVerify = needsVerification(localScore, hasTLSInfo);
2702
+ const needsVerify = needsVerification(suspiciousHeaders, hasTLSInfo);
2706
2703
  const flags = buildFlags(suspiciousHeaders, missingSecCHUA, datacenterIP, metadata);
2707
2704
  return {
2708
2705
  suspicious_headers: suspiciousHeaders,
@@ -3182,7 +3179,7 @@ var WebDecoy = class {
3182
3179
  local_analysis: localAnalysis
3183
3180
  };
3184
3181
  const shouldCallServer = localAnalysis.needs_verification || this.config.enableTLSFingerprinting && metadata.tls_info;
3185
- if (!shouldCallServer && localAnalysis.local_score < 50) {
3182
+ if (!shouldCallServer) {
3186
3183
  return new Decision({
3187
3184
  conclusion: "ALLOW",
3188
3185
  detection: {
package/dist/index.js CHANGED
@@ -333,11 +333,8 @@ function calculateLocalScore(suspiciousHeaders, missingSecCHUA, datacenterIP) {
333
333
  if (datacenterIP) score += 40;
334
334
  return Math.min(score, 100);
335
335
  }
336
- function needsVerification(localScore, hasTLSInfo) {
337
- if (hasTLSInfo) {
338
- return true;
339
- }
340
- return localScore >= 30;
336
+ function needsVerification(suspiciousHeaders, hasTLSInfo) {
337
+ return hasTLSInfo || suspiciousHeaders;
341
338
  }
342
339
  function buildFlags(suspiciousHeaders, missingSecCHUA, datacenterIP, metadata) {
343
340
  const flags = [];
@@ -365,7 +362,7 @@ function analyzeRequest(metadata) {
365
362
  const datacenterIP = isDatacenterIP(metadata.ip);
366
363
  const localScore = calculateLocalScore(suspiciousHeaders, missingSecCHUA, datacenterIP);
367
364
  const hasTLSInfo = Boolean(metadata.tls_info);
368
- const needsVerify = needsVerification(localScore, hasTLSInfo);
365
+ const needsVerify = needsVerification(suspiciousHeaders, hasTLSInfo);
369
366
  const flags = buildFlags(suspiciousHeaders, missingSecCHUA, datacenterIP, metadata);
370
367
  return {
371
368
  suspicious_headers: suspiciousHeaders,
@@ -3286,7 +3283,7 @@ var WebDecoy = class {
3286
3283
  local_analysis: localAnalysis
3287
3284
  };
3288
3285
  const shouldCallServer = localAnalysis.needs_verification || this.config.enableTLSFingerprinting && metadata.tls_info;
3289
- if (!shouldCallServer && localAnalysis.local_score < 50) {
3286
+ if (!shouldCallServer) {
3290
3287
  return new Decision({
3291
3288
  conclusion: "ALLOW",
3292
3289
  detection: {
package/dist/index.mjs CHANGED
@@ -54,7 +54,7 @@ import {
54
54
  tripwire,
55
55
  upstashRateLimitStore,
56
56
  webBotAuth
57
- } from "./chunk-4QKKW7GN.mjs";
57
+ } from "./chunk-T6MX62T5.mjs";
58
58
 
59
59
  // src/client-ip.ts
60
60
  var IPV4 = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
package/dist/testing.js CHANGED
@@ -263,11 +263,8 @@ function calculateLocalScore(suspiciousHeaders, missingSecCHUA, datacenterIP) {
263
263
  if (datacenterIP) score += 40;
264
264
  return Math.min(score, 100);
265
265
  }
266
- function needsVerification(localScore, hasTLSInfo) {
267
- if (hasTLSInfo) {
268
- return true;
269
- }
270
- return localScore >= 30;
266
+ function needsVerification(suspiciousHeaders, hasTLSInfo) {
267
+ return hasTLSInfo || suspiciousHeaders;
271
268
  }
272
269
  function buildFlags(suspiciousHeaders, missingSecCHUA, datacenterIP, metadata) {
273
270
  const flags = [];
@@ -295,7 +292,7 @@ function analyzeRequest(metadata) {
295
292
  const datacenterIP = isDatacenterIP(metadata.ip);
296
293
  const localScore = calculateLocalScore(suspiciousHeaders, missingSecCHUA, datacenterIP);
297
294
  const hasTLSInfo = Boolean(metadata.tls_info);
298
- const needsVerify = needsVerification(localScore, hasTLSInfo);
295
+ const needsVerify = needsVerification(suspiciousHeaders, hasTLSInfo);
299
296
  const flags = buildFlags(suspiciousHeaders, missingSecCHUA, datacenterIP, metadata);
300
297
  return {
301
298
  suspicious_headers: suspiciousHeaders,
@@ -2029,7 +2026,7 @@ var WebDecoy = class {
2029
2026
  local_analysis: localAnalysis
2030
2027
  };
2031
2028
  const shouldCallServer = localAnalysis.needs_verification || this.config.enableTLSFingerprinting && metadata.tls_info;
2032
- if (!shouldCallServer && localAnalysis.local_score < 50) {
2029
+ if (!shouldCallServer) {
2033
2030
  return new Decision({
2034
2031
  conclusion: "ALLOW",
2035
2032
  detection: {
package/dist/testing.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  WebDecoy,
3
3
  silentLogger
4
- } from "./chunk-4QKKW7GN.mjs";
4
+ } from "./chunk-T6MX62T5.mjs";
5
5
 
6
6
  // src/testing.ts
7
7
  function request(over = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webdecoy/node",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Web Decoy SDK for Node.js - Bot detection with TLS fingerprinting",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",