feat(hololake): bind release chain to public path namespace

This commit is contained in:
冰朔 2026-08-13 19:11:26 +08:00
commit 9006075310
13 changed files with 223 additions and 29 deletions

View file

@ -165,3 +165,27 @@ test('symlinked package inputs are rejected instead of followed', () => {
fs.rmSync(fixture.fixtureRoot, { recursive: true, force: true })
}
})
test('operator refuses a bundle whose packages escape the registered public path', () => {
const fixture = buildOperatorFixture()
try {
const latestPath = path.join(fixture.source, 'latest.json')
const latest = JSON.parse(fs.readFileSync(latestPath, 'utf8'))
latest.platforms['darwin-aarch64'].url = 'https://guanghulab.com/updates/0.2.0/HoloLake.app.tar.gz'
writeJson(latestPath, latest)
const broadcastSha256 = sha256(fs.readFileSync(latestPath))
const pipelinePath = path.join(fixture.source, 'pipeline-receipt.json')
const pipeline = JSON.parse(fs.readFileSync(pipelinePath, 'utf8'))
pipeline.broadcastSha256 = broadcastSha256
writeJson(pipelinePath, pipeline)
const approval = JSON.parse(fs.readFileSync(fixture.approval, 'utf8'))
approval.broadcastSha256 = broadcastSha256
writeJson(fixture.approval, approval)
assert.throws(
() => verifyReleaseBundle(fixture.source, fixture.approval),
/HOLOLAKE_RELEASE_OPERATOR_PACKAGE_PUBLIC_PREFIX_MISMATCH/,
)
} finally {
fs.rmSync(fixture.fixtureRoot, { recursive: true, force: true })
}
})