惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
The Cloudflare Blog
爱范儿
爱范儿
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
Jina AI
Jina AI
V
V2EX
罗磊的独立博客
V
Visual Studio Blog
A
About on SuperTechFans
IT之家
IT之家
P
Proofpoint News Feed
B
Blog
博客园 - Franky
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(release): bound npm registry verification bodies · op...
vincentkoc · 2026-06-19 · via Recent Commits to openclaw:main

@@ -3,7 +3,7 @@ import { generateKeyPairSync, sign } from "node:crypto";

33

import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";

44

import { tmpdir } from "node:os";

55

import { dirname, join } from "node:path";

6-

import { describe, expect, it } from "vitest";

6+

import { describe, expect, it, vi } from "vitest";

77

import {

88

buildPublishedInstallCommandArgs,

99

buildPublishedInstallScenarios,

@@ -12,6 +12,7 @@ import {

1212

collectInstalledPluginSdkZodArtifactErrors,

1313

collectInstalledRootDependencyManifestErrors,

1414

collectInstalledPackageErrors,

15+

fetchRegistryJson,

1516

normalizeInstalledBinaryVersion,

1617

resolveInstalledBinaryCommandInvocation,

1718

resolveInstalledBinaryPath,

@@ -88,6 +89,59 @@ describe("npm registry provenance verification", () => {

8889

},

8990

};

909192+

it("fetches npm registry JSON with bounded response handling", async () => {

93+

const fetchImpl = vi.fn(async (_url: string, init?: RequestInit) => {

94+

expect(init).toMatchObject({

95+

headers: {

96+

Accept: "application/json",

97+

},

98+

redirect: "error",

99+

signal: expect.any(AbortSignal),

100+

});

101+

return new Response(JSON.stringify({ ok: true }));

102+

});

103+104+

await expect(

105+

fetchRegistryJson("https://registry.example/openclaw", {

106+

fetchImpl,

107+

timeoutMs: 1234,

108+

}),

109+

).resolves.toEqual({ ok: true });

110+

});

111+112+

it("bounds oversized npm registry response bodies", async () => {

113+

const fetchImpl = vi.fn(async () => {

114+

return new Response("x".repeat(65), {

115+

headers: { "content-length": "65" },

116+

});

117+

});

118+119+

await expect(

120+

fetchRegistryJson("https://registry.example/openclaw", {

121+

fetchImpl,

122+

maxBodyBytes: 64,

123+

timeoutMs: 1234,

124+

}),

125+

).rejects.toThrow(

126+

"npm registry https://registry.example/openclaw response body exceeded 64 bytes",

127+

);

128+

});

129+130+

it("keeps npm registry timeouts active while reading response bodies", async () => {

131+

const fetchImpl = vi.fn(async () => {

132+

return new Response(new ReadableStream<Uint8Array>({ start() {} }));

133+

});

134+135+

await expect(

136+

fetchRegistryJson("https://registry.example/openclaw", {

137+

fetchImpl,

138+

timeoutMs: 5,

139+

}),

140+

).rejects.toThrow(

141+

"npm registry request timed out after 5ms: https://registry.example/openclaw",

142+

);

143+

});

144+91145

it("verifies an npm registry signature against the matching public key", () => {

92146

const keys = generateKeyPairSync("ec", { namedCurve: "prime256v1" });

93147

const payload = `${packageName}@${version}:${integrity}`;