@mcpjam/inspector 3.12.7 → 3.12.8
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/client/assets/{OAuthDesktopReturnNotice-DUuacpVO.js → OAuthDesktopReturnNotice-DABzFg0y.js} +2 -2
- package/dist/client/assets/{app-bootstrap-DiOYsEwh.js → app-bootstrap-C2vVITe1.js} +11 -11
- package/dist/client/assets/{button-F4pHUjYC.js → button-CR0c6NYb.js} +2 -2
- package/dist/client/assets/{chunk-YOKDWASO-B2XCf4h4.js → chunk-YOKDWASO-C2OuyPZY.js} +5 -5
- package/dist/client/assets/{dead-clicks-autocapture-BAMovRYs.js → dead-clicks-autocapture-DuT1rKSM.js} +2 -2
- package/dist/client/assets/{error-reporting-BrfSwhO1.js → error-reporting-CpBaShLK.js} +3 -3
- package/dist/client/assets/{error-reporting-CWlEVH2b.js → error-reporting-DGKAyE3H.js} +1 -1
- package/dist/client/assets/{exception-autocapture-D5Eikj0K.js → exception-autocapture-DDYbbF4x.js} +2 -2
- package/dist/client/assets/{failed-request-tracker-CYWaDq0H.js → failed-request-tracker-DTcEBfel.js} +2 -2
- package/dist/client/assets/{highlighted-body-KPVGNVTW-BjkaxPPc.js → highlighted-body-KPVGNVTW-BTjtAEXQ.js} +2 -2
- package/dist/client/assets/{index-B-8CVYYi.js → index-Cp_KMvUf.js} +3 -3
- package/dist/client/assets/{jszip.min-BtiG5GuL.js → jszip.min-CUbyF_hU.js} +2 -2
- package/dist/client/assets/{mermaid-HWGCJPDP-CYPKMbVd.js → mermaid-HWGCJPDP-CmCtP4Dv.js} +1 -1
- package/dist/client/assets/{posthog-recorder-D-Nq98cg.js → posthog-recorder-D05rTwSB.js} +2 -2
- package/dist/client/assets/{preload-helper-CC679xXH.js → preload-helper-Bbq9_x_H.js} +2 -2
- package/dist/client/assets/{rolldown-runtime-1PqeXL0B.js → rolldown-runtime-DFaaNfet.js} +1 -1
- package/dist/client/assets/{surveys-olC_pHGU.js → surveys-C6jQxZ__.js} +2 -2
- package/dist/client/assets/{trace-timeline-D2FsrVpF.js → trace-timeline-B4-o8QjE.js} +1 -1
- package/dist/client/assets/{trace-timeline-fl51h9sN.js → trace-timeline-DuWo46vf.js} +2 -2
- package/dist/client/assets/{web-vitals-CIP57d68.js → web-vitals-DGvwJdv7.js} +2 -2
- package/dist/client/index.html +6 -6
- package/dist/server/{chunk-FQTRKEDA.js → chunk-ER75CVTG.js} +2 -2
- package/dist/server/{chunk-76PAQUEP.js → chunk-HHMYIKER.js} +2 -2
- package/dist/server/harness-install-cli.js +1 -1
- package/dist/server/index.js +110 -49
- package/dist/server/{local-turn-3DH4OF7C.js → local-turn-SXHFOZVA.js} +3 -3
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
stopLocalHarnessProject,
|
|
29
29
|
stopLocalHarnessWorkspace,
|
|
30
30
|
validateWorkspaceCandidate
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ER75CVTG.js";
|
|
32
32
|
import {
|
|
33
33
|
LOCAL_HARNESS_MANIFEST,
|
|
34
34
|
LOCAL_HARNESS_POLICY_VERSION,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
runtimeInstallRoot,
|
|
58
58
|
startRuntimeInstall,
|
|
59
59
|
supportsOwnershipProof
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-HHMYIKER.js";
|
|
61
61
|
import {
|
|
62
62
|
BROWSER_CONSENT_HEADER,
|
|
63
63
|
createBrowserConsentLifetime,
|
|
@@ -89334,7 +89334,7 @@ function getActiveTunnelDomains() {
|
|
|
89334
89334
|
}
|
|
89335
89335
|
|
|
89336
89336
|
// server/utils/guest-spend-ip.ts
|
|
89337
|
-
import { isIP, isIPv4, isIPv6 } from "net";
|
|
89337
|
+
import { isIP as isIP2, isIPv4, isIPv6 } from "net";
|
|
89338
89338
|
|
|
89339
89339
|
// server/utils/local-secret-store.ts
|
|
89340
89340
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
@@ -89400,6 +89400,7 @@ function getGuestSessionHashPepper() {
|
|
|
89400
89400
|
|
|
89401
89401
|
// server/utils/client-ip.ts
|
|
89402
89402
|
import { timingSafeEqual as timingSafeEqual3 } from "crypto";
|
|
89403
|
+
import { isIP } from "net";
|
|
89403
89404
|
import { getConnInfo } from "@hono/node-server/conninfo";
|
|
89404
89405
|
function getClientIp(c) {
|
|
89405
89406
|
const cfConnectingIp = c.req.header("cf-connecting-ip")?.trim();
|
|
@@ -89445,6 +89446,34 @@ function getAttestedClientIp(c) {
|
|
|
89445
89446
|
}
|
|
89446
89447
|
return null;
|
|
89447
89448
|
}
|
|
89449
|
+
function ipRateLimitKey(ip) {
|
|
89450
|
+
const address = ip.trim();
|
|
89451
|
+
if (isIP(address) !== 6) return address;
|
|
89452
|
+
const groups = ipv6Groups(address.split("%")[0]);
|
|
89453
|
+
if (groups.slice(0, 6).join(":") === "0:0:0:0:0:65535") {
|
|
89454
|
+
const [high, low] = groups.slice(6);
|
|
89455
|
+
return [high >> 8, high & 255, low >> 8, low & 255].join(".");
|
|
89456
|
+
}
|
|
89457
|
+
const prefix = groups.slice(0, 4).map((group) => group.toString(16));
|
|
89458
|
+
return `${prefix.join(":")}::/64`;
|
|
89459
|
+
}
|
|
89460
|
+
function ipv6Groups(address) {
|
|
89461
|
+
const v4Tail = /(\d+)\.(\d+)\.(\d+)\.(\d+)$/.exec(address);
|
|
89462
|
+
let text2 = address;
|
|
89463
|
+
if (v4Tail) {
|
|
89464
|
+
const [a, b, c, d] = v4Tail.slice(1).map(Number);
|
|
89465
|
+
const high = (a << 8 | b).toString(16);
|
|
89466
|
+
const low = (c << 8 | d).toString(16);
|
|
89467
|
+
text2 = `${address.slice(0, v4Tail.index)}${high}:${low}`;
|
|
89468
|
+
}
|
|
89469
|
+
const parse3 = (part) => part === "" ? [] : part.split(":").map((group) => parseInt(group, 16));
|
|
89470
|
+
const [head, tail] = text2.split("::");
|
|
89471
|
+
const left = parse3(head);
|
|
89472
|
+
if (tail === void 0) return left;
|
|
89473
|
+
const right = parse3(tail);
|
|
89474
|
+
const zeros = new Array(8 - left.length - right.length).fill(0);
|
|
89475
|
+
return [...left, ...zeros, ...right];
|
|
89476
|
+
}
|
|
89448
89477
|
|
|
89449
89478
|
// server/utils/guest-spend-ip.ts
|
|
89450
89479
|
var SCOPE = "guest-spend-ip";
|
|
@@ -89496,7 +89525,7 @@ function canonicalizeClientIp(rawIp) {
|
|
|
89496
89525
|
return null;
|
|
89497
89526
|
}
|
|
89498
89527
|
}
|
|
89499
|
-
return
|
|
89528
|
+
return isIP2(trimmed) ? trimmed.toLowerCase() : null;
|
|
89500
89529
|
}
|
|
89501
89530
|
async function hashGuestSpendIp(rawIp) {
|
|
89502
89531
|
const canonical4 = canonicalizeClientIp(rawIp);
|
|
@@ -92547,7 +92576,7 @@ async function sweepLocalHarnessScratch() {
|
|
|
92547
92576
|
var startup;
|
|
92548
92577
|
function startLocalHarnessJanitor() {
|
|
92549
92578
|
startup ??= (async () => {
|
|
92550
|
-
const { localHarnessSupervisor } = await import("./local-turn-
|
|
92579
|
+
const { localHarnessSupervisor } = await import("./local-turn-SXHFOZVA.js");
|
|
92551
92580
|
await localHarnessSupervisor().reclaimOrphans();
|
|
92552
92581
|
await sweepLocalHarnessScratch();
|
|
92553
92582
|
})().catch((error) => {
|
|
@@ -219324,10 +219353,22 @@ var AUTHENTICATION_FAILURE = /\b(unauthenticated|invalid token|token (has )?expi
|
|
|
219324
219353
|
function redactedReadRefusalError(error, notFoundMessage) {
|
|
219325
219354
|
if (error instanceof WebRouteError) return void 0;
|
|
219326
219355
|
if (hasConvexErrorData(error)) return void 0;
|
|
219327
|
-
|
|
219328
|
-
|
|
219356
|
+
const failure = classifyConvexReadError(error);
|
|
219357
|
+
if (failure.kind === "invalid-argument") {
|
|
219358
|
+
logRejectedReadArguments("v1.read-refusal", error);
|
|
219359
|
+
} else if (failure.kind === "redacted") {
|
|
219360
|
+
logRedactedReadAsNotFound("v1.read-refusal", error);
|
|
219361
|
+
} else {
|
|
219362
|
+
return void 0;
|
|
219363
|
+
}
|
|
219329
219364
|
return new WebRouteError(404, ErrorCode.NOT_FOUND, notFoundMessage);
|
|
219330
219365
|
}
|
|
219366
|
+
function logRejectedReadArguments(scope, error) {
|
|
219367
|
+
logger.warn(`[${scope}] convex rejected read arguments`, {
|
|
219368
|
+
scope,
|
|
219369
|
+
detail: redactForLog(error)
|
|
219370
|
+
});
|
|
219371
|
+
}
|
|
219331
219372
|
function logRedactedReadAsNotFound(scope, error) {
|
|
219332
219373
|
logger.warn(`[${scope}] redacted read failure answered as not found`, {
|
|
219333
219374
|
scope,
|
|
@@ -219358,10 +219399,7 @@ function translateConvexReadError(error, options) {
|
|
|
219358
219399
|
if (structured) return structured;
|
|
219359
219400
|
const failure = classifyConvexReadError(error);
|
|
219360
219401
|
if (failure.kind === "invalid-argument") {
|
|
219361
|
-
|
|
219362
|
-
scope: options.scope,
|
|
219363
|
-
detail: redactForLog(error)
|
|
219364
|
-
});
|
|
219402
|
+
logRejectedReadArguments(options.scope, error);
|
|
219365
219403
|
return new WebRouteError(
|
|
219366
219404
|
404,
|
|
219367
219405
|
ErrorCode.NOT_FOUND,
|
|
@@ -265360,16 +265398,11 @@ function createConvexClient3(convexAuthToken) {
|
|
|
265360
265398
|
client3.setAuth(convexAuthToken);
|
|
265361
265399
|
return client3;
|
|
265362
265400
|
}
|
|
265401
|
+
var PROJECT_OR_CLIENT_NOT_FOUND = "Project or client not found, or you do not have access to it.";
|
|
265363
265402
|
function translateConvexWriteError3(error) {
|
|
265364
265403
|
return translateConvexWriteError(error, {
|
|
265365
265404
|
resource: "Client",
|
|
265366
|
-
|
|
265367
|
-
// missing" into the same generic error, and the v1 surface deliberately
|
|
265368
|
-
// doesn't leak which. Keep the message neutral rather than asserting
|
|
265369
|
-
// "Client not found" — the failure on the list/create paths is usually the
|
|
265370
|
-
// PROJECT (bad id or no membership), where a client-specific message
|
|
265371
|
-
// misleads.
|
|
265372
|
-
notFoundMessage: "Project or client not found, or you do not have access to it.",
|
|
265405
|
+
notFoundMessage: PROJECT_OR_CLIENT_NOT_FOUND,
|
|
265373
265406
|
fallbackMessage: "Client write rejected by the platform"
|
|
265374
265407
|
});
|
|
265375
265408
|
}
|
|
@@ -265381,13 +265414,10 @@ async function listHostRows(convexAuthToken, projectId) {
|
|
|
265381
265414
|
{ projectId }
|
|
265382
265415
|
) ?? [];
|
|
265383
265416
|
} catch (error) {
|
|
265384
|
-
throw redactedReadRefusalError(
|
|
265385
|
-
error,
|
|
265386
|
-
"Project or client not found, or you do not have access to it."
|
|
265387
|
-
) ?? translateConvexWriteError3(error);
|
|
265417
|
+
throw redactedReadRefusalError(error, PROJECT_OR_CLIENT_NOT_FOUND) ?? translateConvexWriteError3(error);
|
|
265388
265418
|
}
|
|
265389
265419
|
}
|
|
265390
|
-
async function readHostDetail(convexAuthToken, projectId, hostId) {
|
|
265420
|
+
async function readHostDetail(convexAuthToken, projectId, hostId, read3) {
|
|
265391
265421
|
const readClient = createConvexClient3(convexAuthToken);
|
|
265392
265422
|
let detail;
|
|
265393
265423
|
try {
|
|
@@ -265399,7 +265429,7 @@ async function readHostDetail(convexAuthToken, projectId, hostId) {
|
|
|
265399
265429
|
}
|
|
265400
265430
|
);
|
|
265401
265431
|
} catch (error) {
|
|
265402
|
-
throw translateConvexWriteError3(error);
|
|
265432
|
+
throw (read3 === "scope" ? redactedReadRefusalError(error, "Client not found") : void 0) ?? translateConvexWriteError3(error);
|
|
265403
265433
|
}
|
|
265404
265434
|
if (!detail) {
|
|
265405
265435
|
throw new WebRouteError(404, ErrorCode.NOT_FOUND, "Client not found");
|
|
@@ -265421,7 +265451,9 @@ async function resolveClientId(convexAuthToken, projectId, selector, includePriv
|
|
|
265421
265451
|
throw new WebRouteError(404, ErrorCode.NOT_FOUND, "Client not found");
|
|
265422
265452
|
} catch (error) {
|
|
265423
265453
|
if (error instanceof WebRouteError) throw error;
|
|
265424
|
-
if (!isMissingConvexFunction(error))
|
|
265454
|
+
if (!isMissingConvexFunction(error)) {
|
|
265455
|
+
throw redactedReadRefusalError(error, PROJECT_OR_CLIENT_NOT_FOUND) ?? translateConvexWriteError3(error);
|
|
265456
|
+
}
|
|
265425
265457
|
}
|
|
265426
265458
|
const rows = (await listHostRows(convexAuthToken, projectId)).filter(
|
|
265427
265459
|
(row2) => includePrivateBacking || !isPrivateBacking(row2)
|
|
@@ -265620,7 +265652,7 @@ async function getHandler(c, surface) {
|
|
|
265620
265652
|
const projectId = pathParam(c, "projectId");
|
|
265621
265653
|
const token = await getConvexBearerForRequest(c);
|
|
265622
265654
|
const clientId = await resolveSelector(c, token, surface);
|
|
265623
|
-
const detail = await readHostDetail(token, projectId, clientId);
|
|
265655
|
+
const detail = await readHostDetail(token, projectId, clientId, "scope");
|
|
265624
265656
|
if (!surface.legacy && !includePrivateBackingParam(c) && isPrivateBacking(detail)) {
|
|
265625
265657
|
throw new WebRouteError(404, ErrorCode.NOT_FOUND, "Client not found");
|
|
265626
265658
|
}
|
|
@@ -265647,7 +265679,12 @@ async function createHandler(c, surface) {
|
|
|
265647
265679
|
} catch (error) {
|
|
265648
265680
|
throw translateConvexWriteError3(error);
|
|
265649
265681
|
}
|
|
265650
|
-
const detail = await readHostDetail(
|
|
265682
|
+
const detail = await readHostDetail(
|
|
265683
|
+
token,
|
|
265684
|
+
projectId,
|
|
265685
|
+
created.hostId,
|
|
265686
|
+
"readBack"
|
|
265687
|
+
);
|
|
265651
265688
|
if (surface.legacy) {
|
|
265652
265689
|
markDeprecated2(c);
|
|
265653
265690
|
return v1Resource(c, toLegacyHostDetailDto(detail), 201);
|
|
@@ -265683,7 +265720,7 @@ async function updateClientHandler(c) {
|
|
|
265683
265720
|
try {
|
|
265684
265721
|
if (body.config !== void 0) {
|
|
265685
265722
|
assertConfigKeepsPinnedModel(
|
|
265686
|
-
await readHostDetail(token, projectId, clientId),
|
|
265723
|
+
await readHostDetail(token, projectId, clientId, "scope"),
|
|
265687
265724
|
body.config
|
|
265688
265725
|
);
|
|
265689
265726
|
await convexClient6.mutation(
|
|
@@ -265713,7 +265750,9 @@ async function updateClientHandler(c) {
|
|
|
265713
265750
|
}
|
|
265714
265751
|
return v1Resource(
|
|
265715
265752
|
c,
|
|
265716
|
-
toClientDetailDto(
|
|
265753
|
+
toClientDetailDto(
|
|
265754
|
+
await readHostDetail(token, projectId, clientId, "readBack")
|
|
265755
|
+
)
|
|
265717
265756
|
);
|
|
265718
265757
|
}
|
|
265719
265758
|
async function updateHostAliasHandler(c) {
|
|
@@ -265725,7 +265764,7 @@ async function updateHostAliasHandler(c) {
|
|
|
265725
265764
|
if (body.name !== void 0) updateArgs.name = body.name;
|
|
265726
265765
|
if (body.config !== void 0) {
|
|
265727
265766
|
assertConfigKeepsPinnedModel(
|
|
265728
|
-
await readHostDetail(token, projectId, hostId),
|
|
265767
|
+
await readHostDetail(token, projectId, hostId, "scope"),
|
|
265729
265768
|
body.config
|
|
265730
265769
|
);
|
|
265731
265770
|
updateArgs.input = normalizeConfigForWrite(body.config);
|
|
@@ -265739,7 +265778,9 @@ async function updateHostAliasHandler(c) {
|
|
|
265739
265778
|
markDeprecated2(c);
|
|
265740
265779
|
return v1Resource(
|
|
265741
265780
|
c,
|
|
265742
|
-
toLegacyHostDetailDto(
|
|
265781
|
+
toLegacyHostDetailDto(
|
|
265782
|
+
await readHostDetail(token, projectId, hostId, "readBack")
|
|
265783
|
+
)
|
|
265743
265784
|
);
|
|
265744
265785
|
}
|
|
265745
265786
|
async function setServersHandler(c, surface) {
|
|
@@ -265762,7 +265803,7 @@ async function setServersHandler(c, surface) {
|
|
|
265762
265803
|
}
|
|
265763
265804
|
return detailResponse(
|
|
265764
265805
|
c,
|
|
265765
|
-
await readHostDetail(token, projectId, clientId),
|
|
265806
|
+
await readHostDetail(token, projectId, clientId, "readBack"),
|
|
265766
265807
|
surface.legacy
|
|
265767
265808
|
);
|
|
265768
265809
|
}
|
|
@@ -265775,7 +265816,7 @@ async function duplicateHandler(c, surface) {
|
|
|
265775
265816
|
await readJsonObjectBody(c)
|
|
265776
265817
|
);
|
|
265777
265818
|
const convexClient6 = createConvexClient3(token);
|
|
265778
|
-
const source = await readHostDetail(token, projectId, clientId);
|
|
265819
|
+
const source = await readHostDetail(token, projectId, clientId, "scope");
|
|
265779
265820
|
if (!hostConfigPinsAModel(source.config)) {
|
|
265780
265821
|
throw new WebRouteError(
|
|
265781
265822
|
400,
|
|
@@ -265793,7 +265834,12 @@ async function duplicateHandler(c, surface) {
|
|
|
265793
265834
|
} catch (error) {
|
|
265794
265835
|
throw translateConvexWriteError3(error);
|
|
265795
265836
|
}
|
|
265796
|
-
const detail = await readHostDetail(
|
|
265837
|
+
const detail = await readHostDetail(
|
|
265838
|
+
token,
|
|
265839
|
+
projectId,
|
|
265840
|
+
created.hostId,
|
|
265841
|
+
"readBack"
|
|
265842
|
+
);
|
|
265797
265843
|
if (surface.legacy) {
|
|
265798
265844
|
markDeprecated2(c);
|
|
265799
265845
|
return v1Resource(c, toLegacyHostDetailDto(detail), 201);
|
|
@@ -266224,7 +266270,10 @@ environments2.get(
|
|
|
266224
266270
|
{ projectId, environmentId }
|
|
266225
266271
|
);
|
|
266226
266272
|
} catch (error) {
|
|
266227
|
-
throw
|
|
266273
|
+
throw redactedReadRefusalError(
|
|
266274
|
+
error,
|
|
266275
|
+
"Environment or project not found, or you do not have access to it."
|
|
266276
|
+
) ?? translateResolveError(error);
|
|
266228
266277
|
}
|
|
266229
266278
|
if (!resolved || !resolved.environmentRef) {
|
|
266230
266279
|
throw new WebRouteError(
|
|
@@ -270499,7 +270548,10 @@ images.post("/projects/:projectId/images/validate", async (c) => {
|
|
|
270499
270548
|
{ projectId, blueprint: body.blueprint }
|
|
270500
270549
|
);
|
|
270501
270550
|
} catch (error) {
|
|
270502
|
-
throw
|
|
270551
|
+
throw redactedReadRefusalError(
|
|
270552
|
+
error,
|
|
270553
|
+
"Environment or project not found, or you do not have access to it."
|
|
270554
|
+
) ?? translateConvexWriteError4(error);
|
|
270503
270555
|
}
|
|
270504
270556
|
return v1Resource(c, result);
|
|
270505
270557
|
});
|
|
@@ -282585,6 +282637,8 @@ function flushRelayStats() {
|
|
|
282585
282637
|
setInterval(flushRelayStats, STATS_FLUSH_INTERVAL_MS).unref();
|
|
282586
282638
|
var RATE_LIMIT_PER_MIN = 600;
|
|
282587
282639
|
var RELAY_INGEST_LIMIT_PER_MIN = 60;
|
|
282640
|
+
var RELAY_UNATTESTED_INGEST_LIMIT_PER_MIN = 60;
|
|
282641
|
+
var RELAY_POOLED_INGEST_LIMIT_PER_MIN = 4 * RELAY_INGEST_LIMIT_PER_MIN;
|
|
282588
282642
|
var RATE_WINDOW_MS2 = 6e4;
|
|
282589
282643
|
var UNATTESTED_CLIENT_KEY3 = "unattested";
|
|
282590
282644
|
var relayWindows = createFixedWindowMap(RATE_LIMIT_PER_MIN, RATE_WINDOW_MS2);
|
|
@@ -282593,24 +282647,31 @@ var ingestWindows = createFixedWindowMap(
|
|
|
282593
282647
|
RATE_WINDOW_MS2
|
|
282594
282648
|
);
|
|
282595
282649
|
var unattestedIngestWindows = createFixedWindowMap(
|
|
282596
|
-
|
|
282650
|
+
RELAY_UNATTESTED_INGEST_LIMIT_PER_MIN,
|
|
282651
|
+
RATE_WINDOW_MS2
|
|
282652
|
+
);
|
|
282653
|
+
var pooledIngestWindows = createFixedWindowMap(
|
|
282654
|
+
RELAY_POOLED_INGEST_LIMIT_PER_MIN,
|
|
282597
282655
|
RATE_WINDOW_MS2
|
|
282598
282656
|
);
|
|
282599
282657
|
function isIngestSubpath(subpath) {
|
|
282600
282658
|
return /^\/(?:e|i\/v0\/e|s|i\/v1\/(?:logs|metrics))\/?$/.test(subpath);
|
|
282601
282659
|
}
|
|
282602
|
-
function
|
|
282603
|
-
|
|
282660
|
+
function attestedClientKey(c) {
|
|
282661
|
+
if (!edgeAttestationConfigured()) return null;
|
|
282662
|
+
const ip = getAttestedClientIp(c);
|
|
282663
|
+
return ip === null ? null : ipRateLimitKey(ip);
|
|
282604
282664
|
}
|
|
282605
282665
|
function relayClientKey(c) {
|
|
282606
|
-
return
|
|
282666
|
+
return attestedClientKey(c) ?? UNATTESTED_CLIENT_KEY3;
|
|
282607
282667
|
}
|
|
282608
|
-
function relayRateLimit(c,
|
|
282668
|
+
function relayRateLimit(c, ingest) {
|
|
282609
282669
|
if (!HOSTED_MODE) return null;
|
|
282610
|
-
const
|
|
282611
|
-
let refusedMs = relayWindows.charge(
|
|
282612
|
-
if (refusedMs === null &&
|
|
282613
|
-
|
|
282670
|
+
const clientKey = attestedClientKey(c);
|
|
282671
|
+
let refusedMs = relayWindows.charge(clientKey ?? UNATTESTED_CLIENT_KEY3);
|
|
282672
|
+
if (refusedMs === null && ingest) {
|
|
282673
|
+
const sharedWindows = edgeAttestationConfigured() ? unattestedIngestWindows : pooledIngestWindows;
|
|
282674
|
+
refusedMs = clientKey ? ingestWindows.charge(clientKey) : sharedWindows.charge(UNATTESTED_CLIENT_KEY3);
|
|
282614
282675
|
}
|
|
282615
282676
|
if (refusedMs === null) return null;
|
|
282616
282677
|
stats2.rateLimitRejects++;
|
|
@@ -283215,7 +283276,7 @@ async function checkProjectTokens(subpath, url, method, body) {
|
|
|
283215
283276
|
}
|
|
283216
283277
|
var relayRoutes = new Hono137();
|
|
283217
283278
|
relayRoutes.post("/launch-engagement", makeBodyLimit(2048), async (c) => {
|
|
283218
|
-
const limited = relayRateLimit(c,
|
|
283279
|
+
const limited = relayRateLimit(c, true);
|
|
283219
283280
|
if (limited) return limited;
|
|
283220
283281
|
const parsed = launchEngagementSchema.safeParse(
|
|
283221
283282
|
await c.req.json().catch(() => null)
|
|
@@ -283227,7 +283288,7 @@ relayRoutes.post("/launch-engagement", makeBodyLimit(2048), async (c) => {
|
|
|
283227
283288
|
relayRoutes.all("*", async (c) => {
|
|
283228
283289
|
const url = new URL(c.req.url);
|
|
283229
283290
|
const subpath = stripRelayPrefix(url.pathname);
|
|
283230
|
-
const limited = relayRateLimit(c, subpath);
|
|
283291
|
+
const limited = relayRateLimit(c, isIngestSubpath(subpath));
|
|
283231
283292
|
if (limited) {
|
|
283232
283293
|
return limited;
|
|
283233
283294
|
}
|
|
@@ -284076,7 +284137,7 @@ function egressOverrideWeakensDefaults(override) {
|
|
|
284076
284137
|
}
|
|
284077
284138
|
|
|
284078
284139
|
// server/services/github-checks/network-monitor.ts
|
|
284079
|
-
import { isIP as
|
|
284140
|
+
import { isIP as isIP3 } from "net";
|
|
284080
284141
|
|
|
284081
284142
|
// server/services/github-checks/network-monitor-script.ts
|
|
284082
284143
|
var NETWORK_MONITOR_SCRIPT = String.raw`
|
|
@@ -284287,7 +284348,7 @@ function parseConnectionRecord(line2) {
|
|
|
284287
284348
|
if (line2.length > LINE_LIMIT) return null;
|
|
284288
284349
|
try {
|
|
284289
284350
|
const row2 = JSON.parse(line2);
|
|
284290
|
-
if (!row2 || row2.kind !== "connection" || !outcomes.has(row2.outcome) || !["tcp", "udp"].includes(row2.protocol) || typeof row2.destinationIp !== "string" ||
|
|
284351
|
+
if (!row2 || row2.kind !== "connection" || !outcomes.has(row2.outcome) || !["tcp", "udp"].includes(row2.protocol) || typeof row2.destinationIp !== "string" || isIP3(row2.destinationIp) === 0 || row2.destinationIp.includes("%") || isIP3(row2.destinationIp) !== row2.family || !Number.isInteger(row2.destinationPort) || row2.destinationPort < 1 || row2.destinationPort > 65535 || !Number.isSafeInteger(row2.timestamp) || row2.timestamp < 0)
|
|
284291
284352
|
return null;
|
|
284292
284353
|
return {
|
|
284293
284354
|
destinationIp: row2.destinationIp,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
localHarnessSupervisor,
|
|
3
3
|
prepareLocalHarnessTurn
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ER75CVTG.js";
|
|
5
|
+
import "./chunk-HHMYIKER.js";
|
|
6
6
|
import "./chunk-SH24KJBI.js";
|
|
7
7
|
import "./chunk-PZ5AY32C.js";
|
|
8
8
|
export {
|
|
9
9
|
localHarnessSupervisor,
|
|
10
10
|
prepareLocalHarnessTurn
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=local-turn-
|
|
12
|
+
//# sourceMappingURL=local-turn-SXHFOZVA.js.map
|