@webdecoy/node 0.25.0 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-6EZSYRYE.mjs → chunk-5VMXAH64.mjs} +62 -60
- package/dist/index.js +62 -60
- package/dist/index.mjs +1 -1
- package/dist/vercel.js +62 -60
- package/dist/vercel.mjs +1 -1
- package/package.json +1 -1
|
@@ -209,7 +209,7 @@ async function ce(e, t) {
|
|
|
209
209
|
if (!t || t.length === 0) return { status: "unknown_key" };
|
|
210
210
|
let o, a;
|
|
211
211
|
try {
|
|
212
|
-
o = ft(r), a =
|
|
212
|
+
o = ft(r), a = dt(n);
|
|
213
213
|
} catch {
|
|
214
214
|
return { status: "invalid" };
|
|
215
215
|
}
|
|
@@ -225,21 +225,21 @@ async function ce(e, t) {
|
|
|
225
225
|
try {
|
|
226
226
|
h = it(e, c);
|
|
227
227
|
} catch {
|
|
228
|
-
s || (s = t.some((
|
|
228
|
+
s || (s = t.some((d) => d.keyid === l));
|
|
229
229
|
continue;
|
|
230
230
|
}
|
|
231
|
-
let
|
|
232
|
-
if (
|
|
231
|
+
let p = t.find((d) => {
|
|
232
|
+
if (d.keyid !== l) return false;
|
|
233
233
|
try {
|
|
234
|
-
return le(
|
|
234
|
+
return le(d.directory) === h;
|
|
235
235
|
} catch {
|
|
236
236
|
return false;
|
|
237
237
|
}
|
|
238
238
|
});
|
|
239
|
-
if (!
|
|
239
|
+
if (!p) continue;
|
|
240
240
|
s = true;
|
|
241
241
|
let w = Date.now() / 1e3, b = c.params.get("created"), g = c.params.get("expires");
|
|
242
|
-
if (typeof b != "number" || typeof g != "number" || w >= g + 10 || w + 10 < b || g <= b || g - b > 1440 * 60 || !c.components.some((
|
|
242
|
+
if (typeof b != "number" || typeof g != "number" || w >= g + 10 || w + 10 < b || g <= b || g - b > 1440 * 60 || !c.components.some((d) => d.name === "@authority" || d.name === "@target-uri")) continue;
|
|
243
243
|
let A;
|
|
244
244
|
try {
|
|
245
245
|
A = ct(e, c);
|
|
@@ -248,12 +248,12 @@ async function ce(e, t) {
|
|
|
248
248
|
}
|
|
249
249
|
let u = false;
|
|
250
250
|
try {
|
|
251
|
-
let
|
|
252
|
-
u = await crypto.subtle.verify({ name: "Ed25519" },
|
|
251
|
+
let d = await crypto.subtle.importKey("raw", pe(p.public_key), { name: "Ed25519" }, false, ["verify"]);
|
|
252
|
+
u = await crypto.subtle.verify({ name: "Ed25519" }, d, f, new TextEncoder().encode(A));
|
|
253
253
|
} catch {
|
|
254
254
|
u = false;
|
|
255
255
|
}
|
|
256
|
-
if (u) return { status: "verified", name:
|
|
256
|
+
if (u) return { status: "verified", name: p.name, category: p.category, keyid: l };
|
|
257
257
|
}
|
|
258
258
|
return s ? { status: "invalid" } : i ? { status: "unknown_key" } : { status: "none" };
|
|
259
259
|
}
|
|
@@ -266,7 +266,7 @@ function it(e, t) {
|
|
|
266
266
|
if (o.startsWith('"')) {
|
|
267
267
|
if (n.keyParam !== void 0) throw new Error("legacy string cannot select a member");
|
|
268
268
|
let i = new T(o);
|
|
269
|
-
if (a =
|
|
269
|
+
if (a = de(i), i.skipSP(), !i.eof()) throw new Error("trailing signature-agent data");
|
|
270
270
|
} else {
|
|
271
271
|
if (n.keyParam === void 0) throw new Error("dictionary member is not covered");
|
|
272
272
|
let i = B(o).find((c) => c.key === n.keyParam), s = i?.items[0];
|
|
@@ -326,7 +326,7 @@ function ft(e) {
|
|
|
326
326
|
return { label: r.key, components: n, params: r.params, raw: r.raw };
|
|
327
327
|
});
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function dt(e) {
|
|
330
330
|
let t = B(e), r = /* @__PURE__ */ new Map();
|
|
331
331
|
for (let n of t) {
|
|
332
332
|
if (n.isList || n.items.length !== 1) throw new Error(`Signature member ${n.key} is not a byte sequence`);
|
|
@@ -358,7 +358,7 @@ function B(e) {
|
|
|
358
358
|
if (!t.eof() && t.peek() === "=") {
|
|
359
359
|
t.i++;
|
|
360
360
|
let a = t.i;
|
|
361
|
-
if (!t.eof() && t.peek() === "(") o.isList = true,
|
|
361
|
+
if (!t.eof() && t.peek() === "(") o.isList = true, pt(t, o);
|
|
362
362
|
else {
|
|
363
363
|
let { value: i, params: s, hasParams: c, bytes: f } = ue(t);
|
|
364
364
|
o.items.push({ value: i, params: s, hasParams: c, ...f ? { bytes: f } : {} });
|
|
@@ -371,7 +371,7 @@ function B(e) {
|
|
|
371
371
|
}
|
|
372
372
|
return r;
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function pt(e, t) {
|
|
375
375
|
for (e.i++; ; ) {
|
|
376
376
|
if (e.skipSP(), e.eof()) throw new Error("unterminated inner list");
|
|
377
377
|
if (e.peek() === ")") {
|
|
@@ -412,7 +412,7 @@ function ge(e) {
|
|
|
412
412
|
}
|
|
413
413
|
function fe(e) {
|
|
414
414
|
let t = e.peek();
|
|
415
|
-
if (t === '"') return { value:
|
|
415
|
+
if (t === '"') return { value: de(e) };
|
|
416
416
|
if (t === ":") return { value: "", bytes: ht(e) };
|
|
417
417
|
if (t === "?") {
|
|
418
418
|
e.i++;
|
|
@@ -425,7 +425,7 @@ function fe(e) {
|
|
|
425
425
|
if (/[a-zA-Z*]/.test(t)) return { value: wt(e) };
|
|
426
426
|
throw new Error(`invalid bare item at ${e.i}`);
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function de(e) {
|
|
429
429
|
e.i++;
|
|
430
430
|
let t = "";
|
|
431
431
|
for (; !e.eof(); ) {
|
|
@@ -449,7 +449,7 @@ function ht(e) {
|
|
|
449
449
|
for (; !e.eof() && e.peek() !== ":"; ) e.i++;
|
|
450
450
|
if (e.eof()) throw new Error("unterminated byte sequence");
|
|
451
451
|
let r = e.s.slice(t, e.i);
|
|
452
|
-
return e.i++,
|
|
452
|
+
return e.i++, pe(r);
|
|
453
453
|
}
|
|
454
454
|
function mt(e) {
|
|
455
455
|
let t = e.i;
|
|
@@ -462,7 +462,7 @@ function wt(e) {
|
|
|
462
462
|
for (e.i++; !e.eof() && /[a-zA-Z0-9!#$%&'*+\-.^_`|~:/]/.test(e.peek()); ) e.i++;
|
|
463
463
|
return e.s.slice(t, e.i);
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function pe(e) {
|
|
466
466
|
let t = atob(e), r = new Uint8Array(new ArrayBuffer(t.length));
|
|
467
467
|
for (let n = 0; n < t.length; n++) r[n] = t.charCodeAt(n);
|
|
468
468
|
return r;
|
|
@@ -534,43 +534,43 @@ function O(e) {
|
|
|
534
534
|
return e.endsWith("/*") ? e.length - 2 : 1 << 20;
|
|
535
535
|
}
|
|
536
536
|
function be(e, t, r) {
|
|
537
|
-
let n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), a = [], i = [], s = /* @__PURE__ */ new Map(), c = (u,
|
|
537
|
+
let n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), a = [], i = [], s = /* @__PURE__ */ new Map(), c = (u, d) => {
|
|
538
538
|
let v = new Set(u);
|
|
539
|
-
for (let C of
|
|
539
|
+
for (let C of d) for (let _ of s.get(C) ?? []) v.add(_);
|
|
540
540
|
return v.size === 0 ? void 0 : [...v].sort();
|
|
541
|
-
}, f = (u,
|
|
541
|
+
}, f = (u, d, v) => v ? { pattern: u, required_trust: d, refused_behaviors: v } : { pattern: u, required_trust: d };
|
|
542
542
|
for (let u of t) {
|
|
543
543
|
if (!I(e, u.pattern)) continue;
|
|
544
544
|
if ((u.exceptions ?? []).some((C) => I(e, C))) {
|
|
545
545
|
i.push(u.pattern);
|
|
546
546
|
continue;
|
|
547
547
|
}
|
|
548
|
-
let
|
|
549
|
-
|
|
548
|
+
let d = n.get(u.pattern);
|
|
549
|
+
d === void 0 && a.push(u.pattern);
|
|
550
550
|
let v = bt(u.min_trust);
|
|
551
|
-
(
|
|
551
|
+
(d === void 0 || v > d) && n.set(u.pattern, v), u.mode !== "monitor" && o.add(u.pattern);
|
|
552
552
|
for (let C of u.refuse_behaviors ?? []) s.has(u.pattern) || s.set(u.pattern, /* @__PURE__ */ new Set()), s.get(u.pattern)?.add(C);
|
|
553
553
|
}
|
|
554
554
|
let l = [];
|
|
555
555
|
if (a.length === 0) {
|
|
556
556
|
let u = "";
|
|
557
|
-
for (let
|
|
557
|
+
for (let d of i) (u === "" || O(d) > O(u)) && (u = d);
|
|
558
558
|
return { covering: a, deciding_mode: "", attributed: "", required_trust: "", requirement_source: "", previews: l, excepted_by: u, refused_behaviors: [] };
|
|
559
559
|
}
|
|
560
|
-
a.sort((u,
|
|
561
|
-
let h = r === "monitor",
|
|
562
|
-
if (
|
|
560
|
+
a.sort((u, d) => O(d) - O(u));
|
|
561
|
+
let h = r === "monitor", p = a.filter((u) => o.has(u)), w = h ? "monitor" : "enforce";
|
|
562
|
+
if (p.length === 0) {
|
|
563
563
|
if (!h) for (let u of a) l.push(f(u, z(n.get(u) ?? 0), c([], [u])));
|
|
564
|
-
|
|
564
|
+
p = a, w = "monitor";
|
|
565
565
|
}
|
|
566
566
|
let b = 0, g = "";
|
|
567
|
-
for (let u of
|
|
568
|
-
let
|
|
569
|
-
|
|
567
|
+
for (let u of p) {
|
|
568
|
+
let d = n.get(u) ?? 0;
|
|
569
|
+
d > b && (b = d, g = u);
|
|
570
570
|
}
|
|
571
|
-
let A = c([],
|
|
571
|
+
let A = c([], p) ?? [];
|
|
572
572
|
if (w === "enforce") for (let u of a) o.has(u) || l.push(f(u, z(Math.max(b, n.get(u) ?? 0)), c(A, [u])));
|
|
573
|
-
return { covering: a, deciding_mode: w, attributed:
|
|
573
|
+
return { covering: a, deciding_mode: w, attributed: p[0], required_trust: z(b), requirement_source: g, previews: l, excepted_by: "", refused_behaviors: A };
|
|
574
574
|
}
|
|
575
575
|
var xt = "other";
|
|
576
576
|
var At = { "search engine crawler": "search", "ai search": "search", "ai assistant": "agent", "ai crawler": "training", "page preview": "link_preview", "feed fetcher": "feeds", "monitoring & analytics": "monitoring", "search engine optimization": "seo", security: "security_testing" };
|
|
@@ -602,9 +602,9 @@ function _e(e, t, r = []) {
|
|
|
602
602
|
return { pass: e.pass, label: e.label };
|
|
603
603
|
}
|
|
604
604
|
async function Ce(e, t, r) {
|
|
605
|
-
let n = new URL(e.url).pathname, o = be(n, Bt(t), t.mode), a = o.deciding_mode || t.mode, i = await Et(e, t, r, o.covering.length > 0, o.excepted_by !== ""), s = i.behavior ?? "", c = _e(i, o.required_trust, o.refused_behaviors), f = c.label === "excepted" ? o.excepted_by : c.label === "unscoped" ? "" : o.attributed, l = !c.pass && a === "enforce", h = o.previews.map((
|
|
606
|
-
let w = _e(i,
|
|
607
|
-
return { pattern:
|
|
605
|
+
let n = new URL(e.url).pathname, o = be(n, Bt(t), t.mode), a = o.deciding_mode || t.mode, i = await Et(e, t, r, o.covering.length > 0, o.excepted_by !== ""), s = i.behavior ?? "", c = _e(i, o.required_trust, o.refused_behaviors), f = c.label === "excepted" ? o.excepted_by : c.label === "unscoped" ? "" : o.attributed, l = !c.pass && a === "enforce", h = o.previews.map((p) => {
|
|
606
|
+
let w = _e(i, p.required_trust, p.refused_behaviors ?? []);
|
|
607
|
+
return { pattern: p.pattern, refused: !w.pass && !l ? w.label : "" };
|
|
608
608
|
});
|
|
609
609
|
return { pass: c.pass, label: c.label, pattern: f, mode: a, previews: h, behavior: c.pass ? s : "", crawlerBehavior: i.crawler?.behavior ?? "", referral: se(e, new URL(e.url)), outsideReach: i.outsideReach ?? "" };
|
|
610
610
|
}
|
|
@@ -947,19 +947,21 @@ function Zt(e, t) {
|
|
|
947
947
|
.spin { width: 2rem; height: 2rem; margin: 0 auto 1rem; border: 3px solid #2a2f3a;
|
|
948
948
|
border-top-color: #f90289; border-radius: 50%; animation: r 0.8s linear infinite; }
|
|
949
949
|
@keyframes r { to { transform: rotate(360deg); } }
|
|
950
|
+
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
|
|
950
951
|
p { color: #9aa4b2; font-size: 0.9rem; line-height: 1.5; }
|
|
951
|
-
.foot { margin-top: 2rem; font-size: 0.75rem; color: #
|
|
952
|
-
.foot a { color: #
|
|
952
|
+
.foot { margin-top: 2rem; font-size: 0.75rem; color: #9aa4b2; }
|
|
953
|
+
.foot a { color: #c9d1dc; text-decoration: underline; text-underline-offset: 0.15em; }
|
|
954
|
+
.foot a:focus-visible { outline: 2px solid #f90289; outline-offset: 3px; }
|
|
953
955
|
</style>
|
|
954
956
|
</head>
|
|
955
957
|
<body>
|
|
956
|
-
<
|
|
958
|
+
<main class="box" aria-labelledby="challenge-title" aria-describedby="msg">
|
|
957
959
|
<div class="brand"><img src="${Xt}" alt="" width="36" height="36">WebDecoy</div>
|
|
958
|
-
<div class="spin" id="spin"></div>
|
|
959
|
-
<h1 style="font-size:1.1rem">Checking your browser</h1>
|
|
960
|
-
<p id="msg">This takes a moment and happens only once.</p>
|
|
960
|
+
<div class="spin" id="spin" aria-hidden="true"></div>
|
|
961
|
+
<h1 id="challenge-title" style="font-size:1.1rem">Checking your browser</h1>
|
|
962
|
+
<p id="msg" role="status" aria-live="polite" aria-atomic="true">This takes a moment and happens only once.</p>
|
|
961
963
|
<p class="foot">This site is protected by <a href="https://webdecoy.com" rel="noopener">WebDecoy</a>.</p>
|
|
962
|
-
</
|
|
964
|
+
</main>
|
|
963
965
|
<script>
|
|
964
966
|
${Me}
|
|
965
967
|
(async function () {
|
|
@@ -1115,21 +1117,21 @@ function qe(e, t, r, n, o = Date.now()) {
|
|
|
1115
1117
|
try {
|
|
1116
1118
|
let a = e?.label ?? "", i = e?.mode ?? "", s = e?.pattern ?? "", c = e?.previews ?? [], f = e?.behavior ?? "", l = e?.crawlerBehavior ?? "", h = e?.outsideReach ?? "";
|
|
1117
1119
|
if (!a || !r || !r.siteKey || !r.apiBase) return;
|
|
1118
|
-
let
|
|
1119
|
-
if (!
|
|
1120
|
-
let w = Math.floor(o / 1e3 / ee) * ee, b = lr(w, i,
|
|
1120
|
+
let p = N(t);
|
|
1121
|
+
if (!p) return;
|
|
1122
|
+
let w = Math.floor(o / 1e3 / ee) * ee, b = lr(w, i, p);
|
|
1121
1123
|
for (let [m, y] of x) y.bucketStart !== w && (K(y, r, n), x.delete(m));
|
|
1122
1124
|
let g = x.get(b);
|
|
1123
1125
|
if (!g) {
|
|
1124
1126
|
if (x.size >= cr) for (let [m, y] of x) K(y, r, n), x.delete(m);
|
|
1125
|
-
g = { bucketStart: w, mode: i, host:
|
|
1127
|
+
g = { bucketStart: w, mode: i, host: p, counts: /* @__PURE__ */ new Map(), routes: /* @__PURE__ */ new Map(), previews: /* @__PURE__ */ new Map(), credentials: /* @__PURE__ */ new Map(), referrals: /* @__PURE__ */ new Map(), refusals: [], routeBytes: 0, total: 0 }, x.set(b, g), ur(b, g, r, n, o);
|
|
1126
1128
|
}
|
|
1127
1129
|
g.counts.set(a, (g.counts.get(a) ?? 0) + 1);
|
|
1128
|
-
let A = typeof s == "string" ? s : "", u = typeof f == "string" ? f : "",
|
|
1130
|
+
let A = typeof s == "string" ? s : "", u = typeof f == "string" ? f : "", d = typeof l == "string" ? l : "", v = `${A}
|
|
1129
1131
|
${a}
|
|
1130
1132
|
${u}
|
|
1131
|
-
${
|
|
1132
|
-
C ? C.count++ : (g.routes.set(v, { pattern: A, verdict: a, behavior: u, crawlerBehavior:
|
|
1133
|
+
${d}`, C = g.routes.get(v);
|
|
1134
|
+
C ? C.count++ : (g.routes.set(v, { pattern: A, verdict: a, behavior: u, crawlerBehavior: d, count: 1 }), g.routeBytes += k.encode(A).length + k.encode(a).length + k.encode(u).length + k.encode(d).length + je);
|
|
1133
1135
|
for (let m of Array.isArray(c) ? c : []) {
|
|
1134
1136
|
if (!m || typeof m.pattern != "string" || !m.pattern) continue;
|
|
1135
1137
|
let y = g.previews.get(m.pattern);
|
|
@@ -1175,22 +1177,22 @@ function K(e, t, r) {
|
|
|
1175
1177
|
let a = { organization_id: t.siteKey, bucket_start: e.bucketStart, mode: e.mode, counts: n, route_counts: o, report_id: crypto.randomUUID() };
|
|
1176
1178
|
if (e.previews.size > 0) {
|
|
1177
1179
|
let l = [];
|
|
1178
|
-
for (let [h,
|
|
1180
|
+
for (let [h, p] of e.previews) {
|
|
1179
1181
|
let w = {};
|
|
1180
|
-
for (let [b, g] of
|
|
1181
|
-
l.push({ pattern: h, evaluated:
|
|
1182
|
+
for (let [b, g] of p.refused) w[b] = g;
|
|
1183
|
+
l.push({ pattern: h, evaluated: p.evaluated, additional_refusals: w });
|
|
1182
1184
|
}
|
|
1183
1185
|
a.previews = l;
|
|
1184
1186
|
}
|
|
1185
1187
|
if (e.credentials.size > 0) {
|
|
1186
1188
|
let l = [];
|
|
1187
|
-
for (let [h,
|
|
1189
|
+
for (let [h, p] of e.credentials) l.push({ credential_id: h, outside_reach: p });
|
|
1188
1190
|
a.credential_presentations = l;
|
|
1189
1191
|
}
|
|
1190
1192
|
e.referrals.size > 0 && (a.ai_referrals = [...e.referrals.values()].map((l) => ({ platform: l.platform, path: l.path, count: l.count }))), t.propertyId && (a.property_id = t.propertyId), a.host = e.host, t.bundleVersion && (a.reporter_version = t.bundleVersion);
|
|
1191
1193
|
let i = !!(t.scannerId && t.sensorKey);
|
|
1192
1194
|
i && (a.scanner_id = t.scannerId), a.capabilities = t.capabilities ?? Fe;
|
|
1193
|
-
let s = i ? e.refusals : [], c = () =>
|
|
1195
|
+
let s = i ? e.refusals : [], c = () => dr(t.apiBase, JSON.stringify(a), i ? t.sensorKey : void 0), f = s.length === 0 ? c() : fr(t.siteKey, s).then((l) => {
|
|
1194
1196
|
a.refusals = l;
|
|
1195
1197
|
}).catch(() => {
|
|
1196
1198
|
}).then(c);
|
|
@@ -1210,7 +1212,7 @@ async function fr(e, t) {
|
|
|
1210
1212
|
for (let n of t) r.push({ k: await gr(e, n.ip, n.path), t: n.at, v: n.verdict });
|
|
1211
1213
|
return r;
|
|
1212
1214
|
}
|
|
1213
|
-
async function
|
|
1215
|
+
async function dr(e, t, r) {
|
|
1214
1216
|
let n = new AbortController(), o = setTimeout(() => n.abort(), ar), a = { "content-type": "application/json" };
|
|
1215
1217
|
r && (a["x-wd-sensor-key"] = r);
|
|
1216
1218
|
try {
|
|
@@ -1220,10 +1222,10 @@ async function pr(e, t, r) {
|
|
|
1220
1222
|
}
|
|
1221
1223
|
}
|
|
1222
1224
|
var G = ["route_min_trust", "route_attribution", "monitor_routes", "route_exceptions", "bot_behaviors", "credential_reach", "bot_verification_rdns", "crawler_behavior", "ai_referrals"];
|
|
1223
|
-
var
|
|
1225
|
+
var pr = [{ category: "search_engines", suffixes: [".googlebot.com", ".google.com", ".search.msn.com", ".crawl.yahoo.net", ".applebot.apple.com", ".yandex.com", ".yandex.net", ".yandex.ru", ".crawl.baidu.com", ".crawl.baidu.jp"] }];
|
|
1224
1226
|
function hr(e, t) {
|
|
1225
1227
|
let r = e.toLowerCase().replace(/\.$/, "");
|
|
1226
|
-
for (let n of
|
|
1228
|
+
for (let n of pr) if (t[n.category]) {
|
|
1227
1229
|
for (let o of n.suffixes) if (r.endsWith(o)) return n.category;
|
|
1228
1230
|
}
|
|
1229
1231
|
return null;
|
|
@@ -1303,7 +1305,7 @@ function Er(e = fetch) {
|
|
|
1303
1305
|
function Qe(e, t, r, n = fetch) {
|
|
1304
1306
|
return Ze(e, t, r, Er(n));
|
|
1305
1307
|
}
|
|
1306
|
-
var ne = "vercel-
|
|
1308
|
+
var ne = "vercel-6ab5f7596055";
|
|
1307
1309
|
var et = "https://in.webdecoy.com";
|
|
1308
1310
|
function tt(e) {
|
|
1309
1311
|
let t = new Headers(e.headers);
|
package/dist/index.js
CHANGED
|
@@ -4248,7 +4248,7 @@ async function ce(e, t) {
|
|
|
4248
4248
|
if (!t || t.length === 0) return { status: "unknown_key" };
|
|
4249
4249
|
let o, a;
|
|
4250
4250
|
try {
|
|
4251
|
-
o = ft(r), a =
|
|
4251
|
+
o = ft(r), a = dt(n);
|
|
4252
4252
|
} catch {
|
|
4253
4253
|
return { status: "invalid" };
|
|
4254
4254
|
}
|
|
@@ -4264,21 +4264,21 @@ async function ce(e, t) {
|
|
|
4264
4264
|
try {
|
|
4265
4265
|
h = it(e, c);
|
|
4266
4266
|
} catch {
|
|
4267
|
-
s || (s = t.some((
|
|
4267
|
+
s || (s = t.some((d) => d.keyid === l));
|
|
4268
4268
|
continue;
|
|
4269
4269
|
}
|
|
4270
|
-
let
|
|
4271
|
-
if (
|
|
4270
|
+
let p = t.find((d) => {
|
|
4271
|
+
if (d.keyid !== l) return false;
|
|
4272
4272
|
try {
|
|
4273
|
-
return le(
|
|
4273
|
+
return le(d.directory) === h;
|
|
4274
4274
|
} catch {
|
|
4275
4275
|
return false;
|
|
4276
4276
|
}
|
|
4277
4277
|
});
|
|
4278
|
-
if (!
|
|
4278
|
+
if (!p) continue;
|
|
4279
4279
|
s = true;
|
|
4280
4280
|
let w = Date.now() / 1e3, b = c.params.get("created"), g = c.params.get("expires");
|
|
4281
|
-
if (typeof b != "number" || typeof g != "number" || w >= g + 10 || w + 10 < b || g <= b || g - b > 1440 * 60 || !c.components.some((
|
|
4281
|
+
if (typeof b != "number" || typeof g != "number" || w >= g + 10 || w + 10 < b || g <= b || g - b > 1440 * 60 || !c.components.some((d) => d.name === "@authority" || d.name === "@target-uri")) continue;
|
|
4282
4282
|
let A;
|
|
4283
4283
|
try {
|
|
4284
4284
|
A = ct(e, c);
|
|
@@ -4287,12 +4287,12 @@ async function ce(e, t) {
|
|
|
4287
4287
|
}
|
|
4288
4288
|
let u = false;
|
|
4289
4289
|
try {
|
|
4290
|
-
let
|
|
4291
|
-
u = await crypto.subtle.verify({ name: "Ed25519" },
|
|
4290
|
+
let d = await crypto.subtle.importKey("raw", pe(p.public_key), { name: "Ed25519" }, false, ["verify"]);
|
|
4291
|
+
u = await crypto.subtle.verify({ name: "Ed25519" }, d, f, new TextEncoder().encode(A));
|
|
4292
4292
|
} catch {
|
|
4293
4293
|
u = false;
|
|
4294
4294
|
}
|
|
4295
|
-
if (u) return { status: "verified", name:
|
|
4295
|
+
if (u) return { status: "verified", name: p.name, category: p.category, keyid: l };
|
|
4296
4296
|
}
|
|
4297
4297
|
return s ? { status: "invalid" } : i ? { status: "unknown_key" } : { status: "none" };
|
|
4298
4298
|
}
|
|
@@ -4305,7 +4305,7 @@ function it(e, t) {
|
|
|
4305
4305
|
if (o.startsWith('"')) {
|
|
4306
4306
|
if (n.keyParam !== void 0) throw new Error("legacy string cannot select a member");
|
|
4307
4307
|
let i = new T(o);
|
|
4308
|
-
if (a =
|
|
4308
|
+
if (a = de(i), i.skipSP(), !i.eof()) throw new Error("trailing signature-agent data");
|
|
4309
4309
|
} else {
|
|
4310
4310
|
if (n.keyParam === void 0) throw new Error("dictionary member is not covered");
|
|
4311
4311
|
let i = B(o).find((c) => c.key === n.keyParam), s = i?.items[0];
|
|
@@ -4365,7 +4365,7 @@ function ft(e) {
|
|
|
4365
4365
|
return { label: r.key, components: n, params: r.params, raw: r.raw };
|
|
4366
4366
|
});
|
|
4367
4367
|
}
|
|
4368
|
-
function
|
|
4368
|
+
function dt(e) {
|
|
4369
4369
|
let t = B(e), r = /* @__PURE__ */ new Map();
|
|
4370
4370
|
for (let n of t) {
|
|
4371
4371
|
if (n.isList || n.items.length !== 1) throw new Error(`Signature member ${n.key} is not a byte sequence`);
|
|
@@ -4397,7 +4397,7 @@ function B(e) {
|
|
|
4397
4397
|
if (!t.eof() && t.peek() === "=") {
|
|
4398
4398
|
t.i++;
|
|
4399
4399
|
let a = t.i;
|
|
4400
|
-
if (!t.eof() && t.peek() === "(") o.isList = true,
|
|
4400
|
+
if (!t.eof() && t.peek() === "(") o.isList = true, pt(t, o);
|
|
4401
4401
|
else {
|
|
4402
4402
|
let { value: i, params: s, hasParams: c, bytes: f } = ue(t);
|
|
4403
4403
|
o.items.push({ value: i, params: s, hasParams: c, ...f ? { bytes: f } : {} });
|
|
@@ -4410,7 +4410,7 @@ function B(e) {
|
|
|
4410
4410
|
}
|
|
4411
4411
|
return r;
|
|
4412
4412
|
}
|
|
4413
|
-
function
|
|
4413
|
+
function pt(e, t) {
|
|
4414
4414
|
for (e.i++; ; ) {
|
|
4415
4415
|
if (e.skipSP(), e.eof()) throw new Error("unterminated inner list");
|
|
4416
4416
|
if (e.peek() === ")") {
|
|
@@ -4451,7 +4451,7 @@ function ge(e) {
|
|
|
4451
4451
|
}
|
|
4452
4452
|
function fe(e) {
|
|
4453
4453
|
let t = e.peek();
|
|
4454
|
-
if (t === '"') return { value:
|
|
4454
|
+
if (t === '"') return { value: de(e) };
|
|
4455
4455
|
if (t === ":") return { value: "", bytes: ht(e) };
|
|
4456
4456
|
if (t === "?") {
|
|
4457
4457
|
e.i++;
|
|
@@ -4464,7 +4464,7 @@ function fe(e) {
|
|
|
4464
4464
|
if (/[a-zA-Z*]/.test(t)) return { value: wt(e) };
|
|
4465
4465
|
throw new Error(`invalid bare item at ${e.i}`);
|
|
4466
4466
|
}
|
|
4467
|
-
function
|
|
4467
|
+
function de(e) {
|
|
4468
4468
|
e.i++;
|
|
4469
4469
|
let t = "";
|
|
4470
4470
|
for (; !e.eof(); ) {
|
|
@@ -4488,7 +4488,7 @@ function ht(e) {
|
|
|
4488
4488
|
for (; !e.eof() && e.peek() !== ":"; ) e.i++;
|
|
4489
4489
|
if (e.eof()) throw new Error("unterminated byte sequence");
|
|
4490
4490
|
let r = e.s.slice(t, e.i);
|
|
4491
|
-
return e.i++,
|
|
4491
|
+
return e.i++, pe(r);
|
|
4492
4492
|
}
|
|
4493
4493
|
function mt(e) {
|
|
4494
4494
|
let t = e.i;
|
|
@@ -4501,7 +4501,7 @@ function wt(e) {
|
|
|
4501
4501
|
for (e.i++; !e.eof() && /[a-zA-Z0-9!#$%&'*+\-.^_`|~:/]/.test(e.peek()); ) e.i++;
|
|
4502
4502
|
return e.s.slice(t, e.i);
|
|
4503
4503
|
}
|
|
4504
|
-
function
|
|
4504
|
+
function pe(e) {
|
|
4505
4505
|
let t = atob(e), r = new Uint8Array(new ArrayBuffer(t.length));
|
|
4506
4506
|
for (let n = 0; n < t.length; n++) r[n] = t.charCodeAt(n);
|
|
4507
4507
|
return r;
|
|
@@ -4573,43 +4573,43 @@ function O(e) {
|
|
|
4573
4573
|
return e.endsWith("/*") ? e.length - 2 : 1 << 20;
|
|
4574
4574
|
}
|
|
4575
4575
|
function be(e, t, r) {
|
|
4576
|
-
let n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), a = [], i = [], s = /* @__PURE__ */ new Map(), c = (u,
|
|
4576
|
+
let n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), a = [], i = [], s = /* @__PURE__ */ new Map(), c = (u, d) => {
|
|
4577
4577
|
let v = new Set(u);
|
|
4578
|
-
for (let C of
|
|
4578
|
+
for (let C of d) for (let _ of s.get(C) ?? []) v.add(_);
|
|
4579
4579
|
return v.size === 0 ? void 0 : [...v].sort();
|
|
4580
|
-
}, f = (u,
|
|
4580
|
+
}, f = (u, d, v) => v ? { pattern: u, required_trust: d, refused_behaviors: v } : { pattern: u, required_trust: d };
|
|
4581
4581
|
for (let u of t) {
|
|
4582
4582
|
if (!I(e, u.pattern)) continue;
|
|
4583
4583
|
if ((u.exceptions ?? []).some((C) => I(e, C))) {
|
|
4584
4584
|
i.push(u.pattern);
|
|
4585
4585
|
continue;
|
|
4586
4586
|
}
|
|
4587
|
-
let
|
|
4588
|
-
|
|
4587
|
+
let d = n.get(u.pattern);
|
|
4588
|
+
d === void 0 && a.push(u.pattern);
|
|
4589
4589
|
let v = bt(u.min_trust);
|
|
4590
|
-
(
|
|
4590
|
+
(d === void 0 || v > d) && n.set(u.pattern, v), u.mode !== "monitor" && o.add(u.pattern);
|
|
4591
4591
|
for (let C of u.refuse_behaviors ?? []) s.has(u.pattern) || s.set(u.pattern, /* @__PURE__ */ new Set()), s.get(u.pattern)?.add(C);
|
|
4592
4592
|
}
|
|
4593
4593
|
let l = [];
|
|
4594
4594
|
if (a.length === 0) {
|
|
4595
4595
|
let u = "";
|
|
4596
|
-
for (let
|
|
4596
|
+
for (let d of i) (u === "" || O(d) > O(u)) && (u = d);
|
|
4597
4597
|
return { covering: a, deciding_mode: "", attributed: "", required_trust: "", requirement_source: "", previews: l, excepted_by: u, refused_behaviors: [] };
|
|
4598
4598
|
}
|
|
4599
|
-
a.sort((u,
|
|
4600
|
-
let h = r === "monitor",
|
|
4601
|
-
if (
|
|
4599
|
+
a.sort((u, d) => O(d) - O(u));
|
|
4600
|
+
let h = r === "monitor", p = a.filter((u) => o.has(u)), w = h ? "monitor" : "enforce";
|
|
4601
|
+
if (p.length === 0) {
|
|
4602
4602
|
if (!h) for (let u of a) l.push(f(u, z(n.get(u) ?? 0), c([], [u])));
|
|
4603
|
-
|
|
4603
|
+
p = a, w = "monitor";
|
|
4604
4604
|
}
|
|
4605
4605
|
let b = 0, g = "";
|
|
4606
|
-
for (let u of
|
|
4607
|
-
let
|
|
4608
|
-
|
|
4606
|
+
for (let u of p) {
|
|
4607
|
+
let d = n.get(u) ?? 0;
|
|
4608
|
+
d > b && (b = d, g = u);
|
|
4609
4609
|
}
|
|
4610
|
-
let A = c([],
|
|
4610
|
+
let A = c([], p) ?? [];
|
|
4611
4611
|
if (w === "enforce") for (let u of a) o.has(u) || l.push(f(u, z(Math.max(b, n.get(u) ?? 0)), c(A, [u])));
|
|
4612
|
-
return { covering: a, deciding_mode: w, attributed:
|
|
4612
|
+
return { covering: a, deciding_mode: w, attributed: p[0], required_trust: z(b), requirement_source: g, previews: l, excepted_by: "", refused_behaviors: A };
|
|
4613
4613
|
}
|
|
4614
4614
|
var xt = "other";
|
|
4615
4615
|
var At = { "search engine crawler": "search", "ai search": "search", "ai assistant": "agent", "ai crawler": "training", "page preview": "link_preview", "feed fetcher": "feeds", "monitoring & analytics": "monitoring", "search engine optimization": "seo", security: "security_testing" };
|
|
@@ -4641,9 +4641,9 @@ function _e(e, t, r = []) {
|
|
|
4641
4641
|
return { pass: e.pass, label: e.label };
|
|
4642
4642
|
}
|
|
4643
4643
|
async function Ce(e, t, r) {
|
|
4644
|
-
let n = new URL(e.url).pathname, o = be(n, Bt(t), t.mode), a = o.deciding_mode || t.mode, i = await Et(e, t, r, o.covering.length > 0, o.excepted_by !== ""), s = i.behavior ?? "", c = _e(i, o.required_trust, o.refused_behaviors), f = c.label === "excepted" ? o.excepted_by : c.label === "unscoped" ? "" : o.attributed, l = !c.pass && a === "enforce", h = o.previews.map((
|
|
4645
|
-
let w = _e(i,
|
|
4646
|
-
return { pattern:
|
|
4644
|
+
let n = new URL(e.url).pathname, o = be(n, Bt(t), t.mode), a = o.deciding_mode || t.mode, i = await Et(e, t, r, o.covering.length > 0, o.excepted_by !== ""), s = i.behavior ?? "", c = _e(i, o.required_trust, o.refused_behaviors), f = c.label === "excepted" ? o.excepted_by : c.label === "unscoped" ? "" : o.attributed, l = !c.pass && a === "enforce", h = o.previews.map((p) => {
|
|
4645
|
+
let w = _e(i, p.required_trust, p.refused_behaviors ?? []);
|
|
4646
|
+
return { pattern: p.pattern, refused: !w.pass && !l ? w.label : "" };
|
|
4647
4647
|
});
|
|
4648
4648
|
return { pass: c.pass, label: c.label, pattern: f, mode: a, previews: h, behavior: c.pass ? s : "", crawlerBehavior: i.crawler?.behavior ?? "", referral: se(e, new URL(e.url)), outsideReach: i.outsideReach ?? "" };
|
|
4649
4649
|
}
|
|
@@ -4986,19 +4986,21 @@ function Zt(e, t) {
|
|
|
4986
4986
|
.spin { width: 2rem; height: 2rem; margin: 0 auto 1rem; border: 3px solid #2a2f3a;
|
|
4987
4987
|
border-top-color: #f90289; border-radius: 50%; animation: r 0.8s linear infinite; }
|
|
4988
4988
|
@keyframes r { to { transform: rotate(360deg); } }
|
|
4989
|
+
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
|
|
4989
4990
|
p { color: #9aa4b2; font-size: 0.9rem; line-height: 1.5; }
|
|
4990
|
-
.foot { margin-top: 2rem; font-size: 0.75rem; color: #
|
|
4991
|
-
.foot a { color: #
|
|
4991
|
+
.foot { margin-top: 2rem; font-size: 0.75rem; color: #9aa4b2; }
|
|
4992
|
+
.foot a { color: #c9d1dc; text-decoration: underline; text-underline-offset: 0.15em; }
|
|
4993
|
+
.foot a:focus-visible { outline: 2px solid #f90289; outline-offset: 3px; }
|
|
4992
4994
|
</style>
|
|
4993
4995
|
</head>
|
|
4994
4996
|
<body>
|
|
4995
|
-
<
|
|
4997
|
+
<main class="box" aria-labelledby="challenge-title" aria-describedby="msg">
|
|
4996
4998
|
<div class="brand"><img src="${Xt}" alt="" width="36" height="36">WebDecoy</div>
|
|
4997
|
-
<div class="spin" id="spin"></div>
|
|
4998
|
-
<h1 style="font-size:1.1rem">Checking your browser</h1>
|
|
4999
|
-
<p id="msg">This takes a moment and happens only once.</p>
|
|
4999
|
+
<div class="spin" id="spin" aria-hidden="true"></div>
|
|
5000
|
+
<h1 id="challenge-title" style="font-size:1.1rem">Checking your browser</h1>
|
|
5001
|
+
<p id="msg" role="status" aria-live="polite" aria-atomic="true">This takes a moment and happens only once.</p>
|
|
5000
5002
|
<p class="foot">This site is protected by <a href="https://webdecoy.com" rel="noopener">WebDecoy</a>.</p>
|
|
5001
|
-
</
|
|
5003
|
+
</main>
|
|
5002
5004
|
<script>
|
|
5003
5005
|
${Me}
|
|
5004
5006
|
(async function () {
|
|
@@ -5154,21 +5156,21 @@ function qe(e, t, r, n, o = Date.now()) {
|
|
|
5154
5156
|
try {
|
|
5155
5157
|
let a = e?.label ?? "", i = e?.mode ?? "", s = e?.pattern ?? "", c = e?.previews ?? [], f = e?.behavior ?? "", l = e?.crawlerBehavior ?? "", h = e?.outsideReach ?? "";
|
|
5156
5158
|
if (!a || !r || !r.siteKey || !r.apiBase) return;
|
|
5157
|
-
let
|
|
5158
|
-
if (!
|
|
5159
|
-
let w = Math.floor(o / 1e3 / ee) * ee, b = lr(w, i,
|
|
5159
|
+
let p = N(t);
|
|
5160
|
+
if (!p) return;
|
|
5161
|
+
let w = Math.floor(o / 1e3 / ee) * ee, b = lr(w, i, p);
|
|
5160
5162
|
for (let [m, y] of x) y.bucketStart !== w && (K(y, r, n), x.delete(m));
|
|
5161
5163
|
let g = x.get(b);
|
|
5162
5164
|
if (!g) {
|
|
5163
5165
|
if (x.size >= cr) for (let [m, y] of x) K(y, r, n), x.delete(m);
|
|
5164
|
-
g = { bucketStart: w, mode: i, host:
|
|
5166
|
+
g = { bucketStart: w, mode: i, host: p, counts: /* @__PURE__ */ new Map(), routes: /* @__PURE__ */ new Map(), previews: /* @__PURE__ */ new Map(), credentials: /* @__PURE__ */ new Map(), referrals: /* @__PURE__ */ new Map(), refusals: [], routeBytes: 0, total: 0 }, x.set(b, g), ur(b, g, r, n, o);
|
|
5165
5167
|
}
|
|
5166
5168
|
g.counts.set(a, (g.counts.get(a) ?? 0) + 1);
|
|
5167
|
-
let A = typeof s == "string" ? s : "", u = typeof f == "string" ? f : "",
|
|
5169
|
+
let A = typeof s == "string" ? s : "", u = typeof f == "string" ? f : "", d = typeof l == "string" ? l : "", v = `${A}
|
|
5168
5170
|
${a}
|
|
5169
5171
|
${u}
|
|
5170
|
-
${
|
|
5171
|
-
C ? C.count++ : (g.routes.set(v, { pattern: A, verdict: a, behavior: u, crawlerBehavior:
|
|
5172
|
+
${d}`, C = g.routes.get(v);
|
|
5173
|
+
C ? C.count++ : (g.routes.set(v, { pattern: A, verdict: a, behavior: u, crawlerBehavior: d, count: 1 }), g.routeBytes += k.encode(A).length + k.encode(a).length + k.encode(u).length + k.encode(d).length + je);
|
|
5172
5174
|
for (let m of Array.isArray(c) ? c : []) {
|
|
5173
5175
|
if (!m || typeof m.pattern != "string" || !m.pattern) continue;
|
|
5174
5176
|
let y = g.previews.get(m.pattern);
|
|
@@ -5214,22 +5216,22 @@ function K(e, t, r) {
|
|
|
5214
5216
|
let a = { organization_id: t.siteKey, bucket_start: e.bucketStart, mode: e.mode, counts: n, route_counts: o, report_id: crypto.randomUUID() };
|
|
5215
5217
|
if (e.previews.size > 0) {
|
|
5216
5218
|
let l = [];
|
|
5217
|
-
for (let [h,
|
|
5219
|
+
for (let [h, p] of e.previews) {
|
|
5218
5220
|
let w = {};
|
|
5219
|
-
for (let [b, g] of
|
|
5220
|
-
l.push({ pattern: h, evaluated:
|
|
5221
|
+
for (let [b, g] of p.refused) w[b] = g;
|
|
5222
|
+
l.push({ pattern: h, evaluated: p.evaluated, additional_refusals: w });
|
|
5221
5223
|
}
|
|
5222
5224
|
a.previews = l;
|
|
5223
5225
|
}
|
|
5224
5226
|
if (e.credentials.size > 0) {
|
|
5225
5227
|
let l = [];
|
|
5226
|
-
for (let [h,
|
|
5228
|
+
for (let [h, p] of e.credentials) l.push({ credential_id: h, outside_reach: p });
|
|
5227
5229
|
a.credential_presentations = l;
|
|
5228
5230
|
}
|
|
5229
5231
|
e.referrals.size > 0 && (a.ai_referrals = [...e.referrals.values()].map((l) => ({ platform: l.platform, path: l.path, count: l.count }))), t.propertyId && (a.property_id = t.propertyId), a.host = e.host, t.bundleVersion && (a.reporter_version = t.bundleVersion);
|
|
5230
5232
|
let i = !!(t.scannerId && t.sensorKey);
|
|
5231
5233
|
i && (a.scanner_id = t.scannerId), a.capabilities = t.capabilities ?? Fe;
|
|
5232
|
-
let s = i ? e.refusals : [], c = () =>
|
|
5234
|
+
let s = i ? e.refusals : [], c = () => dr(t.apiBase, JSON.stringify(a), i ? t.sensorKey : void 0), f = s.length === 0 ? c() : fr(t.siteKey, s).then((l) => {
|
|
5233
5235
|
a.refusals = l;
|
|
5234
5236
|
}).catch(() => {
|
|
5235
5237
|
}).then(c);
|
|
@@ -5249,7 +5251,7 @@ async function fr(e, t) {
|
|
|
5249
5251
|
for (let n of t) r.push({ k: await gr(e, n.ip, n.path), t: n.at, v: n.verdict });
|
|
5250
5252
|
return r;
|
|
5251
5253
|
}
|
|
5252
|
-
async function
|
|
5254
|
+
async function dr(e, t, r) {
|
|
5253
5255
|
let n = new AbortController(), o = setTimeout(() => n.abort(), ar), a = { "content-type": "application/json" };
|
|
5254
5256
|
r && (a["x-wd-sensor-key"] = r);
|
|
5255
5257
|
try {
|
|
@@ -5259,10 +5261,10 @@ async function pr(e, t, r) {
|
|
|
5259
5261
|
}
|
|
5260
5262
|
}
|
|
5261
5263
|
var G = ["route_min_trust", "route_attribution", "monitor_routes", "route_exceptions", "bot_behaviors", "credential_reach", "bot_verification_rdns", "crawler_behavior", "ai_referrals"];
|
|
5262
|
-
var
|
|
5264
|
+
var pr = [{ category: "search_engines", suffixes: [".googlebot.com", ".google.com", ".search.msn.com", ".crawl.yahoo.net", ".applebot.apple.com", ".yandex.com", ".yandex.net", ".yandex.ru", ".crawl.baidu.com", ".crawl.baidu.jp"] }];
|
|
5263
5265
|
function hr(e, t) {
|
|
5264
5266
|
let r = e.toLowerCase().replace(/\.$/, "");
|
|
5265
|
-
for (let n of
|
|
5267
|
+
for (let n of pr) if (t[n.category]) {
|
|
5266
5268
|
for (let o of n.suffixes) if (r.endsWith(o)) return n.category;
|
|
5267
5269
|
}
|
|
5268
5270
|
return null;
|
|
@@ -5342,7 +5344,7 @@ function Er(e = fetch) {
|
|
|
5342
5344
|
function Qe(e, t, r, n = fetch) {
|
|
5343
5345
|
return Ze(e, t, r, Er(n));
|
|
5344
5346
|
}
|
|
5345
|
-
var ne = "vercel-
|
|
5347
|
+
var ne = "vercel-6ab5f7596055";
|
|
5346
5348
|
var et = "https://in.webdecoy.com";
|
|
5347
5349
|
function tt(e) {
|
|
5348
5350
|
let t = new Headers(e.headers);
|
package/dist/index.mjs
CHANGED
package/dist/vercel.js
CHANGED
|
@@ -83,7 +83,7 @@ async function ce(e, t) {
|
|
|
83
83
|
if (!t || t.length === 0) return { status: "unknown_key" };
|
|
84
84
|
let o, a;
|
|
85
85
|
try {
|
|
86
|
-
o = ft(r), a =
|
|
86
|
+
o = ft(r), a = dt(n);
|
|
87
87
|
} catch {
|
|
88
88
|
return { status: "invalid" };
|
|
89
89
|
}
|
|
@@ -99,21 +99,21 @@ async function ce(e, t) {
|
|
|
99
99
|
try {
|
|
100
100
|
h = it(e, c);
|
|
101
101
|
} catch {
|
|
102
|
-
s || (s = t.some((
|
|
102
|
+
s || (s = t.some((d) => d.keyid === l));
|
|
103
103
|
continue;
|
|
104
104
|
}
|
|
105
|
-
let
|
|
106
|
-
if (
|
|
105
|
+
let p = t.find((d) => {
|
|
106
|
+
if (d.keyid !== l) return false;
|
|
107
107
|
try {
|
|
108
|
-
return le(
|
|
108
|
+
return le(d.directory) === h;
|
|
109
109
|
} catch {
|
|
110
110
|
return false;
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
-
if (!
|
|
113
|
+
if (!p) continue;
|
|
114
114
|
s = true;
|
|
115
115
|
let w = Date.now() / 1e3, b = c.params.get("created"), g = c.params.get("expires");
|
|
116
|
-
if (typeof b != "number" || typeof g != "number" || w >= g + 10 || w + 10 < b || g <= b || g - b > 1440 * 60 || !c.components.some((
|
|
116
|
+
if (typeof b != "number" || typeof g != "number" || w >= g + 10 || w + 10 < b || g <= b || g - b > 1440 * 60 || !c.components.some((d) => d.name === "@authority" || d.name === "@target-uri")) continue;
|
|
117
117
|
let A;
|
|
118
118
|
try {
|
|
119
119
|
A = ct(e, c);
|
|
@@ -122,12 +122,12 @@ async function ce(e, t) {
|
|
|
122
122
|
}
|
|
123
123
|
let u = false;
|
|
124
124
|
try {
|
|
125
|
-
let
|
|
126
|
-
u = await crypto.subtle.verify({ name: "Ed25519" },
|
|
125
|
+
let d = await crypto.subtle.importKey("raw", pe(p.public_key), { name: "Ed25519" }, false, ["verify"]);
|
|
126
|
+
u = await crypto.subtle.verify({ name: "Ed25519" }, d, f, new TextEncoder().encode(A));
|
|
127
127
|
} catch {
|
|
128
128
|
u = false;
|
|
129
129
|
}
|
|
130
|
-
if (u) return { status: "verified", name:
|
|
130
|
+
if (u) return { status: "verified", name: p.name, category: p.category, keyid: l };
|
|
131
131
|
}
|
|
132
132
|
return s ? { status: "invalid" } : i ? { status: "unknown_key" } : { status: "none" };
|
|
133
133
|
}
|
|
@@ -140,7 +140,7 @@ function it(e, t) {
|
|
|
140
140
|
if (o.startsWith('"')) {
|
|
141
141
|
if (n.keyParam !== void 0) throw new Error("legacy string cannot select a member");
|
|
142
142
|
let i = new T(o);
|
|
143
|
-
if (a =
|
|
143
|
+
if (a = de(i), i.skipSP(), !i.eof()) throw new Error("trailing signature-agent data");
|
|
144
144
|
} else {
|
|
145
145
|
if (n.keyParam === void 0) throw new Error("dictionary member is not covered");
|
|
146
146
|
let i = B(o).find((c) => c.key === n.keyParam), s = i?.items[0];
|
|
@@ -200,7 +200,7 @@ function ft(e) {
|
|
|
200
200
|
return { label: r.key, components: n, params: r.params, raw: r.raw };
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function dt(e) {
|
|
204
204
|
let t = B(e), r = /* @__PURE__ */ new Map();
|
|
205
205
|
for (let n of t) {
|
|
206
206
|
if (n.isList || n.items.length !== 1) throw new Error(`Signature member ${n.key} is not a byte sequence`);
|
|
@@ -232,7 +232,7 @@ function B(e) {
|
|
|
232
232
|
if (!t.eof() && t.peek() === "=") {
|
|
233
233
|
t.i++;
|
|
234
234
|
let a = t.i;
|
|
235
|
-
if (!t.eof() && t.peek() === "(") o.isList = true,
|
|
235
|
+
if (!t.eof() && t.peek() === "(") o.isList = true, pt(t, o);
|
|
236
236
|
else {
|
|
237
237
|
let { value: i, params: s, hasParams: c, bytes: f } = ue(t);
|
|
238
238
|
o.items.push({ value: i, params: s, hasParams: c, ...f ? { bytes: f } : {} });
|
|
@@ -245,7 +245,7 @@ function B(e) {
|
|
|
245
245
|
}
|
|
246
246
|
return r;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function pt(e, t) {
|
|
249
249
|
for (e.i++; ; ) {
|
|
250
250
|
if (e.skipSP(), e.eof()) throw new Error("unterminated inner list");
|
|
251
251
|
if (e.peek() === ")") {
|
|
@@ -286,7 +286,7 @@ function ge(e) {
|
|
|
286
286
|
}
|
|
287
287
|
function fe(e) {
|
|
288
288
|
let t = e.peek();
|
|
289
|
-
if (t === '"') return { value:
|
|
289
|
+
if (t === '"') return { value: de(e) };
|
|
290
290
|
if (t === ":") return { value: "", bytes: ht(e) };
|
|
291
291
|
if (t === "?") {
|
|
292
292
|
e.i++;
|
|
@@ -299,7 +299,7 @@ function fe(e) {
|
|
|
299
299
|
if (/[a-zA-Z*]/.test(t)) return { value: wt(e) };
|
|
300
300
|
throw new Error(`invalid bare item at ${e.i}`);
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function de(e) {
|
|
303
303
|
e.i++;
|
|
304
304
|
let t = "";
|
|
305
305
|
for (; !e.eof(); ) {
|
|
@@ -323,7 +323,7 @@ function ht(e) {
|
|
|
323
323
|
for (; !e.eof() && e.peek() !== ":"; ) e.i++;
|
|
324
324
|
if (e.eof()) throw new Error("unterminated byte sequence");
|
|
325
325
|
let r = e.s.slice(t, e.i);
|
|
326
|
-
return e.i++,
|
|
326
|
+
return e.i++, pe(r);
|
|
327
327
|
}
|
|
328
328
|
function mt(e) {
|
|
329
329
|
let t = e.i;
|
|
@@ -336,7 +336,7 @@ function wt(e) {
|
|
|
336
336
|
for (e.i++; !e.eof() && /[a-zA-Z0-9!#$%&'*+\-.^_`|~:/]/.test(e.peek()); ) e.i++;
|
|
337
337
|
return e.s.slice(t, e.i);
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function pe(e) {
|
|
340
340
|
let t = atob(e), r = new Uint8Array(new ArrayBuffer(t.length));
|
|
341
341
|
for (let n = 0; n < t.length; n++) r[n] = t.charCodeAt(n);
|
|
342
342
|
return r;
|
|
@@ -408,43 +408,43 @@ function O(e) {
|
|
|
408
408
|
return e.endsWith("/*") ? e.length - 2 : 1 << 20;
|
|
409
409
|
}
|
|
410
410
|
function be(e, t, r) {
|
|
411
|
-
let n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), a = [], i = [], s = /* @__PURE__ */ new Map(), c = (u,
|
|
411
|
+
let n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), a = [], i = [], s = /* @__PURE__ */ new Map(), c = (u, d) => {
|
|
412
412
|
let v = new Set(u);
|
|
413
|
-
for (let C of
|
|
413
|
+
for (let C of d) for (let _ of s.get(C) ?? []) v.add(_);
|
|
414
414
|
return v.size === 0 ? void 0 : [...v].sort();
|
|
415
|
-
}, f = (u,
|
|
415
|
+
}, f = (u, d, v) => v ? { pattern: u, required_trust: d, refused_behaviors: v } : { pattern: u, required_trust: d };
|
|
416
416
|
for (let u of t) {
|
|
417
417
|
if (!I(e, u.pattern)) continue;
|
|
418
418
|
if ((u.exceptions ?? []).some((C) => I(e, C))) {
|
|
419
419
|
i.push(u.pattern);
|
|
420
420
|
continue;
|
|
421
421
|
}
|
|
422
|
-
let
|
|
423
|
-
|
|
422
|
+
let d = n.get(u.pattern);
|
|
423
|
+
d === void 0 && a.push(u.pattern);
|
|
424
424
|
let v = bt(u.min_trust);
|
|
425
|
-
(
|
|
425
|
+
(d === void 0 || v > d) && n.set(u.pattern, v), u.mode !== "monitor" && o.add(u.pattern);
|
|
426
426
|
for (let C of u.refuse_behaviors ?? []) s.has(u.pattern) || s.set(u.pattern, /* @__PURE__ */ new Set()), s.get(u.pattern)?.add(C);
|
|
427
427
|
}
|
|
428
428
|
let l = [];
|
|
429
429
|
if (a.length === 0) {
|
|
430
430
|
let u = "";
|
|
431
|
-
for (let
|
|
431
|
+
for (let d of i) (u === "" || O(d) > O(u)) && (u = d);
|
|
432
432
|
return { covering: a, deciding_mode: "", attributed: "", required_trust: "", requirement_source: "", previews: l, excepted_by: u, refused_behaviors: [] };
|
|
433
433
|
}
|
|
434
|
-
a.sort((u,
|
|
435
|
-
let h = r === "monitor",
|
|
436
|
-
if (
|
|
434
|
+
a.sort((u, d) => O(d) - O(u));
|
|
435
|
+
let h = r === "monitor", p = a.filter((u) => o.has(u)), w = h ? "monitor" : "enforce";
|
|
436
|
+
if (p.length === 0) {
|
|
437
437
|
if (!h) for (let u of a) l.push(f(u, z(n.get(u) ?? 0), c([], [u])));
|
|
438
|
-
|
|
438
|
+
p = a, w = "monitor";
|
|
439
439
|
}
|
|
440
440
|
let b = 0, g = "";
|
|
441
|
-
for (let u of
|
|
442
|
-
let
|
|
443
|
-
|
|
441
|
+
for (let u of p) {
|
|
442
|
+
let d = n.get(u) ?? 0;
|
|
443
|
+
d > b && (b = d, g = u);
|
|
444
444
|
}
|
|
445
|
-
let A = c([],
|
|
445
|
+
let A = c([], p) ?? [];
|
|
446
446
|
if (w === "enforce") for (let u of a) o.has(u) || l.push(f(u, z(Math.max(b, n.get(u) ?? 0)), c(A, [u])));
|
|
447
|
-
return { covering: a, deciding_mode: w, attributed:
|
|
447
|
+
return { covering: a, deciding_mode: w, attributed: p[0], required_trust: z(b), requirement_source: g, previews: l, excepted_by: "", refused_behaviors: A };
|
|
448
448
|
}
|
|
449
449
|
var xt = "other";
|
|
450
450
|
var At = { "search engine crawler": "search", "ai search": "search", "ai assistant": "agent", "ai crawler": "training", "page preview": "link_preview", "feed fetcher": "feeds", "monitoring & analytics": "monitoring", "search engine optimization": "seo", security: "security_testing" };
|
|
@@ -476,9 +476,9 @@ function _e(e, t, r = []) {
|
|
|
476
476
|
return { pass: e.pass, label: e.label };
|
|
477
477
|
}
|
|
478
478
|
async function Ce(e, t, r) {
|
|
479
|
-
let n = new URL(e.url).pathname, o = be(n, Bt(t), t.mode), a = o.deciding_mode || t.mode, i = await Et(e, t, r, o.covering.length > 0, o.excepted_by !== ""), s = i.behavior ?? "", c = _e(i, o.required_trust, o.refused_behaviors), f = c.label === "excepted" ? o.excepted_by : c.label === "unscoped" ? "" : o.attributed, l = !c.pass && a === "enforce", h = o.previews.map((
|
|
480
|
-
let w = _e(i,
|
|
481
|
-
return { pattern:
|
|
479
|
+
let n = new URL(e.url).pathname, o = be(n, Bt(t), t.mode), a = o.deciding_mode || t.mode, i = await Et(e, t, r, o.covering.length > 0, o.excepted_by !== ""), s = i.behavior ?? "", c = _e(i, o.required_trust, o.refused_behaviors), f = c.label === "excepted" ? o.excepted_by : c.label === "unscoped" ? "" : o.attributed, l = !c.pass && a === "enforce", h = o.previews.map((p) => {
|
|
480
|
+
let w = _e(i, p.required_trust, p.refused_behaviors ?? []);
|
|
481
|
+
return { pattern: p.pattern, refused: !w.pass && !l ? w.label : "" };
|
|
482
482
|
});
|
|
483
483
|
return { pass: c.pass, label: c.label, pattern: f, mode: a, previews: h, behavior: c.pass ? s : "", crawlerBehavior: i.crawler?.behavior ?? "", referral: se(e, new URL(e.url)), outsideReach: i.outsideReach ?? "" };
|
|
484
484
|
}
|
|
@@ -821,19 +821,21 @@ function Zt(e, t) {
|
|
|
821
821
|
.spin { width: 2rem; height: 2rem; margin: 0 auto 1rem; border: 3px solid #2a2f3a;
|
|
822
822
|
border-top-color: #f90289; border-radius: 50%; animation: r 0.8s linear infinite; }
|
|
823
823
|
@keyframes r { to { transform: rotate(360deg); } }
|
|
824
|
+
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
|
|
824
825
|
p { color: #9aa4b2; font-size: 0.9rem; line-height: 1.5; }
|
|
825
|
-
.foot { margin-top: 2rem; font-size: 0.75rem; color: #
|
|
826
|
-
.foot a { color: #
|
|
826
|
+
.foot { margin-top: 2rem; font-size: 0.75rem; color: #9aa4b2; }
|
|
827
|
+
.foot a { color: #c9d1dc; text-decoration: underline; text-underline-offset: 0.15em; }
|
|
828
|
+
.foot a:focus-visible { outline: 2px solid #f90289; outline-offset: 3px; }
|
|
827
829
|
</style>
|
|
828
830
|
</head>
|
|
829
831
|
<body>
|
|
830
|
-
<
|
|
832
|
+
<main class="box" aria-labelledby="challenge-title" aria-describedby="msg">
|
|
831
833
|
<div class="brand"><img src="${Xt}" alt="" width="36" height="36">WebDecoy</div>
|
|
832
|
-
<div class="spin" id="spin"></div>
|
|
833
|
-
<h1 style="font-size:1.1rem">Checking your browser</h1>
|
|
834
|
-
<p id="msg">This takes a moment and happens only once.</p>
|
|
834
|
+
<div class="spin" id="spin" aria-hidden="true"></div>
|
|
835
|
+
<h1 id="challenge-title" style="font-size:1.1rem">Checking your browser</h1>
|
|
836
|
+
<p id="msg" role="status" aria-live="polite" aria-atomic="true">This takes a moment and happens only once.</p>
|
|
835
837
|
<p class="foot">This site is protected by <a href="https://webdecoy.com" rel="noopener">WebDecoy</a>.</p>
|
|
836
|
-
</
|
|
838
|
+
</main>
|
|
837
839
|
<script>
|
|
838
840
|
${Me}
|
|
839
841
|
(async function () {
|
|
@@ -989,21 +991,21 @@ function qe(e, t, r, n, o = Date.now()) {
|
|
|
989
991
|
try {
|
|
990
992
|
let a = e?.label ?? "", i = e?.mode ?? "", s = e?.pattern ?? "", c = e?.previews ?? [], f = e?.behavior ?? "", l = e?.crawlerBehavior ?? "", h = e?.outsideReach ?? "";
|
|
991
993
|
if (!a || !r || !r.siteKey || !r.apiBase) return;
|
|
992
|
-
let
|
|
993
|
-
if (!
|
|
994
|
-
let w = Math.floor(o / 1e3 / ee) * ee, b = lr(w, i,
|
|
994
|
+
let p = N(t);
|
|
995
|
+
if (!p) return;
|
|
996
|
+
let w = Math.floor(o / 1e3 / ee) * ee, b = lr(w, i, p);
|
|
995
997
|
for (let [m, y] of x) y.bucketStart !== w && (K(y, r, n), x.delete(m));
|
|
996
998
|
let g = x.get(b);
|
|
997
999
|
if (!g) {
|
|
998
1000
|
if (x.size >= cr) for (let [m, y] of x) K(y, r, n), x.delete(m);
|
|
999
|
-
g = { bucketStart: w, mode: i, host:
|
|
1001
|
+
g = { bucketStart: w, mode: i, host: p, counts: /* @__PURE__ */ new Map(), routes: /* @__PURE__ */ new Map(), previews: /* @__PURE__ */ new Map(), credentials: /* @__PURE__ */ new Map(), referrals: /* @__PURE__ */ new Map(), refusals: [], routeBytes: 0, total: 0 }, x.set(b, g), ur(b, g, r, n, o);
|
|
1000
1002
|
}
|
|
1001
1003
|
g.counts.set(a, (g.counts.get(a) ?? 0) + 1);
|
|
1002
|
-
let A = typeof s == "string" ? s : "", u = typeof f == "string" ? f : "",
|
|
1004
|
+
let A = typeof s == "string" ? s : "", u = typeof f == "string" ? f : "", d = typeof l == "string" ? l : "", v = `${A}
|
|
1003
1005
|
${a}
|
|
1004
1006
|
${u}
|
|
1005
|
-
${
|
|
1006
|
-
C ? C.count++ : (g.routes.set(v, { pattern: A, verdict: a, behavior: u, crawlerBehavior:
|
|
1007
|
+
${d}`, C = g.routes.get(v);
|
|
1008
|
+
C ? C.count++ : (g.routes.set(v, { pattern: A, verdict: a, behavior: u, crawlerBehavior: d, count: 1 }), g.routeBytes += k.encode(A).length + k.encode(a).length + k.encode(u).length + k.encode(d).length + je);
|
|
1007
1009
|
for (let m of Array.isArray(c) ? c : []) {
|
|
1008
1010
|
if (!m || typeof m.pattern != "string" || !m.pattern) continue;
|
|
1009
1011
|
let y = g.previews.get(m.pattern);
|
|
@@ -1049,22 +1051,22 @@ function K(e, t, r) {
|
|
|
1049
1051
|
let a = { organization_id: t.siteKey, bucket_start: e.bucketStart, mode: e.mode, counts: n, route_counts: o, report_id: crypto.randomUUID() };
|
|
1050
1052
|
if (e.previews.size > 0) {
|
|
1051
1053
|
let l = [];
|
|
1052
|
-
for (let [h,
|
|
1054
|
+
for (let [h, p] of e.previews) {
|
|
1053
1055
|
let w = {};
|
|
1054
|
-
for (let [b, g] of
|
|
1055
|
-
l.push({ pattern: h, evaluated:
|
|
1056
|
+
for (let [b, g] of p.refused) w[b] = g;
|
|
1057
|
+
l.push({ pattern: h, evaluated: p.evaluated, additional_refusals: w });
|
|
1056
1058
|
}
|
|
1057
1059
|
a.previews = l;
|
|
1058
1060
|
}
|
|
1059
1061
|
if (e.credentials.size > 0) {
|
|
1060
1062
|
let l = [];
|
|
1061
|
-
for (let [h,
|
|
1063
|
+
for (let [h, p] of e.credentials) l.push({ credential_id: h, outside_reach: p });
|
|
1062
1064
|
a.credential_presentations = l;
|
|
1063
1065
|
}
|
|
1064
1066
|
e.referrals.size > 0 && (a.ai_referrals = [...e.referrals.values()].map((l) => ({ platform: l.platform, path: l.path, count: l.count }))), t.propertyId && (a.property_id = t.propertyId), a.host = e.host, t.bundleVersion && (a.reporter_version = t.bundleVersion);
|
|
1065
1067
|
let i = !!(t.scannerId && t.sensorKey);
|
|
1066
1068
|
i && (a.scanner_id = t.scannerId), a.capabilities = t.capabilities ?? Fe;
|
|
1067
|
-
let s = i ? e.refusals : [], c = () =>
|
|
1069
|
+
let s = i ? e.refusals : [], c = () => dr(t.apiBase, JSON.stringify(a), i ? t.sensorKey : void 0), f = s.length === 0 ? c() : fr(t.siteKey, s).then((l) => {
|
|
1068
1070
|
a.refusals = l;
|
|
1069
1071
|
}).catch(() => {
|
|
1070
1072
|
}).then(c);
|
|
@@ -1084,7 +1086,7 @@ async function fr(e, t) {
|
|
|
1084
1086
|
for (let n of t) r.push({ k: await gr(e, n.ip, n.path), t: n.at, v: n.verdict });
|
|
1085
1087
|
return r;
|
|
1086
1088
|
}
|
|
1087
|
-
async function
|
|
1089
|
+
async function dr(e, t, r) {
|
|
1088
1090
|
let n = new AbortController(), o = setTimeout(() => n.abort(), ar), a = { "content-type": "application/json" };
|
|
1089
1091
|
r && (a["x-wd-sensor-key"] = r);
|
|
1090
1092
|
try {
|
|
@@ -1094,10 +1096,10 @@ async function pr(e, t, r) {
|
|
|
1094
1096
|
}
|
|
1095
1097
|
}
|
|
1096
1098
|
var G = ["route_min_trust", "route_attribution", "monitor_routes", "route_exceptions", "bot_behaviors", "credential_reach", "bot_verification_rdns", "crawler_behavior", "ai_referrals"];
|
|
1097
|
-
var
|
|
1099
|
+
var pr = [{ category: "search_engines", suffixes: [".googlebot.com", ".google.com", ".search.msn.com", ".crawl.yahoo.net", ".applebot.apple.com", ".yandex.com", ".yandex.net", ".yandex.ru", ".crawl.baidu.com", ".crawl.baidu.jp"] }];
|
|
1098
1100
|
function hr(e, t) {
|
|
1099
1101
|
let r = e.toLowerCase().replace(/\.$/, "");
|
|
1100
|
-
for (let n of
|
|
1102
|
+
for (let n of pr) if (t[n.category]) {
|
|
1101
1103
|
for (let o of n.suffixes) if (r.endsWith(o)) return n.category;
|
|
1102
1104
|
}
|
|
1103
1105
|
return null;
|
|
@@ -1177,7 +1179,7 @@ function Er(e = fetch) {
|
|
|
1177
1179
|
function Qe(e, t, r, n = fetch) {
|
|
1178
1180
|
return Ze(e, t, r, Er(n));
|
|
1179
1181
|
}
|
|
1180
|
-
var ne = "vercel-
|
|
1182
|
+
var ne = "vercel-6ab5f7596055";
|
|
1181
1183
|
var et = "https://in.webdecoy.com";
|
|
1182
1184
|
function tt(e) {
|
|
1183
1185
|
let t = new Headers(e.headers);
|
package/dist/vercel.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webdecoy/node",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.1",
|
|
4
4
|
"description": "Bot detection and AI agent verification for Node.js and edge runtimes. Local honeypot tripwires, rate limiting and AI crawler policies, with optional WebDecoy dashboard reporting.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|