From 13cbd2d728c86ab65c6fe037c3a6b536eb451bfb Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Mon, 23 Nov 2026 00:49:26 +0000 Subject: [PATCH 1/7] Harden standalone smoke Worker bootstrap --- .../private-laptop-bridge-smoke-init.yml | 40 +++ .../private-laptop-bridge/bootstrap-smoke.mjs | 243 ++++++++++++++++++ .../bootstrap-smoke.test.mjs | 213 +++++++++++++++ 3 files changed, 496 insertions(+) create mode 100644 .github/workflows/private-laptop-bridge-smoke-init.yml create mode 100644 pm-stack/private-laptop-bridge/bootstrap-smoke.mjs create mode 100644 pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs diff --git a/.github/workflows/private-laptop-bridge-smoke-init.yml b/.github/workflows/private-laptop-bridge-smoke-init.yml new file mode 100644 index 0000000000..afc10c4151 --- /dev/null +++ b/.github/workflows/private-laptop-bridge-smoke-init.yml @@ -0,0 +1,40 @@ +name: Initialize empty private laptop bridge smoke Worker + +on: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: private-laptop-bridge-smoke-init + cancel-in-progress: false + +jobs: + initialize: + if: github.repository == 'developing-today/code' && github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' + # Configure this environment out of band with required reviewers and main-only + # rules. This workflow cannot verify or create those GitHub environment rules. + environment: cloudflare-smoke-bootstrap + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ github.sha }} + fetch-depth: 1 + persist-credentials: false + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 24.22.0 + - name: Run offline bootstrap contract tests + run: node --test --test-reporter=spec pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs + - name: Create only the fixed empty Worker and verify it read-only + env: + # Both values must be provisioned as protected environment secrets; + # neither is a dispatch input or checked-in account/zone data. + CF_SMOKE_INIT_APPROVED_ACCOUNT_ID: ${{ secrets.CF_SMOKE_INIT_APPROVED_ACCOUNT_ID }} + CF_SMOKE_INIT_EXPECTED_ZONE_IDS: ${{ secrets.CF_SMOKE_INIT_EXPECTED_ZONE_IDS }} + CF_SMOKE_INIT_WRITE_TOKEN: ${{ secrets.CF_SMOKE_INIT_WRITE_TOKEN }} + CF_SMOKE_INIT_READ_TOKEN: ${{ secrets.CF_SMOKE_INIT_READ_TOKEN }} + run: node pm-stack/private-laptop-bridge/bootstrap-smoke.mjs diff --git a/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs b/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs new file mode 100644 index 0000000000..ca3a0f2e4b --- /dev/null +++ b/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs @@ -0,0 +1,243 @@ +#!/usr/bin/env node +// Create the smoke Worker metadata object only. No script/version/deployment, +// routes, domains, workers.dev setting changes, or settings updates are made. + +export const API = 'https://api.cloudflare.com/client/v4'; +export const ACCOUNT_SUFFIX = 'cbfa'; +export const WORKER_NAME = 'private-laptop-bridge-smoke'; +const PAGE_SIZE = 50; +const VERSION_PAGE_SIZE = 100; + +export const CREATE_BODY = Object.freeze({ + name: WORKER_NAME, + logpush: false, + observability: Object.freeze({ enabled: false }), + subdomain: Object.freeze({ enabled: false, previews_enabled: false }), +}); + +function fail(message) { throw new Error(message); } + +function parseExpectedZoneIds(value) { + let ids = value; + if (typeof ids === 'string') { + try { ids = JSON.parse(ids); } catch { fail('approved zone inventory configuration is invalid'); } + } + if (!Array.isArray(ids) || ids.some(id => typeof id !== 'string' || !/^[a-f0-9]{32}$/i.test(id))) { + fail('approved zone inventory configuration is missing or invalid'); + } + if (new Set(ids.map(id => id.toLowerCase())).size !== ids.length) fail('approved zone inventory contains duplicate IDs'); + return ids.map(id => id.toLowerCase()).sort(); +} + +export function validateInputs({ approvedAccountId, writeToken, readToken, expectedZoneIds }) { + if (!/^[a-f0-9]{32}$/i.test(approvedAccountId ?? '') || !approvedAccountId.toLowerCase().endsWith(ACCOUNT_SUFFIX)) { + fail('approved account configuration is missing or invalid'); + } + if (typeof writeToken !== 'string' || writeToken.length < 20) fail('bootstrap write credential is missing'); + if (typeof readToken !== 'string' || readToken.length < 20) fail('bootstrap read-only credential is missing'); + if (writeToken === readToken) fail('bootstrap read and write credentials must be distinct'); + return { approvedAccountId, expectedZoneIds: parseExpectedZoneIds(expectedZoneIds) }; +} + +function parseEnvelope(response, payload) { + if (!payload || typeof payload !== 'object' || Array.isArray(payload)) fail('Cloudflare returned an invalid response'); + if (!response.ok || payload.success !== true) { + const status = response.status; + fail(status === 401 || status === 403 + ? `Cloudflare authorization denied (HTTP ${status})` + : `Cloudflare API request failed (HTTP ${status})`); + } + if (!Object.hasOwn(payload, 'result')) fail('Cloudflare response omitted result'); + return payload.result; +} + +async function requestWithInfo(fetchImpl, url, token, { method = 'GET', body, allowWorkerNotFound = false } = {}) { + let response; + try { + response = await fetchImpl(url, { + method, + headers: { + authorization: `Bearer ${token}`, + accept: 'application/json', + ...(body === undefined ? {} : { 'content-type': 'application/json' }), + }, + ...(body === undefined ? {} : { body: JSON.stringify(body) }), + redirect: 'error', + signal: AbortSignal.timeout(15_000), + }); + } catch { + fail('Cloudflare API request failed before a verified response; do not retry creation automatically'); + } + + let payload; + try { payload = await response.json(); } catch { fail(`Cloudflare returned invalid JSON (HTTP ${response.status})`); } + if (response.status === 404 && allowWorkerNotFound) { + if (payload?.success === false && Array.isArray(payload.errors) && payload.errors.length === 1 && + payload.errors[0]?.code === 10007 && /^worker not found\.?$/i.test(String(payload.errors[0].message))) { + return { absent: true, resultInfo: payload.result_info }; + } + } + return { result: parseEnvelope(response, payload), resultInfo: payload.result_info }; +} + +async function request(fetchImpl, accountId, token, path, options = {}) { + return requestWithInfo(fetchImpl, `${API}/accounts/${encodeURIComponent(accountId)}${path}`, token, options); +} + +function assertWorker(worker) { + if (!worker || typeof worker !== 'object' || Array.isArray(worker)) fail('Worker readback is missing or malformed'); + if (worker.name !== WORKER_NAME || !/^[a-f0-9]{32}$/i.test(worker.id ?? '')) fail('Worker identity does not match the fixed smoke target'); + if (worker.logpush !== false || worker.observability?.enabled !== false) fail('Worker telemetry metadata is not explicitly disabled'); + if (worker.subdomain?.enabled !== false || worker.subdomain?.previews_enabled !== false) fail('Worker public subdomain or preview URL is enabled'); + if (!Object.hasOwn(worker, 'deployed_on') || worker.deployed_on !== null) fail('Worker already has or may have a deployment'); + if (!worker.references || !Array.isArray(worker.references.domains) || worker.references.domains.length !== 0) fail('Worker has a custom domain or domain state could not be verified'); + return worker; +} + +async function listAll(fetchImpl, accountId, readToken, pathname, pageSize, params = {}) { + const all = []; + let expectedTotal; + for (let page = 1; page <= 100; page += 1) { + const query = new URLSearchParams({ ...params, page: String(page), per_page: String(pageSize) }); + const { result, resultInfo } = await request(fetchImpl, accountId, readToken, `${pathname}?${query}`); + if (!Array.isArray(result)) fail('Cloudflare list response was not an array'); + all.push(...result); + if (!resultInfo || !Number.isInteger(resultInfo.total_pages) || resultInfo.total_pages < 0 || resultInfo.total_pages > 100 || + !Number.isInteger(resultInfo.total_count) || resultInfo.total_count < 0) { + fail('Cloudflare pagination metadata is missing or invalid'); + } + if (expectedTotal === undefined) expectedTotal = resultInfo.total_count; + if (resultInfo.total_count !== expectedTotal) fail('Cloudflare list changed during pagination'); + if (resultInfo.total_pages === 0 && page === 1 && expectedTotal === 0 && all.length === 0) return all; + if (resultInfo.total_pages < page) fail('Cloudflare pagination metadata is missing or invalid'); + if (page >= resultInfo.total_pages) { + if (all.length !== expectedTotal) fail('Cloudflare list did not return its complete item count'); + return all; + } + } + fail('Cloudflare pagination exceeded the hard page bound'); +} + +async function listZones(fetchImpl, accountId, readToken, expectedZoneIds) { + const all = []; + let expectedTotal; + let expectedPages; + for (let page = 1; page <= 100; page += 1) { + const query = new URLSearchParams({ + 'account.id': accountId, + type: 'full,partial,secondary,internal', + page: String(page), + per_page: String(PAGE_SIZE), + }); + // Keep result_info for complete pagination proof. + const url = `${API}/zones?${query}`; + const { result, resultInfo } = await requestWithInfo(fetchImpl, url, readToken); + if (!Array.isArray(result)) fail('Cloudflare zone response was not an array'); + if (result.length > PAGE_SIZE) fail('Cloudflare zone page exceeded the requested bound'); + const pageIds = new Set(all.map(zone => zone.id.toLowerCase())); + for (const zone of result) { + if (typeof zone?.id !== 'string' || !/^[a-f0-9]{32}$/i.test(zone.id) || zone?.account?.id?.toLowerCase() !== accountId.toLowerCase()) { + fail('Cloudflare zone inventory contains an invalid owner or ID'); + } + const id = zone.id.toLowerCase(); + if (pageIds.has(id)) { + fail('Cloudflare zone inventory contains a duplicate ID'); + } + pageIds.add(id); + } + all.push(...result); + if (!resultInfo || resultInfo.page !== page || resultInfo.per_page !== PAGE_SIZE || + !Number.isInteger(resultInfo.total_pages) || resultInfo.total_pages < 0 || resultInfo.total_pages > 100 || + !Number.isInteger(resultInfo.total_count) || resultInfo.total_count !== expectedZoneIds.length || + (resultInfo.total_count > 0 && resultInfo.total_pages !== Math.ceil(resultInfo.total_count / PAGE_SIZE)) || + (resultInfo.count !== undefined && resultInfo.count !== result.length)) { + fail('Cloudflare zone pagination metadata is missing or invalid'); + } + if (expectedTotal === undefined) expectedTotal = resultInfo.total_count; + if (expectedPages === undefined) expectedPages = resultInfo.total_pages; + if (resultInfo.total_count !== expectedTotal || resultInfo.total_pages !== expectedPages) fail('Cloudflare zone inventory changed during pagination'); + if ((resultInfo.total_pages === 0 || resultInfo.total_pages === 1) && page === 1 && expectedTotal === 0 && all.length === 0) return all; + if (resultInfo.total_pages < page) fail('Cloudflare zone pagination metadata is missing or invalid'); + if (page >= resultInfo.total_pages) { + if (all.length !== expectedTotal) fail('Cloudflare zone inventory is incomplete'); + return all; + } + } + fail('Cloudflare zone pagination exceeded the hard page bound'); +} + +async function assertNoRoutes(fetchImpl, accountId, readToken, expectedZoneIds) { + const zones = await listZones(fetchImpl, accountId, readToken, expectedZoneIds); + const seen = new Set(); + for (const zone of zones) { + if (typeof zone?.id !== 'string' || !/^[a-f0-9]{32}$/i.test(zone.id) || zone?.account?.id?.toLowerCase() !== accountId.toLowerCase()) { + fail('Cloudflare zone inventory contains an invalid owner or ID'); + } + const zoneId = zone.id.toLowerCase(); + if (seen.has(zoneId)) fail('Cloudflare zone inventory contains a duplicate ID'); + seen.add(zoneId); + const { result } = await requestWithInfo(fetchImpl, `${API}/zones/${encodeURIComponent(zone.id)}/workers/routes`, readToken); + if (!Array.isArray(result)) fail('Cloudflare route response was not an array'); + if (result.some(route => route?.script === WORKER_NAME)) fail('A Cloudflare route already targets the smoke Worker'); + } + const actualIds = [...seen].sort(); + if (actualIds.length !== expectedZoneIds.length || actualIds.some((id, index) => id !== expectedZoneIds[index])) { + fail('Cloudflare zone inventory does not match the approved full-account inventory'); + } +} + +async function assertNoVersionsAndDeployments(fetchImpl, accountId, readToken, workerId) { + const versions = await listAll(fetchImpl, accountId, readToken, `/workers/workers/${encodeURIComponent(workerId)}/versions`, VERSION_PAGE_SIZE); + if (versions.length !== 0) fail('Smoke Worker already has a version; no upload or deployment was attempted'); + const { result, resultInfo } = await request(fetchImpl, accountId, readToken, `/workers/scripts/${encodeURIComponent(WORKER_NAME)}/deployments?page=1&per_page=100`); + if (!result || typeof result !== 'object' || Array.isArray(result) || !Object.hasOwn(result, 'deployments') || + !Array.isArray(result.deployments) || result.deployments.length !== 0 || + (resultInfo?.total_count !== undefined && resultInfo.total_count !== 0)) { + fail('Smoke Worker deployment history is non-empty or unverifiable'); + } +} + +async function readWorker(fetchImpl, accountId, readToken) { + const response = await request(fetchImpl, accountId, readToken, `/workers/workers/${encodeURIComponent(WORKER_NAME)}`, { allowWorkerNotFound: true }); + return response.absent ? null : assertWorker(response.result); +} + +export async function bootstrapSmoke({ approvedAccountId, writeToken, readToken, expectedZoneIds, fetchImpl = fetch }) { + const approved = validateInputs({ approvedAccountId, writeToken, readToken, expectedZoneIds }); + const accountId = approved.approvedAccountId; + + const before = await readWorker(fetchImpl, accountId, readToken); + if (before) { + await assertNoRoutes(fetchImpl, accountId, readToken, approved.expectedZoneIds); + await assertNoVersionsAndDeployments(fetchImpl, accountId, readToken, before.id); + return 'already-present'; + } + + // The complete account route inventory is checked immediately before the + // only write. Any read/scope/pagination error exits before creation. + await assertNoRoutes(fetchImpl, accountId, readToken, approved.expectedZoneIds); + const created = await request(fetchImpl, accountId, writeToken, '/workers/workers', { method: 'POST', body: CREATE_BODY }); + assertWorker(created.result); + + // Re-read using the read-only token, never the create credential. + const after = await readWorker(fetchImpl, accountId, readToken); + if (!after || after.id !== created.result.id) fail('Created Worker identity does not match read-only provider readback'); + await assertNoRoutes(fetchImpl, accountId, readToken, approved.expectedZoneIds); + await assertNoVersionsAndDeployments(fetchImpl, accountId, readToken, after.id); + return 'created'; +} + +if (process.argv[1] && new URL(import.meta.url).pathname === process.argv[1]) { + try { + const status = await bootstrapSmoke({ + approvedAccountId: process.env.CF_SMOKE_INIT_APPROVED_ACCOUNT_ID, + expectedZoneIds: process.env.CF_SMOKE_INIT_EXPECTED_ZONE_IDS, + writeToken: process.env.CF_SMOKE_INIT_WRITE_TOKEN, + readToken: process.env.CF_SMOKE_INIT_READ_TOKEN, + }); + console.log(`Smoke Worker init preflight passed (${status}); no code or deployment was uploaded.`); + } catch (error) { + console.error(error instanceof Error ? error.message : 'Smoke Worker initialization failed'); + process.exitCode = 1; + } +} diff --git a/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs b/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs new file mode 100644 index 0000000000..c877069120 --- /dev/null +++ b/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs @@ -0,0 +1,213 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { bootstrapSmoke, CREATE_BODY, WORKER_NAME } from './bootstrap-smoke.mjs'; + +const accountId = `${'a'.repeat(28)}cbfa`; +const zoneId = '1'.repeat(32); +const expectedZoneIds = [zoneId]; +const writeToken = 'synthetic-write-token-000000'; +const readToken = 'synthetic-read-token-0000000'; +const workerId = '0123456789abcdef0123456789abcdef'; +const safeWorker = () => ({ + id: workerId, + name: WORKER_NAME, + logpush: false, + observability: { enabled: false }, + subdomain: { enabled: false, previews_enabled: false }, + deployed_on: null, + references: { domains: [] }, +}); +const ok = (result, result_info = { total_pages: 1, page: 1, per_page: 50, total_count: Array.isArray(result) ? result.length : 0 }) => + new Response(JSON.stringify({ success: true, result, ...(result_info === undefined ? {} : { result_info }) }), { status: 200 }); +const okNoInfo = result => new Response(JSON.stringify({ success: true, result }), { status: 200 }); +const missing = (code = 10007, message = 'Worker not found.') => + new Response(JSON.stringify({ success: false, errors: [{ code, message }] }), { status: 404 }); + +function fixture({ worker = null, createdWorker = safeWorker(), route = null, zones = [{ id: zoneId, account: { id: accountId } }], zoneResultInfo, versions = [], versionResultInfo, deployments = [], deploymentResultInfo, deploymentNoInfo = false, createResult = null, authFailure = false, writeAuthFailure = false, missingCode = 10007, missingMessage = 'Worker not found.' } = {}) { + const state = { worker, createdWorker, route, zones, zoneResultInfo, versions, versionResultInfo, deployments, deploymentResultInfo, deploymentNoInfo, createResult, authFailure, writeAuthFailure, missingCode, missingMessage, calls: [] }; + const fetchImpl = async (url, init = {}) => { + const parsed = new URL(url); + const method = init.method ?? 'GET'; + const token = init.headers?.authorization; + state.calls.push({ url: parsed, method, token, body: init.body ? JSON.parse(init.body) : undefined }); + if (state.authFailure && token === `Bearer ${readToken}`) { + return new Response(JSON.stringify({ success: false, errors: [{ code: 10000, message: 'Authentication error' }] }), { status: 403 }); + } + if (state.writeAuthFailure && method === 'POST' && token === `Bearer ${writeToken}`) { + return new Response(JSON.stringify({ success: false, errors: [{ code: 10000, message: 'Authentication error' }] }), { status: 403 }); + } + if (parsed.pathname === '/client/v4/zones') return ok(state.zones, state.zoneResultInfo); + if (parsed.pathname.endsWith('/workers/routes')) return ok(state.route ? [state.route] : []); + if (parsed.pathname.endsWith(`/workers/workers/${WORKER_NAME}`) && method === 'GET') { + return state.worker ? ok(state.worker, undefined) : missing(state.missingCode, state.missingMessage); + } + if (parsed.pathname.endsWith('/workers/workers') && method === 'POST') { + state.worker = state.createdWorker; + return ok(state.createResult ?? state.createdWorker, undefined); + } + if (parsed.pathname.endsWith(`/workers/workers/${workerId}/versions`)) return ok(state.versions, state.versionResultInfo); + if (parsed.pathname.endsWith(`/workers/scripts/${WORKER_NAME}/deployments`)) { + if (state.deploymentNoInfo) return okNoInfo({ deployments: state.deployments }); + return ok({ deployments: state.deployments }, state.deploymentResultInfo ?? { total_pages: 1, page: 1, per_page: 100, total_count: state.deployments.length }); + } + throw new Error(`unexpected synthetic request ${method} ${parsed.pathname}`); + }; + return { state, fetchImpl }; +} + +function run({ fetchImpl, ...overrides }) { + return bootstrapSmoke({ approvedAccountId: accountId, expectedZoneIds, writeToken, readToken, fetchImpl, ...overrides }); +} + +test('missing target creates exactly one metadata-only Worker and verifies exposure read-only', async () => { + const { state, fetchImpl } = fixture(); + assert.equal(await run({ fetchImpl }), 'created'); + const writes = state.calls.filter(call => call.method !== 'GET'); + assert.equal(writes.length, 1); + assert.equal(writes[0].method, 'POST'); + assert.equal(writes[0].token, `Bearer ${writeToken}`); + assert.deepEqual(writes[0].body, CREATE_BODY); + assert.ok(state.calls.filter(call => call.method === 'GET').every(call => call.token === `Bearer ${readToken}`)); + assert.equal(state.calls.some(call => call.url.pathname.includes('/scripts/') && call.method !== 'GET'), false); +}); + +test('same protected configuration is idempotent for an existing safe target', async () => { + const { state, fetchImpl } = fixture({ worker: safeWorker() }); + assert.equal(await run({ fetchImpl }), 'already-present'); + assert.equal(state.calls.some(call => call.method === 'POST'), false); +}); + +test('full account identity and expected zone inventory are mandatory protected config', async () => { + const { state, fetchImpl } = fixture(); + const wrongAccount = `${'b'.repeat(28)}beef`; + await assert.rejects(run({ fetchImpl, approvedAccountId: wrongAccount }), error => { + assert.match(error.message, /approved account configuration/); + assert.equal(error.message.includes(wrongAccount), false); + return true; + }); + await assert.rejects(run({ fetchImpl, expectedZoneIds: undefined }), /approved zone inventory/); + await assert.rejects(run({ fetchImpl, expectedZoneIds: 'not-json' }), /approved zone inventory/); + assert.equal(state.calls.length, 0); +}); + +test('read and write credentials must be different before any request', async () => { + const { state, fetchImpl } = fixture(); + await assert.rejects(run({ fetchImpl, readToken: writeToken }), /must be distinct/); + assert.equal(state.calls.length, 0); +}); + +test('only the documented Worker-specific 404 means absent', async () => { + const generic = fixture({ missingCode: 10000, missingMessage: 'Resource not found' }); + await assert.rejects(run({ fetchImpl: generic.fetchImpl }), /API request failed/); + assert.equal(generic.state.calls.some(call => call.method === 'POST'), false); + + const wrongMessage = fixture({ missingCode: 10007, missingMessage: 'Not found' }); + await assert.rejects(run({ fetchImpl: wrongMessage.fetchImpl }), /API request failed/); + assert.equal(wrongMessage.state.calls.some(call => call.method === 'POST'), false); +}); + +test('read and create authorization failures stop without retry', async () => { + const deniedRead = fixture({ authFailure: true }); + await assert.rejects(run({ fetchImpl: deniedRead.fetchImpl }), /authorization denied/); + assert.equal(deniedRead.state.calls.some(call => call.method === 'POST'), false); + + const deniedWrite = fixture({ writeAuthFailure: true }); + await assert.rejects(run({ fetchImpl: deniedWrite.fetchImpl }), /authorization denied/); + assert.equal(deniedWrite.state.calls.filter(call => call.method === 'POST').length, 1); +}); + +test('zone scan requires owner, unique IDs and exact full-account inventory', async t => { + const cases = [ + { zones: [{ id: zoneId, account: { id: 'f'.repeat(32) } }], expected: /owner or ID/ }, + { zones: [{ id: zoneId, account: { id: accountId } }, { id: zoneId, account: { id: accountId } }], expected: /duplicate ID/ }, + { zones: [], expected: /pagination metadata/ }, + { zones: [{ id: zoneId, account: { id: accountId } }], zoneResultInfo: { total_pages: 1, page: 2, per_page: 50, total_count: 1 }, expected: /pagination metadata/ }, + { zones: [{ id: '2'.repeat(32), account: { id: accountId } }], expected: /does not match the approved/ }, + ]; + for (const item of cases) { + await t.test(item.expected.source, async () => { + const f = fixture({ zones: item.zones, zoneResultInfo: item.zoneResultInfo }); + await assert.rejects(run({ fetchImpl: f.fetchImpl }), item.expected); + assert.equal(f.state.calls.some(call => call.method === 'POST'), false); + }); + } +}); + +test('known zero-zone inventory is accepted only when explicitly configured', async () => { + const f = fixture({ zones: [], zoneResultInfo: { total_pages: 0, page: 1, per_page: 50, total_count: 0 } }); + assert.equal(await bootstrapSmoke({ approvedAccountId: accountId, expectedZoneIds: [], writeToken, readToken, fetchImpl: f.fetchImpl }), 'created'); + assert.equal(f.state.calls.some(call => call.method === 'POST'), true); +}); + +test('wrong target or unsafe existing Worker fails without edits', async t => { + const wrong = safeWorker(); wrong.name = 'some-other-worker'; + const badTarget = fixture({ worker: wrong }); + await assert.rejects(run({ fetchImpl: badTarget.fetchImpl }), /identity does not match/); + assert.equal(badTarget.state.calls.some(call => call.method === 'POST'), false); + + for (const change of [ + w => { w.subdomain.enabled = true; }, + w => { w.subdomain.previews_enabled = true; }, + w => { w.deployed_on = '2026-11-23T00:00:00Z'; }, + w => { w.references.domains = [{ hostname: 'example.invalid' }]; }, + ]) { + const worker = safeWorker(); change(worker); + const f = fixture({ worker }); + await t.test('unsafe Worker state', async () => { + await assert.rejects(run({ fetchImpl: f.fetchImpl })); + assert.equal(f.state.calls.some(call => call.method === 'POST'), false); + }); + } +}); + +test('route conflict and incomplete pagination block creation', async () => { + const routed = fixture({ route: { id: 'route', pattern: 'example.invalid/*', script: WORKER_NAME } }); + await assert.rejects(run({ fetchImpl: routed.fetchImpl }), /route already targets/); + assert.equal(routed.state.calls.some(call => call.method === 'POST'), false); + + const incomplete = fixture({ zoneResultInfo: { total_pages: 1, page: 1, per_page: 50, total_count: 2 } }); + await assert.rejects(run({ fetchImpl: incomplete.fetchImpl }), /pagination metadata/); + assert.equal(incomplete.state.calls.some(call => call.method === 'POST'), false); +}); + +test('create response identity mismatch stops after its single write', async () => { + const mismatch = safeWorker(); mismatch.id = 'ffffffffffffffffffffffffffffffff'; + const f = fixture({ createResult: mismatch, createdWorker: safeWorker() }); + await assert.rejects(run({ fetchImpl: f.fetchImpl }), /Created Worker identity/); + assert.equal(f.state.calls.filter(call => call.method === 'POST').length, 1); +}); + +test('empty deployment list is explicit evidence; missing list or conflicting metadata is denied', async t => { + const empty = fixture({ worker: safeWorker(), deploymentNoInfo: true }); + assert.equal(await run({ fetchImpl: empty.fetchImpl }), 'already-present'); + + for (const response of [ + { result: {}, result_info: { total_count: 0 } }, + { result: { deployments: [] }, result_info: { total_count: 1 } }, + { result: { deployments: [{ id: 'deployed' }] }, result_info: undefined }, + ]) { + await t.test('non-empty or unverifiable deployment history', async () => { + const f = fixture({ worker: safeWorker() }); + const original = f.fetchImpl; + f.fetchImpl = async (url, init) => { + if (new URL(url).pathname.endsWith(`/workers/scripts/${WORKER_NAME}/deployments`)) { + return response.result_info === undefined ? okNoInfo(response.result) : ok(response.result, response.result_info); + } + return original(url, init); + }; + await assert.rejects(run({ fetchImpl: f.fetchImpl }), /deployment history/); + assert.equal(f.state.calls.some(call => call.method === 'POST'), false); + }); + } +}); + +test('zero versions and deployment history are required', async () => { + const { state, fetchImpl } = fixture({ worker: safeWorker() }); + assert.equal(await run({ fetchImpl }), 'already-present'); + assert.ok(state.calls.some(call => call.url.pathname.endsWith('/versions'))); + assert.ok(state.calls.some(call => call.url.pathname.endsWith('/deployments'))); + + const withVersion = fixture({ worker: safeWorker(), versions: [{ id: 'synthetic-version' }] }); + await assert.rejects(run({ fetchImpl: withVersion.fetchImpl }), /already has a version/); + assert.equal(withVersion.state.calls.some(call => call.method === 'POST'), false); +}); From 54646db15a778df9b342bfad5329d770f59fba5a Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Mon, 23 Nov 2026 00:52:03 +0000 Subject: [PATCH 2/7] Tighten bootstrap account and inventory proof --- .../bootstrap-smoke.test.mjs | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs b/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs index c877069120..447a7e378d 100644 --- a/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs +++ b/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs @@ -23,8 +23,8 @@ const okNoInfo = result => new Response(JSON.stringify({ success: true, result } const missing = (code = 10007, message = 'Worker not found.') => new Response(JSON.stringify({ success: false, errors: [{ code, message }] }), { status: 404 }); -function fixture({ worker = null, createdWorker = safeWorker(), route = null, zones = [{ id: zoneId, account: { id: accountId } }], zoneResultInfo, versions = [], versionResultInfo, deployments = [], deploymentResultInfo, deploymentNoInfo = false, createResult = null, authFailure = false, writeAuthFailure = false, missingCode = 10007, missingMessage = 'Worker not found.' } = {}) { - const state = { worker, createdWorker, route, zones, zoneResultInfo, versions, versionResultInfo, deployments, deploymentResultInfo, deploymentNoInfo, createResult, authFailure, writeAuthFailure, missingCode, missingMessage, calls: [] }; +function fixture({ worker = null, createdWorker = safeWorker(), route = null, zones = [{ id: zoneId, account: { id: accountId } }], zoneResultInfo, zonePages, versions = [], versionResultInfo, deployments = [], deploymentResultInfo, deploymentNoInfo = false, createResult = null, authFailure = false, writeAuthFailure = false, missingCode = 10007, missingMessage = 'Worker not found.' } = {}) { + const state = { worker, createdWorker, route, zones, zoneResultInfo, zonePages, versions, versionResultInfo, deployments, deploymentResultInfo, deploymentNoInfo, createResult, authFailure, writeAuthFailure, missingCode, missingMessage, calls: [] }; const fetchImpl = async (url, init = {}) => { const parsed = new URL(url); const method = init.method ?? 'GET'; @@ -36,7 +36,14 @@ function fixture({ worker = null, createdWorker = safeWorker(), route = null, zo if (state.writeAuthFailure && method === 'POST' && token === `Bearer ${writeToken}`) { return new Response(JSON.stringify({ success: false, errors: [{ code: 10000, message: 'Authentication error' }] }), { status: 403 }); } - if (parsed.pathname === '/client/v4/zones') return ok(state.zones, state.zoneResultInfo); + if (parsed.pathname === '/client/v4/zones') { + if (state.zonePages) { + const page = Number(parsed.searchParams.get('page')); + const result = state.zonePages[page - 1] ?? []; + return ok(result, { total_pages: state.zonePages.length, page, per_page: 50, total_count: state.zonePages.flat().length, count: result.length }); + } + return ok(state.zones, state.zoneResultInfo); + } if (parsed.pathname.endsWith('/workers/routes')) return ok(state.route ? [state.route] : []); if (parsed.pathname.endsWith(`/workers/workers/${WORKER_NAME}`) && method === 'GET') { return state.worker ? ok(state.worker, undefined) : missing(state.missingCode, state.missingMessage); @@ -96,6 +103,13 @@ test('read and write credentials must be different before any request', async () assert.equal(state.calls.length, 0); }); +test('missing credentials fail before any network request', async () => { + const { state, fetchImpl } = fixture(); + await assert.rejects(run({ fetchImpl, writeToken: '' }), /write credential is missing/); + await assert.rejects(run({ fetchImpl, readToken: '' }), /read-only credential is missing/); + assert.equal(state.calls.length, 0); +}); + test('only the documented Worker-specific 404 means absent', async () => { const generic = fixture({ missingCode: 10000, missingMessage: 'Resource not found' }); await assert.rejects(run({ fetchImpl: generic.fetchImpl }), /API request failed/); @@ -133,6 +147,15 @@ test('zone scan requires owner, unique IDs and exact full-account inventory', as } }); +test('complete multi-page route inventory is compared to protected zone IDs', async () => { + const ids = Array.from({ length: 51 }, (_, index) => index.toString(16).padStart(32, '0')); + const zones = ids.map(id => ({ id, account: { id: accountId } })); + const f = fixture({ zonePages: [zones.slice(0, 50), zones.slice(50)] }); + assert.equal(await run({ fetchImpl: f.fetchImpl, expectedZoneIds: ids }), 'created'); + const zoneRequests = f.state.calls.filter(call => call.url.pathname === '/client/v4/zones'); + assert.equal(zoneRequests.length, 4); // two complete scans: before and after create +}); + test('known zero-zone inventory is accepted only when explicitly configured', async () => { const f = fixture({ zones: [], zoneResultInfo: { total_pages: 0, page: 1, per_page: 50, total_count: 0 } }); assert.equal(await bootstrapSmoke({ approvedAccountId: accountId, expectedZoneIds: [], writeToken, readToken, fetchImpl: f.fetchImpl }), 'created'); From b66e0e0e619c05353d762e425df25b31c3c80bae Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Mon, 23 Nov 2026 01:26:10 +0000 Subject: [PATCH 3/7] Add isolated smoke versions upload workflow --- .../private-laptop-bridge-smoke-init.yml | 8 + .../private-laptop-bridge-smoke-upload.yml | 135 + .../private-laptop-bridge/bootstrap-smoke.mjs | 145 +- .../bootstrap-smoke.test.mjs | 44 +- .../cloudflare.config.ts | 24 + .../private-laptop-bridge/package-lock.json | 2433 +++++++++++++++++ pm-stack/private-laptop-bridge/package.json | 1 + .../private-laptop-bridge/smoke-upload.mjs | 231 ++ .../smoke-upload.test.mjs | 141 + pm-stack/private-laptop-bridge/smoke.mjs | 20 + 10 files changed, 3143 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/private-laptop-bridge-smoke-upload.yml create mode 100644 pm-stack/private-laptop-bridge/cloudflare.config.ts create mode 100644 pm-stack/private-laptop-bridge/package-lock.json create mode 100644 pm-stack/private-laptop-bridge/package.json create mode 100644 pm-stack/private-laptop-bridge/smoke-upload.mjs create mode 100644 pm-stack/private-laptop-bridge/smoke-upload.test.mjs create mode 100644 pm-stack/private-laptop-bridge/smoke.mjs diff --git a/.github/workflows/private-laptop-bridge-smoke-init.yml b/.github/workflows/private-laptop-bridge-smoke-init.yml index afc10c4151..29d68e466b 100644 --- a/.github/workflows/private-laptop-bridge-smoke-init.yml +++ b/.github/workflows/private-laptop-bridge-smoke-init.yml @@ -37,4 +37,12 @@ jobs: CF_SMOKE_INIT_EXPECTED_ZONE_IDS: ${{ secrets.CF_SMOKE_INIT_EXPECTED_ZONE_IDS }} CF_SMOKE_INIT_WRITE_TOKEN: ${{ secrets.CF_SMOKE_INIT_WRITE_TOKEN }} CF_SMOKE_INIT_READ_TOKEN: ${{ secrets.CF_SMOKE_INIT_READ_TOKEN }} + BOOTSTRAP_RECEIPT_PATH: ${{ runner.temp }}/smoke-init-receipt.json run: node pm-stack/private-laptop-bridge/bootstrap-smoke.mjs + - name: Preserve verified smoke initialization receipt + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: private-laptop-smoke-init-${{ github.run_id }} + path: ${{ runner.temp }}/smoke-init-receipt.json + if-no-files-found: error + retention-days: 14 diff --git a/.github/workflows/private-laptop-bridge-smoke-upload.yml b/.github/workflows/private-laptop-bridge-smoke-upload.yml new file mode 100644 index 0000000000..67c987ca92 --- /dev/null +++ b/.github/workflows/private-laptop-bridge-smoke-upload.yml @@ -0,0 +1,135 @@ +name: Upload private laptop bridge smoke version + +on: + workflow_dispatch: + inputs: + init_run_id: + description: Successful private-laptop-bridge-smoke-init run on this exact main commit + required: true + type: string + +permissions: + contents: read + actions: read + +concurrency: + group: private-laptop-bridge-smoke-upload + cancel-in-progress: false + +jobs: + upload: + if: github.repository == 'developing-today/code' && github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' + # Configure required reviewers and main-only rules outside the repository. + environment: cloudflare-smoke-upload + runs-on: ubuntu-24.04 + timeout-minutes: 15 + env: + INIT_RUN_ID: ${{ inputs.init_run_id }} + INIT_RECEIPT: ${{ runner.temp }}/init/smoke-init-receipt.json + INIT_RUN_JSON: ${{ runner.temp }}/init-run.json + INIT_JOBS_JSON: ${{ runner.temp }}/init-jobs.json + VERSION_RESPONSE: ${{ runner.temp }}/cf-version-response.json + steps: + - name: Validate fixed repository, ref, and init run identifier + shell: bash + run: | + set -euo pipefail + [[ "$GITHUB_REPOSITORY" == developing-today/code ]] + [[ "$GITHUB_REF" == refs/heads/main ]] + [[ "$GITHUB_EVENT_NAME" == workflow_dispatch ]] + [[ "$INIT_RUN_ID" =~ ^[0-9]{1,20}$ ]] + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ github.sha }} + fetch-depth: 1 + persist-credentials: false + + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 24.22.0 + cache: npm + cache-dependency-path: pm-stack/private-laptop-bridge/package-lock.json + + - name: Install the exact pinned cf toolchain + working-directory: pm-stack/private-laptop-bridge + run: npm ci --ignore-scripts --no-audit --no-fund + + - name: Run offline smoke and provenance contracts + working-directory: pm-stack/private-laptop-bridge + run: node --test --test-reporter=spec bootstrap-smoke.test.mjs smoke-upload.test.mjs + + - name: Build the fixed disabled smoke artifact + working-directory: pm-stack/private-laptop-bridge + run: npx --no-install cf build + + - name: Verify the effective prebuilt payload with cf dry-run + working-directory: pm-stack/private-laptop-bridge + env: + DRY_RUN_OUTPUT: ${{ runner.temp }}/cf-version-dry-run.txt + run: | + set -euo pipefail + args=(workers versions create --worker private-laptop-bridge-smoke --tag "$GITHUB_SHA" --message "offline smoke validation" --prebuilt --dry-run) + npx --no-install cf -q "${args[@]}" 2>&1 | tee "$DRY_RUN_OUTPUT" + node smoke-upload.mjs dry-run "$DRY_RUN_OUTPUT" + + - name: Download the receipt from the selected init run + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + name: private-laptop-smoke-init-${{ inputs.init_run_id }} + path: ${{ runner.temp }}/init + repository: developing-today/code + run-id: ${{ inputs.init_run_id }} + github-token: ${{ github.token }} + + - name: Fetch exact init run and attempt evidence + working-directory: pm-stack/private-laptop-bridge + env: + GITHUB_TOKEN: ${{ github.token }} + run: node smoke-upload.mjs fetch-init "$INIT_RECEIPT" "$INIT_RUN_JSON" "$INIT_JOBS_JSON" + + - name: Validate init receipt and trusted workflow provenance + id: init + working-directory: pm-stack/private-laptop-bridge + env: + CF_SMOKE_UPLOAD_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} + CF_SMOKE_UPLOAD_API_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_API_TOKEN }} + CF_SMOKE_UPLOAD_READ_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_READ_TOKEN }} + run: node smoke-upload.mjs validate-init "$INIT_RECEIPT" "$INIT_RUN_JSON" "$INIT_JOBS_JSON" + + - name: Verify the initialized smoke target and exposure state read-only + working-directory: pm-stack/private-laptop-bridge + env: + CF_SMOKE_UPLOAD_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} + CF_SMOKE_UPLOAD_READ_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_READ_TOKEN }} + CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS: ${{ secrets.CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS }} + run: node smoke-upload.mjs preflight "$INIT_RECEIPT" + + - name: Upload one immutable version to the fixed smoke Worker + working-directory: pm-stack/private-laptop-bridge + env: + CF_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_API_TOKEN }} + INIT_RECEIPT_DIGEST: ${{ steps.init.outputs.receipt_digest }} + WRANGLER_OUTPUT_FILE_PATH: ${{ runner.temp }}/cf-version-response.json + run: | + set -euo pipefail + rm -f "$VERSION_RESPONSE" + message="init_receipt_sha256=${INIT_RECEIPT_DIGEST}" + npx --no-install cf -q workers versions create \ + --worker private-laptop-bridge-smoke \ + --tag "$GITHUB_SHA" \ + --message "$message" \ + --prebuilt + test -s "$VERSION_RESPONSE" + + - name: Read back exact version and prove no serving state changed + working-directory: pm-stack/private-laptop-bridge + env: + CF_SMOKE_UPLOAD_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} + CF_SMOKE_UPLOAD_READ_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_READ_TOKEN }} + CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS: ${{ secrets.CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS }} + INIT_WORKER_ID: ${{ steps.init.outputs.worker_id }} + INIT_RECEIPT_DIGEST: ${{ steps.init.outputs.receipt_digest }} + run: node smoke-upload.mjs verify-upload "$VERSION_RESPONSE" diff --git a/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs b/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs index ca3a0f2e4b..88a7065222 100644 --- a/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs +++ b/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs @@ -1,10 +1,13 @@ #!/usr/bin/env node // Create the smoke Worker metadata object only. No script/version/deployment, // routes, domains, workers.dev setting changes, or settings updates are made. +import { createHash } from 'node:crypto'; +import { writeFile } from 'node:fs/promises'; export const API = 'https://api.cloudflare.com/client/v4'; export const ACCOUNT_SUFFIX = 'cbfa'; export const WORKER_NAME = 'private-laptop-bridge-smoke'; +export const INIT_WORKFLOW = '.github/workflows/private-laptop-bridge-smoke-init.yml'; const PAGE_SIZE = 50; const VERSION_PAGE_SIZE = 100; @@ -97,23 +100,37 @@ function assertWorker(worker) { async function listAll(fetchImpl, accountId, readToken, pathname, pageSize, params = {}) { const all = []; let expectedTotal; + let expectedPages; for (let page = 1; page <= 100; page += 1) { const query = new URLSearchParams({ ...params, page: String(page), per_page: String(pageSize) }); const { result, resultInfo } = await request(fetchImpl, accountId, readToken, `${pathname}?${query}`); if (!Array.isArray(result)) fail('Cloudflare list response was not an array'); all.push(...result); - if (!resultInfo || !Number.isInteger(resultInfo.total_pages) || resultInfo.total_pages < 0 || resultInfo.total_pages > 100 || - !Number.isInteger(resultInfo.total_count) || resultInfo.total_count < 0) { - fail('Cloudflare pagination metadata is missing or invalid'); + if (resultInfo !== undefined) { + if (!resultInfo || typeof resultInfo !== 'object' || Array.isArray(resultInfo)) fail('Cloudflare pagination metadata is invalid'); + if (resultInfo.page !== undefined && resultInfo.page !== page) fail('Cloudflare pagination page does not match the request'); + if (resultInfo.per_page !== undefined && resultInfo.per_page !== pageSize) fail('Cloudflare pagination size does not match the request'); + if (resultInfo.count !== undefined && resultInfo.count !== result.length) fail('Cloudflare pagination item count is inconsistent'); + if (resultInfo.total_count !== undefined) { + if (!Number.isInteger(resultInfo.total_count) || resultInfo.total_count < 0) fail('Cloudflare pagination total count is invalid'); + if (expectedTotal === undefined) expectedTotal = resultInfo.total_count; + if (resultInfo.total_count !== expectedTotal) fail('Cloudflare list changed during pagination'); + } + if (resultInfo.total_pages !== undefined) { + if (!Number.isInteger(resultInfo.total_pages) || resultInfo.total_pages < 0 || resultInfo.total_pages > 100) fail('Cloudflare pagination total pages is invalid'); + if (expectedPages === undefined) expectedPages = resultInfo.total_pages; + if (resultInfo.total_pages !== expectedPages) fail('Cloudflare list changed during pagination'); + } } - if (expectedTotal === undefined) expectedTotal = resultInfo.total_count; - if (resultInfo.total_count !== expectedTotal) fail('Cloudflare list changed during pagination'); - if (resultInfo.total_pages === 0 && page === 1 && expectedTotal === 0 && all.length === 0) return all; - if (resultInfo.total_pages < page) fail('Cloudflare pagination metadata is missing or invalid'); - if (page >= resultInfo.total_pages) { - if (all.length !== expectedTotal) fail('Cloudflare list did not return its complete item count'); + if (expectedTotal !== undefined && all.length > expectedTotal) fail('Cloudflare list exceeded its reported total count'); + const completeByPages = expectedPages !== undefined && (expectedPages === 0 ? page === 1 && all.length === 0 : page >= expectedPages); + const completeByCount = expectedTotal !== undefined && all.length === expectedTotal; + const completeByShortPage = result.length < pageSize; + if (completeByPages || completeByCount || (expectedPages === undefined && expectedTotal === undefined && completeByShortPage)) { + if (expectedTotal !== undefined && all.length !== expectedTotal) fail('Cloudflare list did not return its complete item count'); return all; } + if (result.length < pageSize && !completeByCount) fail('Cloudflare list ended before its reported total count'); } fail('Cloudflare pagination exceeded the hard page bound'); } @@ -146,22 +163,29 @@ async function listZones(fetchImpl, accountId, readToken, expectedZoneIds) { pageIds.add(id); } all.push(...result); - if (!resultInfo || resultInfo.page !== page || resultInfo.per_page !== PAGE_SIZE || - !Number.isInteger(resultInfo.total_pages) || resultInfo.total_pages < 0 || resultInfo.total_pages > 100 || - !Number.isInteger(resultInfo.total_count) || resultInfo.total_count !== expectedZoneIds.length || - (resultInfo.total_count > 0 && resultInfo.total_pages !== Math.ceil(resultInfo.total_count / PAGE_SIZE)) || - (resultInfo.count !== undefined && resultInfo.count !== result.length)) { - fail('Cloudflare zone pagination metadata is missing or invalid'); - } - if (expectedTotal === undefined) expectedTotal = resultInfo.total_count; - if (expectedPages === undefined) expectedPages = resultInfo.total_pages; - if (resultInfo.total_count !== expectedTotal || resultInfo.total_pages !== expectedPages) fail('Cloudflare zone inventory changed during pagination'); - if ((resultInfo.total_pages === 0 || resultInfo.total_pages === 1) && page === 1 && expectedTotal === 0 && all.length === 0) return all; - if (resultInfo.total_pages < page) fail('Cloudflare zone pagination metadata is missing or invalid'); - if (page >= resultInfo.total_pages) { - if (all.length !== expectedTotal) fail('Cloudflare zone inventory is incomplete'); - return all; + if (resultInfo !== undefined) { + if (!resultInfo || typeof resultInfo !== 'object' || Array.isArray(resultInfo)) fail('Cloudflare zone pagination metadata is invalid'); + if (resultInfo.page !== undefined && resultInfo.page !== page) fail('Cloudflare zone page does not match the request'); + if (resultInfo.per_page !== undefined && resultInfo.per_page !== PAGE_SIZE) fail('Cloudflare zone page size does not match the request'); + if (resultInfo.count !== undefined && resultInfo.count !== result.length) fail('Cloudflare zone page count is inconsistent'); + if (resultInfo.total_count !== undefined) { + if (!Number.isInteger(resultInfo.total_count) || resultInfo.total_count !== expectedZoneIds.length) fail('Cloudflare zone total count differs from approved inventory'); + if (expectedTotal === undefined) expectedTotal = resultInfo.total_count; + if (resultInfo.total_count !== expectedTotal) fail('Cloudflare zone inventory changed during pagination'); + } + if (resultInfo.total_pages !== undefined) { + if (!Number.isInteger(resultInfo.total_pages) || resultInfo.total_pages < 0 || resultInfo.total_pages > 100) fail('Cloudflare zone total pages is invalid'); + if (resultInfo.total_pages > 0 && expectedZoneIds.length > 0 && resultInfo.total_pages !== Math.ceil(expectedZoneIds.length / PAGE_SIZE)) fail('Cloudflare zone total pages differs from approved inventory'); + if (expectedPages === undefined) expectedPages = resultInfo.total_pages; + if (resultInfo.total_pages !== expectedPages) fail('Cloudflare zone inventory changed during pagination'); + } } + if (all.length > expectedZoneIds.length) fail('Cloudflare zone inventory exceeds approved inventory'); + const completeByCount = all.length === expectedZoneIds.length; + const completeByPages = expectedPages !== undefined && (expectedPages === 0 ? page === 1 && all.length === 0 : page >= expectedPages); + if (completeByCount && (expectedPages === undefined || completeByPages)) return all; + if (result.length < PAGE_SIZE && !completeByCount) fail('Cloudflare zone inventory ended before all approved zones were returned'); + if (expectedPages !== undefined && page >= expectedPages && !completeByCount) fail('Cloudflare zone inventory is incomplete'); } fail('Cloudflare zone pagination exceeded the hard page bound'); } @@ -189,6 +213,10 @@ async function assertNoRoutes(fetchImpl, accountId, readToken, expectedZoneIds) async function assertNoVersionsAndDeployments(fetchImpl, accountId, readToken, workerId) { const versions = await listAll(fetchImpl, accountId, readToken, `/workers/workers/${encodeURIComponent(workerId)}/versions`, VERSION_PAGE_SIZE); if (versions.length !== 0) fail('Smoke Worker already has a version; no upload or deployment was attempted'); + await assertNoDeployments(fetchImpl, accountId, readToken); +} + +async function assertNoDeployments(fetchImpl, accountId, readToken) { const { result, resultInfo } = await request(fetchImpl, accountId, readToken, `/workers/scripts/${encodeURIComponent(WORKER_NAME)}/deployments?page=1&per_page=100`); if (!result || typeof result !== 'object' || Array.isArray(result) || !Object.hasOwn(result, 'deployments') || !Array.isArray(result.deployments) || result.deployments.length !== 0 || @@ -202,6 +230,52 @@ async function readWorker(fetchImpl, accountId, readToken) { return response.absent ? null : assertWorker(response.result); } +export async function verifySmokeEmptyTarget({ approvedAccountId, readToken, expectedZoneIds, expectedWorkerId, fetchImpl = fetch }) { + if (!/^[a-f0-9]{32}$/i.test(approvedAccountId ?? '') || !approvedAccountId.toLowerCase().endsWith(ACCOUNT_SUFFIX)) fail('approved account configuration is missing or invalid'); + if (typeof readToken !== 'string' || readToken.length < 20) fail('bootstrap read-only credential is missing'); + const zones = parseExpectedZoneIds(expectedZoneIds); + const worker = await readWorker(fetchImpl, approvedAccountId, readToken); + if (!worker) fail('Smoke Worker is not initialized; no upload was attempted'); + if (expectedWorkerId !== undefined && worker.id !== expectedWorkerId) fail('Smoke Worker identity differs from the initialization receipt'); + await assertNoRoutes(fetchImpl, approvedAccountId, readToken, zones); + await assertNoVersionsAndDeployments(fetchImpl, approvedAccountId, readToken, worker.id); + return { workerId: worker.id, workerName: worker.name }; +} + +export async function verifySmokePostUpload({ approvedAccountId, readToken, expectedZoneIds, expectedWorkerId, fetchImpl = fetch }) { + if (!/^[a-f0-9]{32}$/i.test(approvedAccountId ?? '') || !approvedAccountId.toLowerCase().endsWith(ACCOUNT_SUFFIX)) fail('approved account configuration is missing or invalid'); + if (typeof readToken !== 'string' || readToken.length < 20) fail('bootstrap read-only credential is missing'); + const zones = parseExpectedZoneIds(expectedZoneIds); + const worker = await readWorker(fetchImpl, approvedAccountId, readToken); + if (!worker) fail('Smoke Worker disappeared after version upload'); + if (expectedWorkerId !== undefined && worker.id !== expectedWorkerId) fail('Smoke Worker identity changed after version upload'); + await assertNoRoutes(fetchImpl, approvedAccountId, readToken, zones); + await assertNoDeployments(fetchImpl, approvedAccountId, readToken); + return { workerId: worker.id, workerName: worker.name }; +} + +export function createInitReceipt({ approvedAccountId, workerId, status, repository, sourceSha, runId, runAttempt, event, branch }) { + if (!/^[a-f0-9]{32}$/i.test(approvedAccountId ?? '') || !approvedAccountId.toLowerCase().endsWith(ACCOUNT_SUFFIX)) fail('approved account configuration is missing or invalid'); + if (!/^[a-f0-9]{32}$/i.test(workerId ?? '') || !['created', 'already-present'].includes(status)) fail('verified smoke Worker result is invalid'); + if (repository !== 'developing-today/code' || event !== 'workflow_dispatch' || branch !== 'main' || + !/^[a-f0-9]{40}$/.test(sourceSha ?? '') || !/^\d{1,20}$/.test(String(runId ?? '')) || + !Number.isInteger(runAttempt) || runAttempt < 1) fail('trusted workflow run metadata is invalid'); + return { + schema: 1, + repository, + workflow: INIT_WORKFLOW, + event, + branch, + source_sha: sourceSha, + run_id: String(runId), + run_attempt: runAttempt, + account_id_sha256: createHash('sha256').update(approvedAccountId.toLowerCase()).digest('hex'), + worker_name: WORKER_NAME, + worker_id: workerId.toLowerCase(), + status, + }; +} + export async function bootstrapSmoke({ approvedAccountId, writeToken, readToken, expectedZoneIds, fetchImpl = fetch }) { const approved = validateInputs({ approvedAccountId, writeToken, readToken, expectedZoneIds }); const accountId = approved.approvedAccountId; @@ -210,7 +284,7 @@ export async function bootstrapSmoke({ approvedAccountId, writeToken, readToken, if (before) { await assertNoRoutes(fetchImpl, accountId, readToken, approved.expectedZoneIds); await assertNoVersionsAndDeployments(fetchImpl, accountId, readToken, before.id); - return 'already-present'; + return { status: 'already-present', workerId: before.id }; } // The complete account route inventory is checked immediately before the @@ -224,18 +298,33 @@ export async function bootstrapSmoke({ approvedAccountId, writeToken, readToken, if (!after || after.id !== created.result.id) fail('Created Worker identity does not match read-only provider readback'); await assertNoRoutes(fetchImpl, accountId, readToken, approved.expectedZoneIds); await assertNoVersionsAndDeployments(fetchImpl, accountId, readToken, after.id); - return 'created'; + return { status: 'created', workerId: after.id }; } if (process.argv[1] && new URL(import.meta.url).pathname === process.argv[1]) { try { - const status = await bootstrapSmoke({ + const approvedAccountId = process.env.CF_SMOKE_INIT_APPROVED_ACCOUNT_ID; + const result = await bootstrapSmoke({ approvedAccountId: process.env.CF_SMOKE_INIT_APPROVED_ACCOUNT_ID, expectedZoneIds: process.env.CF_SMOKE_INIT_EXPECTED_ZONE_IDS, writeToken: process.env.CF_SMOKE_INIT_WRITE_TOKEN, readToken: process.env.CF_SMOKE_INIT_READ_TOKEN, }); - console.log(`Smoke Worker init preflight passed (${status}); no code or deployment was uploaded.`); + const receiptPath = process.env.BOOTSTRAP_RECEIPT_PATH; + if (!receiptPath) fail('init receipt output path is missing'); + const receipt = createInitReceipt({ + approvedAccountId, + workerId: result.workerId, + status: result.status, + repository: process.env.GITHUB_REPOSITORY, + sourceSha: process.env.GITHUB_SHA, + runId: process.env.GITHUB_RUN_ID, + runAttempt: Number(process.env.GITHUB_RUN_ATTEMPT), + event: process.env.GITHUB_EVENT_NAME, + branch: process.env.GITHUB_REF_NAME, + }); + await writeFile(receiptPath, `${JSON.stringify(receipt)}\n`, { flag: 'wx', mode: 0o600 }); + console.log(`Smoke Worker init preflight passed (${result.status}); no code or deployment was uploaded.`); } catch (error) { console.error(error instanceof Error ? error.message : 'Smoke Worker initialization failed'); process.exitCode = 1; diff --git a/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs b/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs index 447a7e378d..6a4dc5f6e3 100644 --- a/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs +++ b/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs @@ -1,6 +1,6 @@ import test from 'node:test'; import assert from 'node:assert/strict'; -import { bootstrapSmoke, CREATE_BODY, WORKER_NAME } from './bootstrap-smoke.mjs'; +import { bootstrapSmoke, createInitReceipt, verifySmokeEmptyTarget, verifySmokePostUpload, CREATE_BODY, WORKER_NAME } from './bootstrap-smoke.mjs'; const accountId = `${'a'.repeat(28)}cbfa`; const zoneId = '1'.repeat(32); @@ -52,7 +52,7 @@ function fixture({ worker = null, createdWorker = safeWorker(), route = null, zo state.worker = state.createdWorker; return ok(state.createResult ?? state.createdWorker, undefined); } - if (parsed.pathname.endsWith(`/workers/workers/${workerId}/versions`)) return ok(state.versions, state.versionResultInfo); + if (parsed.pathname.endsWith(`/workers/workers/${workerId}/versions`)) return ok(state.versions, state.versionResultInfo ?? { total_pages: 0, page: 1, per_page: 100, total_count: state.versions.length }); if (parsed.pathname.endsWith(`/workers/scripts/${WORKER_NAME}/deployments`)) { if (state.deploymentNoInfo) return okNoInfo({ deployments: state.deployments }); return ok({ deployments: state.deployments }, state.deploymentResultInfo ?? { total_pages: 1, page: 1, per_page: 100, total_count: state.deployments.length }); @@ -68,7 +68,7 @@ function run({ fetchImpl, ...overrides }) { test('missing target creates exactly one metadata-only Worker and verifies exposure read-only', async () => { const { state, fetchImpl } = fixture(); - assert.equal(await run({ fetchImpl }), 'created'); + assert.deepEqual(await run({ fetchImpl }), { status: 'created', workerId }); const writes = state.calls.filter(call => call.method !== 'GET'); assert.equal(writes.length, 1); assert.equal(writes[0].method, 'POST'); @@ -80,7 +80,7 @@ test('missing target creates exactly one metadata-only Worker and verifies expos test('same protected configuration is idempotent for an existing safe target', async () => { const { state, fetchImpl } = fixture({ worker: safeWorker() }); - assert.equal(await run({ fetchImpl }), 'already-present'); + assert.deepEqual(await run({ fetchImpl }), { status: 'already-present', workerId }); assert.equal(state.calls.some(call => call.method === 'POST'), false); }); @@ -134,8 +134,8 @@ test('zone scan requires owner, unique IDs and exact full-account inventory', as const cases = [ { zones: [{ id: zoneId, account: { id: 'f'.repeat(32) } }], expected: /owner or ID/ }, { zones: [{ id: zoneId, account: { id: accountId } }, { id: zoneId, account: { id: accountId } }], expected: /duplicate ID/ }, - { zones: [], expected: /pagination metadata/ }, - { zones: [{ id: zoneId, account: { id: accountId } }], zoneResultInfo: { total_pages: 1, page: 2, per_page: 50, total_count: 1 }, expected: /pagination metadata/ }, + { zones: [], expected: /zone total count|does not match the approved/ }, + { zones: [{ id: zoneId, account: { id: accountId } }], zoneResultInfo: { total_pages: 1, page: 2, per_page: 50, total_count: 1 }, expected: /zone page does not match/ }, { zones: [{ id: '2'.repeat(32), account: { id: accountId } }], expected: /does not match the approved/ }, ]; for (const item of cases) { @@ -151,14 +151,14 @@ test('complete multi-page route inventory is compared to protected zone IDs', as const ids = Array.from({ length: 51 }, (_, index) => index.toString(16).padStart(32, '0')); const zones = ids.map(id => ({ id, account: { id: accountId } })); const f = fixture({ zonePages: [zones.slice(0, 50), zones.slice(50)] }); - assert.equal(await run({ fetchImpl: f.fetchImpl, expectedZoneIds: ids }), 'created'); + assert.deepEqual(await run({ fetchImpl: f.fetchImpl, expectedZoneIds: ids }), { status: 'created', workerId }); const zoneRequests = f.state.calls.filter(call => call.url.pathname === '/client/v4/zones'); assert.equal(zoneRequests.length, 4); // two complete scans: before and after create }); test('known zero-zone inventory is accepted only when explicitly configured', async () => { const f = fixture({ zones: [], zoneResultInfo: { total_pages: 0, page: 1, per_page: 50, total_count: 0 } }); - assert.equal(await bootstrapSmoke({ approvedAccountId: accountId, expectedZoneIds: [], writeToken, readToken, fetchImpl: f.fetchImpl }), 'created'); + assert.deepEqual(await bootstrapSmoke({ approvedAccountId: accountId, expectedZoneIds: [], writeToken, readToken, fetchImpl: f.fetchImpl }), { status: 'created', workerId }); assert.equal(f.state.calls.some(call => call.method === 'POST'), true); }); @@ -189,7 +189,7 @@ test('route conflict and incomplete pagination block creation', async () => { assert.equal(routed.state.calls.some(call => call.method === 'POST'), false); const incomplete = fixture({ zoneResultInfo: { total_pages: 1, page: 1, per_page: 50, total_count: 2 } }); - await assert.rejects(run({ fetchImpl: incomplete.fetchImpl }), /pagination metadata/); + await assert.rejects(run({ fetchImpl: incomplete.fetchImpl }), /zone total count/); assert.equal(incomplete.state.calls.some(call => call.method === 'POST'), false); }); @@ -202,7 +202,7 @@ test('create response identity mismatch stops after its single write', async () test('empty deployment list is explicit evidence; missing list or conflicting metadata is denied', async t => { const empty = fixture({ worker: safeWorker(), deploymentNoInfo: true }); - assert.equal(await run({ fetchImpl: empty.fetchImpl }), 'already-present'); + assert.deepEqual(await run({ fetchImpl: empty.fetchImpl }), { status: 'already-present', workerId }); for (const response of [ { result: {}, result_info: { total_count: 0 } }, @@ -226,7 +226,7 @@ test('empty deployment list is explicit evidence; missing list or conflicting me test('zero versions and deployment history are required', async () => { const { state, fetchImpl } = fixture({ worker: safeWorker() }); - assert.equal(await run({ fetchImpl }), 'already-present'); + assert.deepEqual(await run({ fetchImpl }), { status: 'already-present', workerId }); assert.ok(state.calls.some(call => call.url.pathname.endsWith('/versions'))); assert.ok(state.calls.some(call => call.url.pathname.endsWith('/deployments'))); @@ -234,3 +234,25 @@ test('zero versions and deployment history are required', async () => { await assert.rejects(run({ fetchImpl: withVersion.fetchImpl }), /already has a version/); assert.equal(withVersion.state.calls.some(call => call.method === 'POST'), false); }); + +test('read-only upload preflight binds the init Worker ID and postflight keeps it private', async () => { + const f = fixture({ worker: safeWorker() }); + assert.deepEqual(await verifySmokeEmptyTarget({ approvedAccountId: accountId, expectedZoneIds, readToken, expectedWorkerId: workerId, fetchImpl: f.fetchImpl }), { workerId, workerName: WORKER_NAME }); + assert.deepEqual(await verifySmokePostUpload({ approvedAccountId: accountId, expectedZoneIds, readToken, expectedWorkerId: workerId, fetchImpl: f.fetchImpl }), { workerId, workerName: WORKER_NAME }); + assert.equal(f.state.calls.some(call => call.method !== 'GET'), false); + + await assert.rejects(verifySmokeEmptyTarget({ approvedAccountId: accountId, expectedZoneIds, readToken, expectedWorkerId: 'f'.repeat(32), fetchImpl: f.fetchImpl }), /differs from the initialization receipt/); +}); + +test('init receipt binds exact trusted run, account hash and Worker without storing account ID', () => { + const receipt = createInitReceipt({ + approvedAccountId: accountId, workerId, status: 'created', repository: 'developing-today/code', + sourceSha: 'a'.repeat(40), runId: '123456789', runAttempt: 1, event: 'workflow_dispatch', branch: 'main', + }); + assert.equal(receipt.worker_name, WORKER_NAME); + assert.equal(receipt.worker_id, workerId); + assert.equal(receipt.source_sha, 'a'.repeat(40)); + assert.equal(receipt.account_id_sha256.length, 64); + assert.equal(JSON.stringify(receipt).includes(accountId), false); + assert.throws(() => createInitReceipt({ approvedAccountId: accountId, workerId, status: 'created', repository: 'developing.today/code', sourceSha: 'a'.repeat(40), runId: '123456789', runAttempt: 1, event: 'workflow_dispatch', branch: 'main' }), /trusted workflow run metadata/); +}); diff --git a/pm-stack/private-laptop-bridge/cloudflare.config.ts b/pm-stack/private-laptop-bridge/cloudflare.config.ts new file mode 100644 index 0000000000..b65c79d077 --- /dev/null +++ b/pm-stack/private-laptop-bridge/cloudflare.config.ts @@ -0,0 +1,24 @@ +import {bindings, defineConfig} from 'cf/config'; +import * as smoke from './smoke.mjs' with {type:'cf-worker'}; + +export default defineConfig({ + worker: { + name: 'private-laptop-bridge-smoke', + compatibilityDate: '2026-07-30', + workersDev: false, + previewUrls: false, + domains: [], + triggers: [], + limits: {cpuMs: 10}, + observability: {enabled: false, logs: {enabled: false}, traces: {enabled: false}}, + entrypoint: smoke, + env: { + ENABLED: bindings.text('false'), + GATEWAY_HOST: bindings.text('private-bridge-smoke.invalid'), + GATEWAY_ACCOUNT_ID: bindings.text(''), + GATEWAY_POLICY_ID: bindings.text(''), + START_MS: bindings.text(''), + END_MS: bindings.text(''), + }, + }, +}); diff --git a/pm-stack/private-laptop-bridge/package-lock.json b/pm-stack/private-laptop-bridge/package-lock.json new file mode 100644 index 0000000000..06220cd84a --- /dev/null +++ b/pm-stack/private-laptop-bridge/package-lock.json @@ -0,0 +1,2433 @@ +{ + "name": "private-laptop-bridge-smoke", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "private-laptop-bridge-smoke", + "devDependencies": { + "cf": "1.0.0-rc.1", + "wrangler": "4.166.0" + }, + "engines": { + "node": ">=24.22.0" + } + }, + "node_modules/@cloudflare/build-output-utils": { + "version": "1.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@cloudflare/build-output-utils/-/build-output-utils-1.0.0-rc.1.tgz", + "integrity": "sha512-IrzZL1UEdVMZPRarrKu2VpnL3MIeNVhCItTebB88SwQ1YJ4mLAe1kQtXmIH7MpdgDYnxAsTZXMtuw9q5jRWCcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cloudflare/config": "1.0.0-rc.1" + } + }, + "node_modules/@cloudflare/config": { + "version": "1.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@cloudflare/config/-/config-1.0.0-rc.1.tgz", + "integrity": "sha512-NQgB+fQbk8IU0iJ6/G9LCSQjJ7JuyRn5CALrPKnQ8vxqayOJlX+av9adhLCMYBeC80ocncW1Gy7quv00uLV3LQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "zod": "4.6.6" + } + }, + "node_modules/@cloudflare/kv-asset-handler": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.5.1.tgz", + "integrity": "sha512-48OysfSW3MkQY1XjkhkpPkgrEkOvgfoyHzA2eyX5wpzFpijC02uWigv3hkNdJdT3C7ybW/U17yYHXeR68pLeww==", + "dev": true, + "license": "MIT OR Apache-2.0", + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/@cloudflare/runtime-types": { + "version": "0.1.30", + "resolved": "https://registry.npmjs.org/@cloudflare/runtime-types/-/runtime-types-0.1.30.tgz", + "integrity": "sha512-p68T70lDZT7Vyv5c2SDzB0uqVRVCtj/3WMgXVQESnWVyTybcCwXRM9Ekmh2rQ+aPGhtIWiACvd8pX2yGA9Z5mw==", + "dev": true, + "license": "MIT", + "dependencies": { + "miniflare": "5.20261117.0-beta", + "workerd": "1.20261117.1" + } + }, + "node_modules/@cloudflare/runtime-types/node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20261117.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20261117.1.tgz", + "integrity": "sha512-qfAYw6iPoey0BmPsp4z5ARWOa+XSBD3gQzmcBI2ql9pKTSA5eEC8F1oI6BIk/FVguhomfSn5gS4RzbWhTd/EpQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/runtime-types/node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20261117.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20261117.1.tgz", + "integrity": "sha512-cInx5Cr9O27oW+ujyI49lTRQZra/lMgWUFiKmGY3jxDncATSxzfQ6udXHkVvK4//1/PfxQTDyMjdQUIN8m6Aqg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/runtime-types/node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20261117.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20261117.1.tgz", + "integrity": "sha512-gZLA8X11m/luZwn+YA3+mDu61vdxNJzpksP/QZqjydKTQ+VUCulsK5gtn9Bqst1p3KJu2kafQpJ1nDQv4B23jA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/runtime-types/node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20261117.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20261117.1.tgz", + "integrity": "sha512-gxWngFojq41ULKNKb9rpWYvKotN5hT2I/xot+Bpy31cXzrwcTgtDLSMb2t75sW5BJxH7hihFvikgYb577kB3Zg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/runtime-types/node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20261117.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20261117.1.tgz", + "integrity": "sha512-0OR2Btx5EDonOKvvuGDq8rxBSggxoF1ThQjbZN3vsu3GlaF/oXW5f9/iB78OgV0CzMPTi+hZgzc1NR95UJCURA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/runtime-types/node_modules/miniflare": { + "version": "5.20261117.0-beta", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-5.20261117.0-beta.tgz", + "integrity": "sha512-D2ygY04wQUmbpwgBhj828piErZoj7UMlXNGr4EWQp/c1PNGHyYOh0dMIyobjwOXiD5Ifl1EaEVAoNuBHK+qtkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "0.8.1", + "sharp": "0.35.5", + "undici": "7.30.1", + "workerd": "1.20261117.1", + "ws": "8.21.0", + "youch": "4.1.0-beta.10" + }, + "engines": { + "node": ">=22.12.0" + }, + "peerDependencies": { + "kerberos": "^2.0.0" + }, + "peerDependenciesMeta": { + "kerberos": { + "optional": true + } + } + }, + "node_modules/@cloudflare/runtime-types/node_modules/undici": { + "version": "7.30.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.1.tgz", + "integrity": "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, + "node_modules/@cloudflare/runtime-types/node_modules/workerd": { + "version": "1.20261117.1", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20261117.1.tgz", + "integrity": "sha512-iakDbGVtJRiErpWSM5fYT0z3spJ2Mo1x/POsEajBNLqUbTRwm8vMqbB7g8zPN2tzs6eZYNiO5ECyEnAXO9Foxw==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20261117.1", + "@cloudflare/workerd-darwin-arm64": "1.20261117.1", + "@cloudflare/workerd-linux-64": "1.20261117.1", + "@cloudflare/workerd-linux-arm64": "1.20261117.1", + "@cloudflare/workerd-windows-64": "1.20261117.1" + } + }, + "node_modules/@cloudflare/unenv-preset": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.16.2.tgz", + "integrity": "sha512-JBP1+Z7ZSNG/d4mRP+y8VC5dka3tZVMLEZRvS+rzQ4DGV1EoxRFQckcJTTkXbHSQiTj0DtNI01Zwb/V2fX0mvQ==", + "dev": true, + "license": "MIT OR Apache-2.0", + "peerDependencies": { + "unenv": "2.0.0-rc.24", + "workerd": ">1.20260305.0 <2.0.0-0" + }, + "peerDependenciesMeta": { + "workerd": { + "optional": true + } + } + }, + "node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20261119.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20261119.1.tgz", + "integrity": "sha512-yotoiTGXCl1gTRX+y5ZWSAmzAg6CcBJXhJL6C1DGWUhsjjezNe8FdzraNsefVTOeKsOid2EC+hqOzewczKLvmQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20261119.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20261119.1.tgz", + "integrity": "sha512-VPOmfEmMubvw4SPcg/yDgamQXsiVAENgxeCJO8pDggRJFaF93SP0g/hktD8sbfmWBS19BO1kX1EsdgHSgRL9jA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20261119.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20261119.1.tgz", + "integrity": "sha512-aaDf78smiN12Uuwtg6TG6iLVS61sLpy/7DC5PYORf2+TCYw/bygcaqqb8zQJ+XwZ3xYhm/Ws80c/yMMhCMTFYA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20261119.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20261119.1.tgz", + "integrity": "sha512-LkyAvTMcKqRUP73HRScWWwTSz3pw09um1hxR+rcGdvsGzao8IR59XXTp/tul6kFdVBL2mD8U3X6j2O8t7I4viw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20261119.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20261119.1.tgz", + "integrity": "sha512-y4RO3QFNWt4j4uq2kmP5tklTvdA3qOA0PXuA66vsCmEtZYYb71ldefJcq5Dt0jrexKf/i4BBaLXZMVYLnohb0g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workers-utils": { + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-utils/-/workers-utils-0.56.0.tgz", + "integrity": "sha512-Fw3/zR+pQp+5hKn1CHIRkCYz49fyAb2qRqCq01jBGqlKL0rRnZyXYD4j0h9cjaWPYYQUOe5y6L7BNp2ZwsHg5A==", + "dev": true, + "license": "MIT OR Apache-2.0", + "dependencies": { + "@cspotcode/source-map-support": "0.8.1", + "chalk": "5.3.0", + "dotenv": "16.3.1", + "undici": "7.30.2" + }, + "peerDependencies": { + "vitest": "^4.1.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "vitest": { + "optional": true + } + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz", + "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/colour": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.5.tgz", + "integrity": "sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.3.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.5.tgz", + "integrity": "sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.3.4" + } + }, + "node_modules/@img/sharp-freebsd-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.5.tgz", + "integrity": "sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "dependencies": { + "@img/sharp-wasm32": "0.35.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.4.tgz", + "integrity": "sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.4.tgz", + "integrity": "sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.4.tgz", + "integrity": "sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.4.tgz", + "integrity": "sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.4.tgz", + "integrity": "sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.4.tgz", + "integrity": "sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.4.tgz", + "integrity": "sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.4.tgz", + "integrity": "sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.4.tgz", + "integrity": "sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.4.tgz", + "integrity": "sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.5.tgz", + "integrity": "sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.5.tgz", + "integrity": "sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.5.tgz", + "integrity": "sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.5.tgz", + "integrity": "sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.5.tgz", + "integrity": "sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.5.tgz", + "integrity": "sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.3.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.5.tgz", + "integrity": "sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.3.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.5.tgz", + "integrity": "sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.3.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.5.tgz", + "integrity": "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==", + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.11.3" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-webcontainers-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.5.tgz", + "integrity": "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@img/sharp-wasm32": "0.35.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.5.tgz", + "integrity": "sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.5.tgz", + "integrity": "sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.5.tgz", + "integrity": "sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.3.tgz", + "integrity": "sha512-lhTtjtoEArWBjismtfS761S9Hlyn+nIZqOZVYoZ1Xn82PMNMVnk+jj/NhC4fAXGTs7ydONcJiR5vyQBTMDu27g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@poppinss/colors": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz", + "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==", + "dev": true, + "license": "MIT", + "dependencies": { + "kleur": "^4.1.5" + } + }, + "node_modules/@poppinss/dumper": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.5.tgz", + "integrity": "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@poppinss/colors": "^4.1.5", + "@sindresorhus/is": "^7.0.2", + "supports-color": "^10.0.0" + } + }, + "node_modules/@poppinss/exception": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz", + "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sindresorhus/is": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.2.0.tgz", + "integrity": "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@speed-highlight/core": { + "version": "1.2.24", + "resolved": "https://registry.npmjs.org/@speed-highlight/core/-/core-1.2.24.tgz", + "integrity": "sha512-qeW2e1l78afw8VhRPfPQ1Gjj+KU5XFQ/OFV5ti6eTa9bruO7mJyZtA4vw0ofqmA3tKCkROE9xLk3VZoeRc98nw==", + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/@types/node": { + "version": "18.19.130", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.130.tgz", + "integrity": "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/node-fetch": { + "version": "2.6.13", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.13.tgz", + "integrity": "sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "form-data": "^4.0.4" + } + }, + "node_modules/@types/yargs": { + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", + "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, + "license": "MIT", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/agentkeepalive": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", + "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/blake3-wasm": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", + "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==", + "dev": true, + "license": "MIT" + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cf": { + "version": "1.0.0-rc.1", + "resolved": "https://registry.npmjs.org/cf/-/cf-1.0.0-rc.1.tgz", + "integrity": "sha512-mQ9X/FVE1QP2ebXVF/9tlbqoO0TB3tKxUJocaWsic6IuNvThmJc/Ou/4ABJNB/Sj8HxEzvrjT1PRqjySVO5YoA==", + "dev": true, + "license": "MIT OR Apache-2.0", + "dependencies": { + "@cloudflare/build-output-utils": "1.0.0-rc.1", + "@cloudflare/config": "1.0.0-rc.1", + "@cloudflare/runtime-types": "0.1.30", + "blake3-wasm": "2.1.5", + "miniflare": "5.20261117.0-beta" + }, + "bin": { + "cf": "bin/cf", + "cloudflare": "bin/cf" + }, + "engines": { + "node": "^22.23.0 || ^24.22.0 || ^26.12.0" + } + }, + "node_modules/cf/node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20261117.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20261117.1.tgz", + "integrity": "sha512-qfAYw6iPoey0BmPsp4z5ARWOa+XSBD3gQzmcBI2ql9pKTSA5eEC8F1oI6BIk/FVguhomfSn5gS4RzbWhTd/EpQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/cf/node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20261117.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20261117.1.tgz", + "integrity": "sha512-cInx5Cr9O27oW+ujyI49lTRQZra/lMgWUFiKmGY3jxDncATSxzfQ6udXHkVvK4//1/PfxQTDyMjdQUIN8m6Aqg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/cf/node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20261117.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20261117.1.tgz", + "integrity": "sha512-gZLA8X11m/luZwn+YA3+mDu61vdxNJzpksP/QZqjydKTQ+VUCulsK5gtn9Bqst1p3KJu2kafQpJ1nDQv4B23jA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/cf/node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20261117.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20261117.1.tgz", + "integrity": "sha512-gxWngFojq41ULKNKb9rpWYvKotN5hT2I/xot+Bpy31cXzrwcTgtDLSMb2t75sW5BJxH7hihFvikgYb577kB3Zg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/cf/node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20261117.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20261117.1.tgz", + "integrity": "sha512-0OR2Btx5EDonOKvvuGDq8rxBSggxoF1ThQjbZN3vsu3GlaF/oXW5f9/iB78OgV0CzMPTi+hZgzc1NR95UJCURA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/cf/node_modules/miniflare": { + "version": "5.20261117.0-beta", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-5.20261117.0-beta.tgz", + "integrity": "sha512-D2ygY04wQUmbpwgBhj828piErZoj7UMlXNGr4EWQp/c1PNGHyYOh0dMIyobjwOXiD5Ifl1EaEVAoNuBHK+qtkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "0.8.1", + "sharp": "0.35.5", + "undici": "7.30.1", + "workerd": "1.20261117.1", + "ws": "8.21.0", + "youch": "4.1.0-beta.10" + }, + "engines": { + "node": ">=22.12.0" + }, + "peerDependencies": { + "kerberos": "^2.0.0" + }, + "peerDependenciesMeta": { + "kerberos": { + "optional": true + } + } + }, + "node_modules/cf/node_modules/undici": { + "version": "7.30.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.1.tgz", + "integrity": "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, + "node_modules/cf/node_modules/workerd": { + "version": "1.20261117.1", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20261117.1.tgz", + "integrity": "sha512-iakDbGVtJRiErpWSM5fYT0z3spJ2Mo1x/POsEajBNLqUbTRwm8vMqbB7g8zPN2tzs6eZYNiO5ECyEnAXO9Foxw==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20261117.1", + "@cloudflare/workerd-darwin-arm64": "1.20261117.1", + "@cloudflare/workerd-linux-64": "1.20261117.1", + "@cloudflare/workerd-linux-arm64": "1.20261117.1", + "@cloudflare/workerd-windows-64": "1.20261117.1" + } + }, + "node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cloudflare": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cloudflare/-/cloudflare-5.2.0.tgz", + "integrity": "sha512-dVzqDpPFYR9ApEC9e+JJshFJZXcw4HzM8W+3DHzO5oy9+8rLC53G7x6fEf9A7/gSuSCxuvndzui5qJKftfIM9A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/node": "^18.11.18", + "@types/node-fetch": "^2.6.4", + "abort-controller": "^3.0.0", + "agentkeepalive": "^4.2.1", + "form-data-encoder": "1.7.2", + "formdata-node": "^4.3.2", + "node-fetch": "^2.6.7" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/devtools-protocol": { + "version": "0.0.1182435", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1182435.tgz", + "integrity": "sha512-EmlkWb62wSbQNE1gRZZsi4KZYRaF5Skpp183LhRU7+sadKR06O1dHCjZmFSEG6Kv7P6S/UYLxcY3NlYwqKM99w==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/error-stack-parser-es": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/error-stack-parser-es/-/error-stack-parser-es-1.0.5.tgz", + "integrity": "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/form-data": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.4", + "mime-types": "^2.1.35" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/form-data-encoder": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", + "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==", + "dev": true, + "license": "MIT" + }, + "node_modules/formdata-node": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", + "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "node-domexception": "1.0.0", + "web-streams-polyfill": "4.0.0-beta.3" + }, + "engines": { + "node": ">= 12.20" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/miniflare": { + "version": "5.20261119.0-beta", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-5.20261119.0-beta.tgz", + "integrity": "sha512-HdNQIUPgde5Yg0qFaI6iiYd0aOxAgKQTXDstkBN2G1tPBdslNrUKdySwaGdBix0IFd+yh8M0gkqzw68dIZ2Ugw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "0.8.1", + "sharp": "0.35.5", + "undici": "7.30.2", + "workerd": "1.20261119.1", + "ws": "8.21.0", + "youch": "4.1.0-beta.10" + }, + "engines": { + "node": ">=22.12.0" + }, + "peerDependencies": { + "kerberos": "^2.0.0" + }, + "peerDependenciesMeta": { + "kerberos": { + "optional": true + } + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/path-to-regexp": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sharp": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.5.tgz", + "integrity": "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.1.0", + "detect-libc": "^2.1.2", + "semver": "^7.8.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.35.5", + "@img/sharp-darwin-x64": "0.35.5", + "@img/sharp-freebsd-wasm32": "0.35.5", + "@img/sharp-libvips-darwin-arm64": "1.3.4", + "@img/sharp-libvips-darwin-x64": "1.3.4", + "@img/sharp-libvips-linux-arm": "1.3.4", + "@img/sharp-libvips-linux-arm64": "1.3.4", + "@img/sharp-libvips-linux-ppc64": "1.3.4", + "@img/sharp-libvips-linux-riscv64": "1.3.4", + "@img/sharp-libvips-linux-s390x": "1.3.4", + "@img/sharp-libvips-linux-x64": "1.3.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.3.4", + "@img/sharp-libvips-linuxmusl-x64": "1.3.4", + "@img/sharp-linux-arm": "0.35.5", + "@img/sharp-linux-arm64": "0.35.5", + "@img/sharp-linux-ppc64": "0.35.5", + "@img/sharp-linux-riscv64": "0.35.5", + "@img/sharp-linux-s390x": "0.35.5", + "@img/sharp-linux-x64": "0.35.5", + "@img/sharp-linuxmusl-arm64": "0.35.5", + "@img/sharp-linuxmusl-x64": "0.35.5", + "@img/sharp-webcontainers-wasm32": "0.35.5", + "@img/sharp-win32-arm64": "0.35.5", + "@img/sharp-win32-ia32": "0.35.5", + "@img/sharp-win32-x64": "0.35.5" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/supports-color": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", + "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tslib": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz", + "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/undici": { + "version": "7.30.2", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.2.tgz", + "integrity": "sha512-mLyPQnHwUxaM/rideoK/+KL8DaAJLRl4aBCfmX444aCSLnIaomqPLtNRe2jdCYcsk5wZzXrDIQC8ZeYNRAYyIA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true, + "license": "MIT" + }, + "node_modules/unenv": { + "version": "2.0.0-rc.24", + "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.24.tgz", + "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "pathe": "^2.0.3" + } + }, + "node_modules/web-streams-polyfill": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", + "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/workerd": { + "version": "1.20261119.1", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20261119.1.tgz", + "integrity": "sha512-lalSvY+ad5asqMgzA/DfrZo7wvuvOHJc/aS1UctUrwu76fJE/LkSKJlprfBu0LeU79Qai5d+xFooQA9CIfj+dQ==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20261119.1", + "@cloudflare/workerd-darwin-arm64": "1.20261119.1", + "@cloudflare/workerd-linux-64": "1.20261119.1", + "@cloudflare/workerd-linux-arm64": "1.20261119.1", + "@cloudflare/workerd-windows-64": "1.20261119.1" + } + }, + "node_modules/wrangler": { + "version": "4.166.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.166.0.tgz", + "integrity": "sha512-qMz0sHGXqEC0Va8T6dAaG0ggp9tCcuHHYMUQzRKbtZg6+MPAPb6oBu1757IaeugNJHPAz+twHiA+zDyXWQLsLw==", + "dev": true, + "license": "MIT OR Apache-2.0", + "dependencies": { + "@cloudflare/kv-asset-handler": "0.5.1", + "@cloudflare/unenv-preset": "2.16.2", + "@cloudflare/workers-utils": "0.56.0", + "@cspotcode/source-map-support": "0.8.1", + "@types/yargs": "17.0.24", + "cloudflare": "5.2.0", + "devtools-protocol": "0.0.1182435", + "esbuild": "0.28.2", + "miniflare": "5.20261119.0-beta", + "path-to-regexp": "6.3.0", + "undici": "7.30.2", + "unenv": "2.0.0-rc.24", + "workerd": "1.20261119.1" + }, + "bin": { + "cf-wrangler": "bin/cf-wrangler.js", + "wrangler": "bin/wrangler.js", + "wrangler2": "bin/wrangler.js" + }, + "engines": { + "node": ">=22.12.0" + }, + "optionalDependencies": { + "fsevents": "2.3.3" + }, + "peerDependencies": { + "@cloudflare/workers-types": "^5.20261119.1" + }, + "peerDependenciesMeta": { + "@cloudflare/workers-types": { + "optional": true + } + } + }, + "node_modules/ws": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/youch": { + "version": "4.1.0-beta.10", + "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz", + "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@poppinss/colors": "^4.1.5", + "@poppinss/dumper": "^0.6.4", + "@speed-highlight/core": "^1.2.7", + "cookie": "^1.0.2", + "youch-core": "^0.3.3" + } + }, + "node_modules/youch-core": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz", + "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@poppinss/exception": "^1.2.2", + "error-stack-parser-es": "^1.0.5" + } + }, + "node_modules/zod": { + "version": "4.6.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.6.tgz", + "integrity": "sha512-4UmzQUF5fxvfcYHlbjBmejU+w+hbDnWFx4aS8kBx7nPBHcO2SqPbpAG8snbdg+Xse4pRefR98hgjFgIMCI/UhA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/pm-stack/private-laptop-bridge/package.json b/pm-stack/private-laptop-bridge/package.json new file mode 100644 index 0000000000..857d3a763a --- /dev/null +++ b/pm-stack/private-laptop-bridge/package.json @@ -0,0 +1 @@ +{"name":"private-laptop-bridge-smoke","private":true,"type":"module","engines":{"node":">=24.22.0"},"devDependencies":{"cf":"1.0.0-rc.1","wrangler":"4.166.0"}} diff --git a/pm-stack/private-laptop-bridge/smoke-upload.mjs b/pm-stack/private-laptop-bridge/smoke-upload.mjs new file mode 100644 index 0000000000..f899b85621 --- /dev/null +++ b/pm-stack/private-laptop-bridge/smoke-upload.mjs @@ -0,0 +1,231 @@ +#!/usr/bin/env node +// Upload one immutable smoke Worker version and verify it remains unrouted. +import { createHash } from 'node:crypto'; +import { appendFile, readFile, writeFile } from 'node:fs/promises'; +import { API, INIT_WORKFLOW, WORKER_NAME, verifySmokeEmptyTarget, verifySmokePostUpload } from './bootstrap-smoke.mjs'; + +const REPOSITORY = 'developing-today/code'; +export const UPLOAD_WORKFLOW = '.github/workflows/private-laptop-bridge-smoke-upload.yml'; +const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; +const SHA = /^[0-9a-f]{40}$/; +const HASH = /^[0-9a-f]{64}$/; +const fail = message => { throw new Error(message); }; +const hash = value => createHash('sha256').update(value).digest('hex'); +const same = (a, b) => JSON.stringify(a) === JSON.stringify(b); + +function parseJson(value, label) { + try { return typeof value === 'string' ? JSON.parse(value) : value; } + catch { fail(`${label} is not valid JSON`); } +} + +function receiptShape(receipt) { + const expectedKeys = ['account_id_sha256','branch','event','repository','run_attempt','run_id','schema','source_sha','status','worker_id','worker_name','workflow']; + if (!receipt || typeof receipt !== 'object' || Array.isArray(receipt) || !same(Object.keys(receipt).sort(), expectedKeys)) fail('init receipt schema is missing or ambiguous'); + if (receipt.schema !== 1 || receipt.repository !== REPOSITORY || receipt.workflow !== INIT_WORKFLOW || receipt.event !== 'workflow_dispatch' || + receipt.branch !== 'main' || !SHA.test(receipt.source_sha ?? '') || !/^\d{1,20}$/.test(String(receipt.run_id)) || + !Number.isInteger(receipt.run_attempt) || receipt.run_attempt < 1 || !HASH.test(receipt.account_id_sha256 ?? '') || + receipt.worker_name !== WORKER_NAME || !/^[a-f0-9]{32}$/i.test(receipt.worker_id ?? '') || + !['created','already-present'].includes(receipt.status)) fail('init receipt fields do not identify the fixed trusted target'); + return receipt; +} + +export function validateInitReceipt({ receiptJson, runJson, jobsJson, expectedAccountId, currentSha, initRunId }) { + const receipt = receiptShape(parseJson(receiptJson, 'init receipt')); + const run = parseJson(runJson, 'init workflow run'); + const jobsResponse = parseJson(jobsJson, 'init workflow jobs'); + if (!/^[a-f0-9]{32}$/i.test(expectedAccountId ?? '') || !expectedAccountId.toLowerCase().endsWith('cbfa') || + receipt.account_id_sha256 !== hash(expectedAccountId.toLowerCase())) fail('init receipt account does not match protected upload configuration'); + if (!SHA.test(currentSha ?? '') || receipt.source_sha !== currentSha || receipt.run_id !== String(initRunId)) fail('init receipt does not match this exact main dispatch SHA and run ID'); + if (!run || !Number.isSafeInteger(run.id) || String(run.id) !== String(initRunId) || run.run_attempt !== receipt.run_attempt || run.status !== 'completed' || run.conclusion !== 'success' || + run.event !== 'workflow_dispatch' || run.head_branch !== 'main' || run.head_sha !== currentSha || run.path?.split('@')[0] !== INIT_WORKFLOW || + run.repository?.full_name !== REPOSITORY) fail('init receipt is not from the exact successful protected-main workflow run'); + const jobs = jobsResponse?.jobs; + if (!Array.isArray(jobs) || jobsResponse.total_count !== 1 || jobs.length !== 1) fail('init workflow job evidence is missing or ambiguous'); + const job = jobs[0]; + if (job.name !== 'initialize' || job.run_id !== run.id || job.head_sha !== currentSha || job.status !== 'completed' || job.conclusion !== 'success' || !Array.isArray(job.steps)) { + fail('init workflow job is not the exact successful main job'); + } + const steps = new Map(job.steps.map(step => [step.name, step])); + for (const name of ['Run offline bootstrap contract tests','Create only the fixed empty Worker and verify it read-only','Preserve verified smoke initialization receipt']) { + const step = steps.get(name); + if (step?.status !== 'completed' || step?.conclusion !== 'success') fail(`init workflow did not complete required evidence step: ${name}`); + } + return { + workerId: receipt.worker_id.toLowerCase(), + receiptDigest: hash(typeof receiptJson === 'string' ? receiptJson : JSON.stringify(receipt)), + status: receipt.status, + }; +} + +export async function fetchInitRunEvidence({ receiptJson, initRunId, githubToken, fetchImpl = fetch }) { + const receipt = receiptShape(parseJson(receiptJson, 'init receipt')); + if (!/^\d{1,20}$/.test(String(initRunId)) || receipt.run_id !== String(initRunId)) fail('init run ID does not match the receipt'); + if (typeof githubToken !== 'string' || githubToken.length < 20) fail('GitHub read-only token is missing'); + const base = `https://api.github.com/repos/${REPOSITORY}/actions/runs/${encodeURIComponent(initRunId)}`; + async function get(path) { + let response; + try { + response = await fetchImpl(path, { headers: { authorization: `Bearer ${githubToken}`, accept: 'application/vnd.github+json', 'x-github-api-version': '2022-11-28' }, redirect: 'error', signal: AbortSignal.timeout(15_000) }); + } catch { fail('GitHub init-run evidence request failed'); } + if (!response.ok) fail(`GitHub init-run evidence request denied or unavailable (HTTP ${response.status})`); + try { return await response.json(); } catch { fail('GitHub init-run evidence was invalid JSON'); } + } + const run = await get(base); + const jobs = await get(`${base}/attempts/${receipt.run_attempt}/jobs?per_page=100`); + return { run, jobs }; +} + +export function assertDryRunOutput(text) { + const requiredBindings = [ + 'env.ENABLED ("false")', + 'env.GATEWAY_HOST ("private-bridge-smoke.invalid")', + 'env.GATEWAY_ACCOUNT_ID ("")', + 'env.GATEWAY_POLICY_ID ("")', + 'env.START_MS ("")', + 'env.END_MS ("")', + ]; + if (typeof text !== 'string' || !text.includes('--dry-run: exiting now.') || requiredBindings.some(binding => !text.includes(binding))) { + fail('pinned cf prebuilt dry-run did not validate the fixed disabled smoke Worker'); + } + return true; +} + +export function extractUploadedVersion(stdout, { receiptDigest, sourceSha }) { + const body = parseJson(stdout, 'cf version-upload response'); + if (body?.type !== 'version-upload' || body.version !== 1 || body.worker_name !== WORKER_NAME || !UUID.test(body.version_id ?? '')) { + fail('cf version-upload response does not match the pinned exact Worker schema'); + } + if (!SHA.test(sourceSha ?? '') || !HASH.test(receiptDigest ?? '')) fail('upload provenance inputs are invalid'); + return { versionId: body.version_id, message: `init_receipt_sha256=${receiptDigest}` }; +} + +function apiEnvelope(response, body) { + if (!body || typeof body !== 'object' || Array.isArray(body) || !response.ok || body.success !== true || !Object.hasOwn(body, 'result')) { + const status = response.status; + fail(status === 401 || status === 403 ? `Cloudflare verification authorization denied (HTTP ${status})` : `Cloudflare verification request failed (HTTP ${status})`); + } + return { result: body.result, resultInfo: body.result_info }; +} + +export async function readVersions({ accountId, workerId, readToken, fetchImpl = fetch }) { + const rows = []; + let totalCount; + let totalPages; + for (let page = 1; page <= 100; page += 1) { + const url = `${API}/accounts/${encodeURIComponent(accountId)}/workers/workers/${encodeURIComponent(workerId)}/versions?page=${page}&per_page=100`; + let response; + try { response = await fetchImpl(url, { headers: { authorization: `Bearer ${readToken}`, accept: 'application/json' }, redirect: 'error', signal: AbortSignal.timeout(15_000) }); } + catch { fail('Cloudflare version verification request failed; upload result is uncertain'); } + let body; try { body = await response.json(); } catch { fail(`Cloudflare version response is invalid JSON (HTTP ${response.status})`); } + const { result, resultInfo } = apiEnvelope(response, body); + if (!Array.isArray(result)) fail('Cloudflare Beta versions response has an ambiguous result schema'); + rows.push(...result); + if (resultInfo !== undefined) { + if (!resultInfo || typeof resultInfo !== 'object' || Array.isArray(resultInfo)) fail('Cloudflare version pagination metadata is invalid'); + if (resultInfo.page !== undefined && resultInfo.page !== page) fail('Cloudflare version page does not match request'); + if (resultInfo.per_page !== undefined && resultInfo.per_page !== 100) fail('Cloudflare version page size does not match request'); + if (resultInfo.count !== undefined && resultInfo.count !== result.length) fail('Cloudflare version page count is inconsistent'); + if (resultInfo.total_count !== undefined) { + if (!Number.isInteger(resultInfo.total_count) || resultInfo.total_count < 0) fail('Cloudflare version total count is invalid'); + if (totalCount === undefined) totalCount = resultInfo.total_count; + if (totalCount !== resultInfo.total_count) fail('Cloudflare version list changed during pagination'); + } + if (resultInfo.total_pages !== undefined) { + if (!Number.isInteger(resultInfo.total_pages) || resultInfo.total_pages < 0 || resultInfo.total_pages > 100) fail('Cloudflare version total pages is invalid'); + if (totalPages === undefined) totalPages = resultInfo.total_pages; + if (totalPages !== resultInfo.total_pages) fail('Cloudflare version list changed during pagination'); + } + } + if (totalCount !== undefined && rows.length > totalCount) fail('Cloudflare version list exceeded reported total count'); + const doneByPages = totalPages !== undefined && (totalPages === 0 ? page === 1 && rows.length === 0 : page >= totalPages); + const doneByCount = totalCount !== undefined && rows.length === totalCount; + if (doneByPages || doneByCount || (totalPages === undefined && totalCount === undefined && result.length < 100)) { + if (totalCount !== undefined && totalCount !== rows.length) fail('Cloudflare version list is incomplete'); + return rows; + } + if (result.length < 100 && !doneByCount) fail('Cloudflare version list ended before its reported total count'); + } + fail('Cloudflare version pagination exceeded hard bound'); +} + +export function assertExactVersionReadback({ versionId, versions, sourceSha, receiptDigest }) { + if (!UUID.test(versionId ?? '') || !SHA.test(sourceSha ?? '') || !HASH.test(receiptDigest ?? '') || !Array.isArray(versions) || versions.length !== 1) fail('version readback inputs are invalid or the Worker version set is not exactly one'); + const exact = versions.filter(version => version?.id === versionId); + if (exact.length !== 1) fail('server-returned version UUID is absent or ambiguous on the exact Worker'); + const version = exact[0]; + if (version.annotations?.['workers/tag'] !== sourceSha || version.annotations?.['workers/message'] !== `init_receipt_sha256=${receiptDigest}`) { + fail('uploaded Worker version metadata does not bind the exact SHA and init receipt'); + } + if (!Array.isArray(version.urls) || version.urls.length !== 0 || version.hasPreview === true) fail('uploaded Worker version has an unexpected routable or preview URL'); + return true; +} + +function required(name) { + const value = process.env[name]; + if (!value) fail(`required ${name} is missing`); + return value; +} + +async function readJsonFile(path, name) { + try { return await readFile(path, 'utf8'); } catch { fail(`${name} file is unavailable`); } +} + +async function main() { + const [action, ...args] = process.argv.slice(2); + if (action === 'validate-init') { + if (args.length !== 3) fail('usage: validate-init '); + const result = validateInitReceipt({ + receiptJson: await readJsonFile(args[0], 'init receipt'), runJson: await readJsonFile(args[1], 'init run'), jobsJson: await readJsonFile(args[2], 'init jobs'), + expectedAccountId: required('CF_SMOKE_UPLOAD_ACCOUNT_ID'), currentSha: required('GITHUB_SHA'), initRunId: required('INIT_RUN_ID'), + }); + const uploadToken = process.env.CF_SMOKE_UPLOAD_API_TOKEN; + const readToken = process.env.CF_SMOKE_UPLOAD_READ_TOKEN; + if (typeof uploadToken !== 'string' || uploadToken.length < 20 || typeof readToken !== 'string' || readToken.length < 20) fail('smoke upload and read-only credentials are both required'); + if (uploadToken === readToken) fail('smoke upload and read-only credentials must be distinct'); + await appendFile(required('GITHUB_OUTPUT'), `worker_id=${result.workerId}\nreceipt_digest=${result.receiptDigest}\n`); + return; + } + if (action === 'fetch-init') { + if (args.length !== 3) fail('usage: fetch-init '); + const receiptJson = await readJsonFile(args[0], 'init receipt'); + const evidence = await fetchInitRunEvidence({ receiptJson, initRunId: required('INIT_RUN_ID'), githubToken: required('GITHUB_TOKEN') }); + await writeFile(args[1], `${JSON.stringify(evidence.run)}\n`, { flag: 'wx', mode: 0o600 }); + await writeFile(args[2], `${JSON.stringify(evidence.jobs)}\n`, { flag: 'wx', mode: 0o600 }); + return; + } + if (action === 'preflight') { + if (args.length !== 1) fail('usage: preflight '); + const receipt = receiptShape(parseJson(await readJsonFile(args[0], 'init receipt'), 'init receipt')); + const accountId = required('CF_SMOKE_UPLOAD_ACCOUNT_ID'); + if (receipt.account_id_sha256 !== hash(accountId.toLowerCase()) || receipt.source_sha !== required('GITHUB_SHA')) fail('init receipt does not match current upload account or SHA'); + await verifySmokeEmptyTarget({ approvedAccountId: accountId, expectedZoneIds: required('CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS'), readToken: required('CF_SMOKE_UPLOAD_READ_TOKEN'), expectedWorkerId: receipt.worker_id }); + console.log('Smoke target identity, empty version/deployment state, routes and preview settings verified read-only.'); + return; + } + if (action === 'verify-upload') { + if (args.length !== 1) fail('usage: verify-upload '); + const responseText = await readJsonFile(args[0], 'cf upload response'); + const upload = extractUploadedVersion(responseText, { receiptDigest: required('INIT_RECEIPT_DIGEST'), sourceSha: required('GITHUB_SHA') }); + const accountId = required('CF_SMOKE_UPLOAD_ACCOUNT_ID'); + const workerId = required('INIT_WORKER_ID'); + const readToken = required('CF_SMOKE_UPLOAD_READ_TOKEN'); + const versions = await readVersions({ accountId, workerId, readToken }); + assertExactVersionReadback({ versionId: upload.versionId, versions, sourceSha: required('GITHUB_SHA'), receiptDigest: required('INIT_RECEIPT_DIGEST') }); + await verifySmokePostUpload({ approvedAccountId: accountId, expectedZoneIds: required('CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS'), readToken, expectedWorkerId: workerId }); + console.log(`Verified immutable smoke version ${upload.versionId}; no deployment, route or preview was created.`); + return; + } + if (action === 'dry-run') { + if (args.length !== 1) fail('usage: dry-run '); + assertDryRunOutput(await readJsonFile(args[0], 'cf dry-run output')); + return; + } + fail('action must be fetch-init, validate-init, preflight, verify-upload, or dry-run'); +} + +if (process.argv[1] && new URL(import.meta.url).pathname === process.argv[1]) { + main().catch(error => { + console.error(error instanceof Error ? error.message : 'Smoke version upload validation failed'); + process.exitCode = 1; + }); +} diff --git a/pm-stack/private-laptop-bridge/smoke-upload.test.mjs b/pm-stack/private-laptop-bridge/smoke-upload.test.mjs new file mode 100644 index 0000000000..80bf157a9a --- /dev/null +++ b/pm-stack/private-laptop-bridge/smoke-upload.test.mjs @@ -0,0 +1,141 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { + assertDryRunOutput, + assertExactVersionReadback, + extractUploadedVersion, + fetchInitRunEvidence, + readVersions, + validateInitReceipt, +} from './smoke-upload.mjs'; +import { createInitReceipt, verifySmokeEmptyTarget, WORKER_NAME, CREATE_BODY } from './bootstrap-smoke.mjs'; + +const accountId = `${'a'.repeat(28)}cbfa`; +const zoneId = '1'.repeat(32); +const workerId = '0123456789abcdef0123456789abcdef'; +const sourceSha = 'a'.repeat(40); +const receiptDigest = 'b'.repeat(64); +const readToken = 'synthetic-read-token-0000000'; +const ok = (result, resultInfo) => new Response(JSON.stringify({ success: true, result, ...(resultInfo === undefined ? {} : { result_info: resultInfo }) })); +const worker = () => ({ id: workerId, name: WORKER_NAME, logpush: false, observability: { enabled: false }, subdomain: { enabled: false, previews_enabled: false }, deployed_on: null, references: { domains: [] } }); + +function uploadFixture({ versions = [], versionPages, route, deployments = [], workerRecord = worker(), omitMetadata = false } = {}) { + const calls = []; + const fetchImpl = async (url, init = {}) => { + const parsed = new URL(url); + calls.push({ parsed, init }); + if (parsed.pathname === '/client/v4/zones') return ok([{ id: zoneId, account: { id: accountId } }], omitMetadata ? undefined : { total_pages: 1, total_count: 1, page: 1, per_page: 50, count: 1 }); + if (parsed.pathname === `/client/v4/zones/${zoneId}/workers/routes`) return ok(route ? [route] : []); + if (parsed.pathname.endsWith(`/workers/workers/${WORKER_NAME}`)) return ok(workerRecord); + if (parsed.pathname.endsWith(`/workers/scripts/${WORKER_NAME}/deployments`)) return ok({ deployments }); + if (parsed.pathname.endsWith(`/workers/workers/${workerId}/versions`)) { + if (versionPages) { + const page = Number(parsed.searchParams.get('page')); + const result = versionPages[page - 1] ?? []; + return ok(result, omitMetadata ? undefined : { page, per_page: 100, count: result.length, total_count: versionPages.flat().length, total_pages: versionPages.length }); + } + return ok(versions, omitMetadata ? undefined : { page: 1, per_page: 100, count: versions.length, total_count: versions.length, total_pages: versions.length ? 1 : 0 }); + } + throw new Error(`unexpected request ${parsed.pathname}`); + }; + return { calls, fetchImpl }; +} + +function trustedEvidence() { + const receipt = createInitReceipt({ approvedAccountId: accountId, workerId, status: 'created', repository: 'developing-today/code', sourceSha, runId: '123456789', runAttempt: 1, event: 'workflow_dispatch', branch: 'main' }); + const run = { id: 123456789, run_attempt: 1, status: 'completed', conclusion: 'success', event: 'workflow_dispatch', head_branch: 'main', head_sha: sourceSha, path: '.github/workflows/private-laptop-bridge-smoke-init.yml@refs/heads/main', repository: { full_name: 'developing-today/code' } }; + const names = ['Run offline bootstrap contract tests', 'Create only the fixed empty Worker and verify it read-only', 'Preserve verified smoke initialization receipt']; + const jobs = { total_count: 1, jobs: [{ name: 'initialize', run_id: run.id, head_sha: sourceSha, status: 'completed', conclusion: 'success', steps: names.map(name => ({ name, status: 'completed', conclusion: 'success' })) }] }; + return { receiptJson: `${JSON.stringify(receipt)}\n`, run, jobs }; +} + +test('successful init receipt is tied to exact protected main run, attempt, account, and SHA', () => { + const { receiptJson, run, jobs } = trustedEvidence(); + const validated = validateInitReceipt({ receiptJson, runJson: JSON.stringify(run), jobsJson: JSON.stringify(jobs), expectedAccountId: accountId, currentSha: sourceSha, initRunId: '123456789' }); + assert.equal(validated.workerId, workerId); + assert.match(validated.receiptDigest, /^[a-f0-9]{64}$/); + for (const edit of [ + value => { value.run.status = 'in_progress'; }, + value => { value.run.head_sha = 'c'.repeat(40); }, + value => { value.run.event = 'pull_request'; }, + value => { value.run.path = '.github/workflows/other.yml@refs/heads/main'; }, + value => { value.jobs.jobs[0].steps[1].conclusion = 'failure'; }, + ]) { + const evidence = trustedEvidence(); edit(evidence); + assert.throws(() => validateInitReceipt({ receiptJson: evidence.receiptJson, runJson: JSON.stringify(evidence.run), jobsJson: JSON.stringify(evidence.jobs), expectedAccountId: accountId, currentSha: sourceSha, initRunId: '123456789' })); + } + assert.throws(() => validateInitReceipt({ receiptJson, runJson: JSON.stringify(run), jobsJson: JSON.stringify(jobs), expectedAccountId: `${'f'.repeat(28)}cbfa`, currentSha: sourceSha, initRunId: '123456789' }), /account/); + assert.throws(() => validateInitReceipt({ receiptJson, runJson: JSON.stringify(run), jobsJson: JSON.stringify(jobs), expectedAccountId: accountId, currentSha: 'c'.repeat(40), initRunId: '123456789' }), /exact main dispatch SHA/); +}); + +test('init evidence fetch is fixed to repository and receipt attempt', async () => { + const { receiptJson } = trustedEvidence(); + const urls = []; + const evidence = await fetchInitRunEvidence({ receiptJson, initRunId: '123456789', githubToken: 'synthetic-github-token-000000', fetchImpl: async url => { + urls.push(String(url)); + return new Response(JSON.stringify(urls.length === 1 ? { id: 123456789 } : { jobs: [], total_count: 0 })); + } }); + assert.equal(urls[0], 'https://api.github.com/repos/developing-today/code/actions/runs/123456789'); + assert.match(urls[1], /attempts\/1\/jobs\?per_page=100$/); + assert.equal(evidence.jobs.total_count, 0); + await assert.rejects(fetchInitRunEvidence({ receiptJson, initRunId: 'not-an-id', githubToken: 'synthetic-github-token-000000', fetchImpl: async () => new Response('{}') }), /run ID/); +}); + +test('pinned cf dry-run must show the fixed disabled smoke config', () => { + assert.equal(assertDryRunOutput('env.ENABLED ("false")\nenv.GATEWAY_HOST ("private-bridge-smoke.invalid")\nenv.GATEWAY_ACCOUNT_ID ("")\nenv.GATEWAY_POLICY_ID ("")\nenv.START_MS ("")\nenv.END_MS ("")\n--dry-run: exiting now.'), true); + assert.throws(() => assertDryRunOutput('--dry-run: exiting now. private-laptop-bridge-smoke'), /did not validate/); + assert.deepEqual(CREATE_BODY.subdomain, { enabled: false, previews_enabled: false }); +}); + +test('upload response must be the pinned exact version-upload schema and UUID', () => { + const good = extractUploadedVersion(JSON.stringify({ type: 'version-upload', version: 1, worker_name: WORKER_NAME, version_id: '00000000-0000-4000-8000-000000000001' }), { receiptDigest, sourceSha }); + assert.equal(good.versionId, '00000000-0000-4000-8000-000000000001'); + assert.equal(good.message, `init_receipt_sha256=${receiptDigest}`); + for (const response of [ + { type: 'version-upload', version: 1, worker_name: 'wrong', version_id: good.versionId }, + { type: 'version-upload', version: 1, worker_name: WORKER_NAME, version_id: 'latest' }, + { type: 'version-upload', version: 2, worker_name: WORKER_NAME, version_id: good.versionId }, + ]) assert.throws(() => extractUploadedVersion(JSON.stringify(response), { receiptDigest, sourceSha })); +}); + +test('version readback tolerates omitted optional pagination metadata but proves complete list', async () => { + const f = uploadFixture({ versions: [{ id: 'old' }], omitMetadata: true }); + const result = await readVersions({ accountId, workerId, readToken, fetchImpl: f.fetchImpl }); + assert.deepEqual(result, [{ id: 'old' }]); + assert.equal(f.calls.length, 1); + + const pages = uploadFixture({ versionPages: [Array.from({ length: 100 }, (_, index) => ({ id: `v${index}` })), [{ id: 'last' }]] }); + assert.equal((await readVersions({ accountId, workerId, readToken, fetchImpl: pages.fetchImpl })).length, 101); + assert.equal(pages.calls.length, 2); +}); + +test('version pagination mismatch and unavailable readback fail closed', async () => { + const mismatch = uploadFixture(); + mismatch.fetchImpl = async url => new Response(JSON.stringify({ success: true, result: [], result_info: { page: 2, total_count: 0 } })); + await assert.rejects(readVersions({ accountId, workerId, readToken, fetchImpl: mismatch.fetchImpl }), /page does not match/); + await assert.rejects(readVersions({ accountId, workerId, readToken, fetchImpl: async () => new Response('{}', { status: 403 }) }), /authorization denied/); + await assert.rejects(readVersions({ accountId, workerId, readToken, fetchImpl: async () => { throw new Error('offline'); } }), /request failed/); +}); + +test('preflight checks exact unrouted target and rejects identity, route, or existing version state', async () => { + const good = uploadFixture(); + const result = await readVersions({ accountId, workerId, readToken, fetchImpl: good.fetchImpl }); + assert.deepEqual(result, []); + + const wrongWorker = uploadFixture({ workerRecord: { ...worker(), id: 'f'.repeat(32) } }); + await assert.rejects(verifySmokeEmptyTarget({ approvedAccountId: accountId, expectedZoneIds: [zoneId], readToken, expectedWorkerId: workerId, fetchImpl: wrongWorker.fetchImpl }), /identity differs/); + const routed = uploadFixture({ route: { id: 'route', pattern: 'example.invalid/*', script: WORKER_NAME } }); + await assert.rejects(verifySmokeEmptyTarget({ approvedAccountId: accountId, expectedZoneIds: [zoneId], readToken, expectedWorkerId: workerId, fetchImpl: routed.fetchImpl }), /route already targets/); + const nonempty = uploadFixture({ versions: [{ id: 'old' }] }); + await assert.rejects(verifySmokeEmptyTarget({ approvedAccountId: accountId, expectedZoneIds: [zoneId], readToken, expectedWorkerId: workerId, fetchImpl: nonempty.fetchImpl }), /already has a version/); +}); + +test('post-upload proof requires exactly the returned UUID, provenance, no public URLs, and no preview', () => { + const versionId = '00000000-0000-4000-8000-000000000001'; + const valid = { id: versionId, annotations: { 'workers/tag': sourceSha, 'workers/message': `init_receipt_sha256=${receiptDigest}` }, urls: [], hasPreview: false }; + assert.equal(assertExactVersionReadback({ versionId, versions: [valid], sourceSha, receiptDigest }), true); + assert.throws(() => assertExactVersionReadback({ versionId, versions: [valid, { id: 'other' }], sourceSha, receiptDigest }), /version set is not exactly one/); + assert.throws(() => assertExactVersionReadback({ versionId, versions: [{ ...valid, urls: ['https://preview.invalid'] }], sourceSha, receiptDigest }), /routable or preview URL/); + assert.throws(() => assertExactVersionReadback({ versionId, versions: [{ ...valid, hasPreview: true }], sourceSha, receiptDigest }), /routable or preview URL/); + assert.throws(() => assertExactVersionReadback({ versionId, versions: [{ ...valid, annotations: {} }], sourceSha, receiptDigest }), /does not bind/); +}); diff --git a/pm-stack/private-laptop-bridge/smoke.mjs b/pm-stack/private-laptop-bridge/smoke.mjs new file mode 100644 index 0000000000..106bd4df38 --- /dev/null +++ b/pm-stack/private-laptop-bridge/smoke.mjs @@ -0,0 +1,20 @@ +// Stateless Gateway routing rehearsal. No bridge credentials, storage or Fleet data. +import { WorkerEntrypoint } from 'cloudflare:workers'; +const reply = (status) => new Response(status === 200 ? 'private-bridge-smoke-v1\n' : 'denied\n', { + status, headers: {'cache-control':'no-store','content-type':'text/plain','x-content-type-options':'nosniff'} +}); +export class GatewayMiddleware extends WorkerEntrypoint { + async handle(request, context, _next) { + const {ENABLED, GATEWAY_HOST:host, GATEWAY_ACCOUNT_ID:account, GATEWAY_POLICY_ID:policy, START_MS:start, END_MS:end} = this.env; + const now = Date.now(), begins = Number(start), ends = Number(end); + if (ENABLED !== 'true' || !/^\d{13}$/.test(start || '') || !/^\d{13}$/.test(end || '') || ends <= begins || ends - begins > 600000 || now < begins || now >= ends) return reply(503); + if (typeof host !== 'string' || host.length > 253 || host.split('.').some(x => x.length > 63) || !/^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,63}$/.test(host) || !/^[0-9a-f]{32}$/.test(account || '') || !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(policy || '')) return reply(503); + const expected = `https://${host}/smoke/v1`; + if (request.method !== 'GET' || request.url !== expected || request.body !== null || [...request.headers.keys()].some(h => ['authorization','proxy-authorization','cookie','upgrade'].includes(h) || h.startsWith('x-bridge-'))) return reply(403); + if (!context || context.accountId !== account || context.policyId !== policy || context.host !== host || context.uri !== expected || (context.sni !== undefined && context.sni !== host)) return reply(403); + // Gateway policy supplies the approved transport restriction. Service bindings + // could fabricate context and must never be granted to other Workers. + return reply(200); + } +} +export default {fetch() {return reply(403);}}; From 2b01f41f3d66b0c2af17ca595eb3aac5824a672d Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Mon, 23 Nov 2026 01:40:11 +0000 Subject: [PATCH 4/7] Harden smoke Worker upload verification --- .../private-laptop-bridge-smoke-upload.yml | 51 ++++++- .../private-laptop-bridge/smoke-upload.mjs | 140 +++++++++++++++++- .../smoke-upload.test.mjs | 99 ++++++++++++- 3 files changed, 277 insertions(+), 13 deletions(-) diff --git a/.github/workflows/private-laptop-bridge-smoke-upload.yml b/.github/workflows/private-laptop-bridge-smoke-upload.yml index 67c987ca92..8d3e7f885b 100644 --- a/.github/workflows/private-laptop-bridge-smoke-upload.yml +++ b/.github/workflows/private-laptop-bridge-smoke-upload.yml @@ -25,10 +25,6 @@ jobs: timeout-minutes: 15 env: INIT_RUN_ID: ${{ inputs.init_run_id }} - INIT_RECEIPT: ${{ runner.temp }}/init/smoke-init-receipt.json - INIT_RUN_JSON: ${{ runner.temp }}/init-run.json - INIT_JOBS_JSON: ${{ runner.temp }}/init-jobs.json - VERSION_RESPONSE: ${{ runner.temp }}/cf-version-response.json steps: - name: Validate fixed repository, ref, and init run identifier shell: bash @@ -51,6 +47,18 @@ jobs: cache: npm cache-dependency-path: pm-stack/private-laptop-bridge/package-lock.json + - name: Reject inherited Worker target and mode overrides + working-directory: pm-stack/private-laptop-bridge + env: + CLOUDFLARE_CI_OVERRIDE_WORKER_NAME: ${{ vars.CLOUDFLARE_CI_OVERRIDE_WORKER_NAME }} + CF_WORKER_NAME: ${{ vars.CF_WORKER_NAME }} + CLOUDFLARE_WORKER_NAME: ${{ vars.CLOUDFLARE_WORKER_NAME }} + WRANGLER_WORKER_NAME: ${{ vars.WRANGLER_WORKER_NAME }} + CF_MODE: ${{ vars.CF_MODE }} + CLOUDFLARE_ENV: ${{ vars.CLOUDFLARE_ENV }} + WRANGLER_ENV: ${{ vars.WRANGLER_ENV }} + run: node smoke-upload.mjs guard-target-env + - name: Install the exact pinned cf toolchain working-directory: pm-stack/private-laptop-bridge run: npm ci --ignore-scripts --no-audit --no-fund @@ -61,12 +69,31 @@ jobs: - name: Build the fixed disabled smoke artifact working-directory: pm-stack/private-laptop-bridge + env: + CLOUDFLARE_CI_OVERRIDE_WORKER_NAME: '' + CF_WORKER_NAME: '' + CLOUDFLARE_WORKER_NAME: '' + WRANGLER_WORKER_NAME: '' + CF_MODE: '' + CLOUDFLARE_ENV: '' + WRANGLER_ENV: '' run: npx --no-install cf build + - name: Verify the effective Build Output is the fixed private smoke config + working-directory: pm-stack/private-laptop-bridge + run: node smoke-upload.mjs validate-payload .cloudflare/output/v1 + - name: Verify the effective prebuilt payload with cf dry-run working-directory: pm-stack/private-laptop-bridge env: DRY_RUN_OUTPUT: ${{ runner.temp }}/cf-version-dry-run.txt + CLOUDFLARE_CI_OVERRIDE_WORKER_NAME: '' + CF_WORKER_NAME: '' + CLOUDFLARE_WORKER_NAME: '' + WRANGLER_WORKER_NAME: '' + CF_MODE: '' + CLOUDFLARE_ENV: '' + WRANGLER_ENV: '' run: | set -euo pipefail args=(workers versions create --worker private-laptop-bridge-smoke --tag "$GITHUB_SHA" --message "offline smoke validation" --prebuilt --dry-run) @@ -85,6 +112,9 @@ jobs: - name: Fetch exact init run and attempt evidence working-directory: pm-stack/private-laptop-bridge env: + INIT_RECEIPT: ${{ runner.temp }}/init/smoke-init-receipt.json + INIT_RUN_JSON: ${{ runner.temp }}/init-run.json + INIT_JOBS_JSON: ${{ runner.temp }}/init-jobs.json GITHUB_TOKEN: ${{ github.token }} run: node smoke-upload.mjs fetch-init "$INIT_RECEIPT" "$INIT_RUN_JSON" "$INIT_JOBS_JSON" @@ -92,6 +122,9 @@ jobs: id: init working-directory: pm-stack/private-laptop-bridge env: + INIT_RECEIPT: ${{ runner.temp }}/init/smoke-init-receipt.json + INIT_RUN_JSON: ${{ runner.temp }}/init-run.json + INIT_JOBS_JSON: ${{ runner.temp }}/init-jobs.json CF_SMOKE_UPLOAD_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} CF_SMOKE_UPLOAD_API_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_API_TOKEN }} CF_SMOKE_UPLOAD_READ_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_READ_TOKEN }} @@ -100,6 +133,7 @@ jobs: - name: Verify the initialized smoke target and exposure state read-only working-directory: pm-stack/private-laptop-bridge env: + INIT_RECEIPT: ${{ runner.temp }}/init/smoke-init-receipt.json CF_SMOKE_UPLOAD_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} CF_SMOKE_UPLOAD_READ_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_READ_TOKEN }} CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS: ${{ secrets.CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS }} @@ -108,9 +142,17 @@ jobs: - name: Upload one immutable version to the fixed smoke Worker working-directory: pm-stack/private-laptop-bridge env: + VERSION_RESPONSE: ${{ runner.temp }}/cf-version-response.json CF_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} CLOUDFLARE_API_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_API_TOKEN }} + CLOUDFLARE_CI_OVERRIDE_WORKER_NAME: '' + CF_WORKER_NAME: '' + CLOUDFLARE_WORKER_NAME: '' + WRANGLER_WORKER_NAME: '' + CF_MODE: '' + CLOUDFLARE_ENV: '' + WRANGLER_ENV: '' INIT_RECEIPT_DIGEST: ${{ steps.init.outputs.receipt_digest }} WRANGLER_OUTPUT_FILE_PATH: ${{ runner.temp }}/cf-version-response.json run: | @@ -127,6 +169,7 @@ jobs: - name: Read back exact version and prove no serving state changed working-directory: pm-stack/private-laptop-bridge env: + VERSION_RESPONSE: ${{ runner.temp }}/cf-version-response.json CF_SMOKE_UPLOAD_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} CF_SMOKE_UPLOAD_READ_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_READ_TOKEN }} CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS: ${{ secrets.CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS }} diff --git a/pm-stack/private-laptop-bridge/smoke-upload.mjs b/pm-stack/private-laptop-bridge/smoke-upload.mjs index f899b85621..55ce9d27ca 100644 --- a/pm-stack/private-laptop-bridge/smoke-upload.mjs +++ b/pm-stack/private-laptop-bridge/smoke-upload.mjs @@ -1,7 +1,7 @@ #!/usr/bin/env node // Upload one immutable smoke Worker version and verify it remains unrouted. import { createHash } from 'node:crypto'; -import { appendFile, readFile, writeFile } from 'node:fs/promises'; +import { appendFile, readFile, readdir, writeFile } from 'node:fs/promises'; import { API, INIT_WORKFLOW, WORKER_NAME, verifySmokeEmptyTarget, verifySmokePostUpload } from './bootstrap-smoke.mjs'; const REPOSITORY = 'developing-today/code'; @@ -9,6 +9,15 @@ export const UPLOAD_WORKFLOW = '.github/workflows/private-laptop-bridge-smoke-up const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; const SHA = /^[0-9a-f]{40}$/; const HASH = /^[0-9a-f]{64}$/; +const TARGET_OVERRIDE_ENV = [ + 'CLOUDFLARE_CI_OVERRIDE_WORKER_NAME', + 'CF_WORKER_NAME', + 'CLOUDFLARE_WORKER_NAME', + 'WRANGLER_WORKER_NAME', + 'CF_MODE', + 'CLOUDFLARE_ENV', + 'WRANGLER_ENV', +]; const fail = message => { throw new Error(message); }; const hash = value => createHash('sha256').update(value).digest('hex'); const same = (a, b) => JSON.stringify(a) === JSON.stringify(b); @@ -18,6 +27,12 @@ function parseJson(value, label) { catch { fail(`${label} is not valid JSON`); } } +function hasNonemptyPreviewUrl(value) { + return value && typeof value === 'object' && Object.entries(value).some(([key, field]) => + key.toLowerCase().includes('preview') && key.toLowerCase().includes('url') && + field !== undefined && field !== null && field !== '' && (!Array.isArray(field) || field.length !== 0)); +} + function receiptShape(receipt) { const expectedKeys = ['account_id_sha256','branch','event','repository','run_attempt','run_id','schema','source_sha','status','worker_id','worker_name','workflow']; if (!receipt || typeof receipt !== 'object' || Array.isArray(receipt) || !same(Object.keys(receipt).sort(), expectedKeys)) fail('init receipt schema is missing or ambiguous'); @@ -90,9 +105,66 @@ export function assertDryRunOutput(text) { return true; } +export function assertNoTargetOverrides(environment = process.env) { + const set = TARGET_OVERRIDE_ENV.filter(name => typeof environment[name] === 'string' && environment[name] !== ''); + if (set.length) fail(`effective Worker target override variables must be empty: ${set.join(', ')}`); + return true; +} + +export function assertPrebuiltSmokePayload({ buildConfig, workerConfig, workerNames, bundleFiles }) { + const exactKeys = (value, expected) => value && typeof value === 'object' && !Array.isArray(value) && same(Object.keys(value).sort(), [...expected].sort()); + if (!exactKeys(buildConfig, ['producer', 'buildContext']) || !exactKeys(buildConfig.producer, ['name', 'version']) || + buildConfig.producer.name !== 'wrangler' || buildConfig.producer.version !== '4.166.0' || + !exactKeys(buildConfig.buildContext, ['isPreview']) || buildConfig.buildContext.isPreview !== false) { + fail('prebuilt Build Output producer or context is not the pinned non-preview build'); + } + if (!Array.isArray(workerNames) || workerNames.length !== 1 || workerNames[0] !== 'default') fail('prebuilt Build Output must contain only its default Worker'); + const expectedWorkerKeys = ['name','compatibilityDate','domains','triggers','limits','observability','workersDev','previewUrls','env','manifest']; + if (!exactKeys(workerConfig, expectedWorkerKeys) || workerConfig.name !== WORKER_NAME || workerConfig.compatibilityDate !== '2026-07-30' || + !Array.isArray(workerConfig.domains) || workerConfig.domains.length !== 0 || !Array.isArray(workerConfig.triggers) || workerConfig.triggers.length !== 0 || + workerConfig.workersDev !== false || workerConfig.previewUrls !== false || !exactKeys(workerConfig.limits, ['cpuMs']) || workerConfig.limits.cpuMs !== 10 || + !exactKeys(workerConfig.observability, ['enabled','logs','traces']) || workerConfig.observability.enabled !== false || + !exactKeys(workerConfig.observability.logs, ['enabled']) || workerConfig.observability.logs.enabled !== false || + !exactKeys(workerConfig.observability.traces, ['enabled']) || workerConfig.observability.traces.enabled !== false) { + fail('prebuilt Worker config has a changed target or an unexpected route, domain, trigger, preview, telemetry, DO, or binding field'); + } + const env = { + ENABLED: { type: 'text', value: 'false' }, + GATEWAY_HOST: { type: 'text', value: 'private-bridge-smoke.invalid' }, + GATEWAY_ACCOUNT_ID: { type: 'text', value: '' }, + GATEWAY_POLICY_ID: { type: 'text', value: '' }, + START_MS: { type: 'text', value: '' }, + END_MS: { type: 'text', value: '' }, + }; + if (!same(workerConfig.env, env)) fail('prebuilt Worker bindings differ from the fixed disabled smoke fixture'); + const manifest = workerConfig.manifest; + if (!exactKeys(manifest, ['type','mainModule','modules']) || manifest.type !== 'complete' || manifest.mainModule !== 'smoke.js' || + !exactKeys(manifest.modules, ['smoke.js','smoke.js.map']) || manifest.modules['smoke.js']?.type !== 'esm' || manifest.modules['smoke.js.map']?.type !== 'sourcemap') { + fail('prebuilt Worker manifest is not the fixed stateless smoke entrypoint'); + } + if (!Array.isArray(bundleFiles) || !same([...bundleFiles].sort(), ['smoke.js','smoke.js.map'])) fail('prebuilt Worker bundle contains an unexpected module or executable payload'); + return true; +} + +export async function validatePrebuiltSmokeOutput(outputPath) { + let buildConfig; + let workerConfig; + let workerNames; + let bundleFiles; + try { + buildConfig = JSON.parse(await readFile(`${outputPath}/config.json`, 'utf8')); + workerConfig = JSON.parse(await readFile(`${outputPath}/workers/default/worker.config.json`, 'utf8')); + workerNames = await readdir(`${outputPath}/workers`); + bundleFiles = await readdir(`${outputPath}/workers/default/bundle`); + } catch { fail('pinned cf Build Output files are missing or invalid'); } + return assertPrebuiltSmokePayload({ buildConfig, workerConfig, workerNames, bundleFiles }); +} + export function extractUploadedVersion(stdout, { receiptDigest, sourceSha }) { const body = parseJson(stdout, 'cf version-upload response'); - if (body?.type !== 'version-upload' || body.version !== 1 || body.worker_name !== WORKER_NAME || !UUID.test(body.version_id ?? '')) { + if (body?.type !== 'version-upload' || body.version !== 1 || body.worker_name !== WORKER_NAME || body.worker_name_overridden !== false || + (body.wrangler_environment !== undefined && body.wrangler_environment !== null && body.wrangler_environment !== '') || + hasNonemptyPreviewUrl(body) || !UUID.test(body.version_id ?? '')) { fail('cf version-upload response does not match the pinned exact Worker schema'); } if (!SHA.test(sourceSha ?? '') || !HASH.test(receiptDigest ?? '')) fail('upload provenance inputs are invalid'); @@ -148,6 +220,48 @@ export async function readVersions({ accountId, workerId, readToken, fetchImpl = fail('Cloudflare version pagination exceeded hard bound'); } +async function cloudflareRead({ accountId, path, readToken, fetchImpl, label }) { + const url = `${API}/accounts/${encodeURIComponent(accountId)}${path}`; + let response; + try { response = await fetchImpl(url, { headers: { authorization: `Bearer ${readToken}`, accept: 'application/json' }, redirect: 'error', signal: AbortSignal.timeout(15_000) }); } + catch { fail(`Cloudflare ${label} verification request failed`); } + let body; + try { body = await response.json(); } catch { fail(`Cloudflare ${label} response is invalid JSON (HTTP ${response.status})`); } + return apiEnvelope(response, body); +} + +export async function assertLegacyVersionsEmpty({ accountId, readToken, fetchImpl = fetch }) { + const { result, resultInfo } = await cloudflareRead({ accountId, readToken, fetchImpl, label: 'legacy version list', path: `/workers/scripts/${encodeURIComponent(WORKER_NAME)}/versions?per_page=100&page=1` }); + if (!result || typeof result !== 'object' || Array.isArray(result) || !Array.isArray(result.items) || result.items.length !== 0 || + (result.total_count !== undefined && result.total_count !== 0) || (result.count !== undefined && result.count !== 0) || + (resultInfo !== undefined && (!resultInfo || typeof resultInfo !== 'object' || Array.isArray(resultInfo) || + (resultInfo.total_count !== undefined && resultInfo.total_count !== 0) || (resultInfo.count !== undefined && resultInfo.count !== 0) || + (resultInfo.total_pages !== undefined && ![0, 1].includes(resultInfo.total_pages)) || + (resultInfo.page !== undefined && resultInfo.page !== 1) || (resultInfo.per_page !== undefined && resultInfo.per_page !== 100)))) { + fail('legacy Scripts version list is not explicitly empty for the fixed smoke Worker'); + } + return true; +} + +export async function readExactLegacyVersion({ accountId, versionId, readToken, fetchImpl = fetch }) { + return (await cloudflareRead({ accountId, readToken, fetchImpl, label: 'legacy exact version', path: `/workers/scripts/${encodeURIComponent(WORKER_NAME)}/versions/${encodeURIComponent(versionId)}` })).result; +} + +export async function readExactBetaVersion({ accountId, workerId, versionId, readToken, fetchImpl = fetch }) { + return (await cloudflareRead({ accountId, readToken, fetchImpl, label: 'Beta exact version', path: `/workers/workers/${encodeURIComponent(workerId)}/versions/${encodeURIComponent(versionId)}` })).result; +} + +export function assertMatchingLegacyBetaVersions({ legacyVersion, betaVersion, versionId, sourceSha, receiptDigest }) { + const expectedMessage = `init_receipt_sha256=${receiptDigest}`; + for (const [label, version] of [['legacy', legacyVersion], ['Beta', betaVersion]]) { + if (!version || typeof version !== 'object' || Array.isArray(version) || version.id !== versionId || + version.annotations?.['workers/tag'] !== sourceSha || version.annotations?.['workers/message'] !== expectedMessage) { + fail(`${label} exact-version readback does not match the server UUID and provenance`); + } + } + return true; +} + export function assertExactVersionReadback({ versionId, versions, sourceSha, receiptDigest }) { if (!UUID.test(versionId ?? '') || !SHA.test(sourceSha ?? '') || !HASH.test(receiptDigest ?? '') || !Array.isArray(versions) || versions.length !== 1) fail('version readback inputs are invalid or the Worker version set is not exactly one'); const exact = versions.filter(version => version?.id === versionId); @@ -156,7 +270,7 @@ export function assertExactVersionReadback({ versionId, versions, sourceSha, rec if (version.annotations?.['workers/tag'] !== sourceSha || version.annotations?.['workers/message'] !== `init_receipt_sha256=${receiptDigest}`) { fail('uploaded Worker version metadata does not bind the exact SHA and init receipt'); } - if (!Array.isArray(version.urls) || version.urls.length !== 0 || version.hasPreview === true) fail('uploaded Worker version has an unexpected routable or preview URL'); + if (!Array.isArray(version.urls) || version.urls.length !== 0 || version.hasPreview === true || hasNonemptyPreviewUrl(version)) fail('uploaded Worker version has an unexpected routable or preview URL'); return true; } @@ -199,6 +313,7 @@ async function main() { const accountId = required('CF_SMOKE_UPLOAD_ACCOUNT_ID'); if (receipt.account_id_sha256 !== hash(accountId.toLowerCase()) || receipt.source_sha !== required('GITHUB_SHA')) fail('init receipt does not match current upload account or SHA'); await verifySmokeEmptyTarget({ approvedAccountId: accountId, expectedZoneIds: required('CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS'), readToken: required('CF_SMOKE_UPLOAD_READ_TOKEN'), expectedWorkerId: receipt.worker_id }); + await assertLegacyVersionsEmpty({ accountId, readToken: required('CF_SMOKE_UPLOAD_READ_TOKEN') }); console.log('Smoke target identity, empty version/deployment state, routes and preview settings verified read-only.'); return; } @@ -211,8 +326,13 @@ async function main() { const readToken = required('CF_SMOKE_UPLOAD_READ_TOKEN'); const versions = await readVersions({ accountId, workerId, readToken }); assertExactVersionReadback({ versionId: upload.versionId, versions, sourceSha: required('GITHUB_SHA'), receiptDigest: required('INIT_RECEIPT_DIGEST') }); + const [legacyVersion, betaVersion] = await Promise.all([ + readExactLegacyVersion({ accountId, versionId: upload.versionId, readToken }), + readExactBetaVersion({ accountId, workerId, versionId: upload.versionId, readToken }), + ]); + assertMatchingLegacyBetaVersions({ legacyVersion, betaVersion, versionId: upload.versionId, sourceSha: required('GITHUB_SHA'), receiptDigest: required('INIT_RECEIPT_DIGEST') }); await verifySmokePostUpload({ approvedAccountId: accountId, expectedZoneIds: required('CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS'), readToken, expectedWorkerId: workerId }); - console.log(`Verified immutable smoke version ${upload.versionId}; no deployment, route or preview was created.`); + console.log(`Verified immutable smoke version ${upload.versionId} in legacy and Beta APIs; no deployment, route or preview was created.`); return; } if (action === 'dry-run') { @@ -220,7 +340,17 @@ async function main() { assertDryRunOutput(await readJsonFile(args[0], 'cf dry-run output')); return; } - fail('action must be fetch-init, validate-init, preflight, verify-upload, or dry-run'); + if (action === 'guard-target-env') { + if (args.length !== 0) fail('usage: guard-target-env'); + assertNoTargetOverrides(); + return; + } + if (action === 'validate-payload') { + if (args.length !== 1) fail('usage: validate-payload '); + await validatePrebuiltSmokeOutput(args[0]); + return; + } + fail('action must be fetch-init, validate-init, preflight, verify-upload, dry-run, guard-target-env, or validate-payload'); } if (process.argv[1] && new URL(import.meta.url).pathname === process.argv[1]) { diff --git a/pm-stack/private-laptop-bridge/smoke-upload.test.mjs b/pm-stack/private-laptop-bridge/smoke-upload.test.mjs index 80bf157a9a..45eb44532f 100644 --- a/pm-stack/private-laptop-bridge/smoke-upload.test.mjs +++ b/pm-stack/private-laptop-bridge/smoke-upload.test.mjs @@ -1,11 +1,17 @@ import test from 'node:test'; import assert from 'node:assert/strict'; import { + assertLegacyVersionsEmpty, + assertMatchingLegacyBetaVersions, + assertNoTargetOverrides, + assertPrebuiltSmokePayload, assertDryRunOutput, assertExactVersionReadback, extractUploadedVersion, fetchInitRunEvidence, readVersions, + readExactBetaVersion, + readExactLegacyVersion, validateInitReceipt, } from './smoke-upload.mjs'; import { createInitReceipt, verifySmokeEmptyTarget, WORKER_NAME, CREATE_BODY } from './bootstrap-smoke.mjs'; @@ -87,17 +93,101 @@ test('pinned cf dry-run must show the fixed disabled smoke config', () => { assert.deepEqual(CREATE_BODY.subdomain, { enabled: false, previews_enabled: false }); }); +function builtSmokeFixture() { + const env = { + ENABLED: { type: 'text', value: 'false' }, + GATEWAY_HOST: { type: 'text', value: 'private-bridge-smoke.invalid' }, + GATEWAY_ACCOUNT_ID: { type: 'text', value: '' }, + GATEWAY_POLICY_ID: { type: 'text', value: '' }, + START_MS: { type: 'text', value: '' }, + END_MS: { type: 'text', value: '' }, + }; + return { + buildConfig: { producer: { name: 'wrangler', version: '4.166.0' }, buildContext: { isPreview: false } }, + workerNames: ['default'], + bundleFiles: ['smoke.js', 'smoke.js.map'], + workerConfig: { + name: WORKER_NAME, compatibilityDate: '2026-07-30', domains: [], triggers: [], limits: { cpuMs: 10 }, + observability: { enabled: false, logs: { enabled: false }, traces: { enabled: false } }, workersDev: false, previewUrls: false, env, + manifest: { type: 'complete', mainModule: 'smoke.js', modules: { 'smoke.js': { type: 'esm' }, 'smoke.js.map': { type: 'sourcemap' } } }, + }, + }; +} + +test('effective Build Output contract excludes routes, domains, triggers, previews, DOs, and extra executable modules', () => { + const fixture = builtSmokeFixture(); + assert.equal(assertPrebuiltSmokePayload(fixture), true); + for (const mutate of [ + f => { f.workerConfig.domains = [{ hostname: 'public.invalid' }]; }, + f => { f.workerConfig.triggers = [{ cron: '*/1 * * * *' }]; }, + f => { f.workerConfig.routes = [{ pattern: 'public.invalid/*' }]; }, + f => { f.workerConfig.previewUrls = true; }, + f => { f.workerConfig.durable_objects = { bindings: [{ name: 'BRIDGE', class_name: 'Bridge' }] }; }, + f => { f.workerConfig.env.EXTRA = { type: 'service', service: 'other-worker' }; }, + f => { f.workerConfig.manifest.modules['extra.wasm'] = { type: 'compiled-wasm' }; }, + f => { f.buildConfig.buildContext.isPreview = true; }, + f => { f.workerNames.push('other'); }, + ]) { + const changed = structuredClone(fixture); mutate(changed); + assert.throws(() => assertPrebuiltSmokePayload(changed)); + } +}); + +test('inherited target and mode override variables are rejected', () => { + assert.equal(assertNoTargetOverrides({}), true); + for (const name of ['CLOUDFLARE_CI_OVERRIDE_WORKER_NAME','CF_WORKER_NAME','CLOUDFLARE_WORKER_NAME','WRANGLER_WORKER_NAME','CF_MODE','CLOUDFLARE_ENV','WRANGLER_ENV']) { + assert.throws(() => assertNoTargetOverrides({ [name]: 'wrong-target' }), new RegExp(name)); + } +}); + test('upload response must be the pinned exact version-upload schema and UUID', () => { - const good = extractUploadedVersion(JSON.stringify({ type: 'version-upload', version: 1, worker_name: WORKER_NAME, version_id: '00000000-0000-4000-8000-000000000001' }), { receiptDigest, sourceSha }); + const good = extractUploadedVersion(JSON.stringify({ type: 'version-upload', version: 1, worker_name: WORKER_NAME, worker_name_overridden: false, wrangler_environment: null, preview_url: null, preview_alias_url: null, version_id: '00000000-0000-4000-8000-000000000001' }), { receiptDigest, sourceSha }); assert.equal(good.versionId, '00000000-0000-4000-8000-000000000001'); assert.equal(good.message, `init_receipt_sha256=${receiptDigest}`); for (const response of [ - { type: 'version-upload', version: 1, worker_name: 'wrong', version_id: good.versionId }, - { type: 'version-upload', version: 1, worker_name: WORKER_NAME, version_id: 'latest' }, - { type: 'version-upload', version: 2, worker_name: WORKER_NAME, version_id: good.versionId }, + { type: 'version-upload', version: 1, worker_name: 'wrong', worker_name_overridden: false, version_id: good.versionId }, + { type: 'version-upload', version: 1, worker_name: WORKER_NAME, worker_name_overridden: false, version_id: 'latest' }, + { type: 'version-upload', version: 2, worker_name: WORKER_NAME, worker_name_overridden: false, version_id: good.versionId }, + { type: 'version-upload', version: 1, worker_name: WORKER_NAME, worker_name_overridden: true, version_id: good.versionId }, + { type: 'version-upload', version: 1, worker_name: WORKER_NAME, worker_name_overridden: false, preview_url: 'https://preview.invalid', version_id: good.versionId }, + { type: 'version-upload', version: 1, worker_name: WORKER_NAME, worker_name_overridden: false, preview_alias_url: 'https://alias.invalid', version_id: good.versionId }, + { type: 'version-upload', version: 1, worker_name: WORKER_NAME, worker_name_overridden: false, wrangler_environment: 'production', version_id: good.versionId }, ]) assert.throws(() => extractUploadedVersion(JSON.stringify(response), { receiptDigest, sourceSha })); }); +test('legacy scripts version list is empty before upload and pinned to the exact Worker name', async () => { + const seen = []; + const empty = await assertLegacyVersionsEmpty({ accountId, readToken, fetchImpl: async url => { + seen.push(String(url)); return ok({ items: [] }, { total_count: 0, count: 0 }); + } }); + assert.equal(empty, true); + assert.equal(seen[0], `https://api.cloudflare.com/client/v4/accounts/${accountId}/workers/scripts/${WORKER_NAME}/versions?per_page=100&page=1`); + await assert.rejects(assertLegacyVersionsEmpty({ accountId, readToken, fetchImpl: async () => ok({ items: [{ id: 'existing' }] }) }), /not explicitly empty/); + await assert.rejects(assertLegacyVersionsEmpty({ accountId, readToken, fetchImpl: async () => ok({ items: [] }, { total_count: 1 }) }), /not explicitly empty/); + await assert.rejects(assertLegacyVersionsEmpty({ accountId, readToken, fetchImpl: async () => ok({ items: [] }, { page: 2 }) }), /not explicitly empty/); + await assert.rejects(assertLegacyVersionsEmpty({ accountId, readToken, fetchImpl: async () => ok({}) }), /not explicitly empty/); + await assert.rejects(assertLegacyVersionsEmpty({ accountId, readToken, fetchImpl: async () => new Response('{}', { status: 403 }) }), /authorization denied/); +}); + +test('legacy and Beta exact-version GETs must return the same UUID and provenance', async () => { + const versionId = '00000000-0000-4000-8000-000000000001'; + const version = { id: versionId, annotations: { 'workers/tag': sourceSha, 'workers/message': `init_receipt_sha256=${receiptDigest}` } }; + const paths = []; + const fetchImpl = async url => { + const parsed = new URL(url); paths.push(parsed.pathname); + return ok(version); + }; + const [legacy, beta] = await Promise.all([ + readExactLegacyVersion({ accountId, versionId, readToken, fetchImpl }), + readExactBetaVersion({ accountId, workerId, versionId, readToken, fetchImpl }), + ]); + assertMatchingLegacyBetaVersions({ legacyVersion: legacy, betaVersion: beta, versionId, sourceSha, receiptDigest }); + assert.ok(paths.some(path => path.endsWith(`/workers/scripts/${WORKER_NAME}/versions/${versionId}`))); + assert.ok(paths.some(path => path.endsWith(`/workers/workers/${workerId}/versions/${versionId}`))); + assert.throws(() => assertMatchingLegacyBetaVersions({ legacyVersion: legacy, betaVersion: { ...beta, id: '00000000-0000-4000-8000-000000000002' }, versionId, sourceSha, receiptDigest }), /Beta exact-version readback/); + assert.throws(() => assertMatchingLegacyBetaVersions({ legacyVersion: { ...legacy, annotations: {} }, betaVersion: beta, versionId, sourceSha, receiptDigest }), /legacy exact-version readback/); +}); + test('version readback tolerates omitted optional pagination metadata but proves complete list', async () => { const f = uploadFixture({ versions: [{ id: 'old' }], omitMetadata: true }); const result = await readVersions({ accountId, workerId, readToken, fetchImpl: f.fetchImpl }); @@ -136,6 +226,7 @@ test('post-upload proof requires exactly the returned UUID, provenance, no publi assert.equal(assertExactVersionReadback({ versionId, versions: [valid], sourceSha, receiptDigest }), true); assert.throws(() => assertExactVersionReadback({ versionId, versions: [valid, { id: 'other' }], sourceSha, receiptDigest }), /version set is not exactly one/); assert.throws(() => assertExactVersionReadback({ versionId, versions: [{ ...valid, urls: ['https://preview.invalid'] }], sourceSha, receiptDigest }), /routable or preview URL/); + assert.throws(() => assertExactVersionReadback({ versionId, versions: [{ ...valid, preview_url: 'https://preview.invalid' }], sourceSha, receiptDigest }), /routable or preview URL/); assert.throws(() => assertExactVersionReadback({ versionId, versions: [{ ...valid, hasPreview: true }], sourceSha, receiptDigest }), /routable or preview URL/); assert.throws(() => assertExactVersionReadback({ versionId, versions: [{ ...valid, annotations: {} }], sourceSha, receiptDigest }), /does not bind/); }); From 91ca4e20d224186df7fd68714d5c245463758fb4 Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Mon, 23 Nov 2026 01:44:16 +0000 Subject: [PATCH 5/7] Revert "Harden smoke Worker upload verification" This reverts commit 2b01f41f3d66b0c2af17ca595eb3aac5824a672d. --- .../private-laptop-bridge-smoke-upload.yml | 51 +------ .../private-laptop-bridge/smoke-upload.mjs | 140 +----------------- .../smoke-upload.test.mjs | 99 +------------ 3 files changed, 13 insertions(+), 277 deletions(-) diff --git a/.github/workflows/private-laptop-bridge-smoke-upload.yml b/.github/workflows/private-laptop-bridge-smoke-upload.yml index 8d3e7f885b..67c987ca92 100644 --- a/.github/workflows/private-laptop-bridge-smoke-upload.yml +++ b/.github/workflows/private-laptop-bridge-smoke-upload.yml @@ -25,6 +25,10 @@ jobs: timeout-minutes: 15 env: INIT_RUN_ID: ${{ inputs.init_run_id }} + INIT_RECEIPT: ${{ runner.temp }}/init/smoke-init-receipt.json + INIT_RUN_JSON: ${{ runner.temp }}/init-run.json + INIT_JOBS_JSON: ${{ runner.temp }}/init-jobs.json + VERSION_RESPONSE: ${{ runner.temp }}/cf-version-response.json steps: - name: Validate fixed repository, ref, and init run identifier shell: bash @@ -47,18 +51,6 @@ jobs: cache: npm cache-dependency-path: pm-stack/private-laptop-bridge/package-lock.json - - name: Reject inherited Worker target and mode overrides - working-directory: pm-stack/private-laptop-bridge - env: - CLOUDFLARE_CI_OVERRIDE_WORKER_NAME: ${{ vars.CLOUDFLARE_CI_OVERRIDE_WORKER_NAME }} - CF_WORKER_NAME: ${{ vars.CF_WORKER_NAME }} - CLOUDFLARE_WORKER_NAME: ${{ vars.CLOUDFLARE_WORKER_NAME }} - WRANGLER_WORKER_NAME: ${{ vars.WRANGLER_WORKER_NAME }} - CF_MODE: ${{ vars.CF_MODE }} - CLOUDFLARE_ENV: ${{ vars.CLOUDFLARE_ENV }} - WRANGLER_ENV: ${{ vars.WRANGLER_ENV }} - run: node smoke-upload.mjs guard-target-env - - name: Install the exact pinned cf toolchain working-directory: pm-stack/private-laptop-bridge run: npm ci --ignore-scripts --no-audit --no-fund @@ -69,31 +61,12 @@ jobs: - name: Build the fixed disabled smoke artifact working-directory: pm-stack/private-laptop-bridge - env: - CLOUDFLARE_CI_OVERRIDE_WORKER_NAME: '' - CF_WORKER_NAME: '' - CLOUDFLARE_WORKER_NAME: '' - WRANGLER_WORKER_NAME: '' - CF_MODE: '' - CLOUDFLARE_ENV: '' - WRANGLER_ENV: '' run: npx --no-install cf build - - name: Verify the effective Build Output is the fixed private smoke config - working-directory: pm-stack/private-laptop-bridge - run: node smoke-upload.mjs validate-payload .cloudflare/output/v1 - - name: Verify the effective prebuilt payload with cf dry-run working-directory: pm-stack/private-laptop-bridge env: DRY_RUN_OUTPUT: ${{ runner.temp }}/cf-version-dry-run.txt - CLOUDFLARE_CI_OVERRIDE_WORKER_NAME: '' - CF_WORKER_NAME: '' - CLOUDFLARE_WORKER_NAME: '' - WRANGLER_WORKER_NAME: '' - CF_MODE: '' - CLOUDFLARE_ENV: '' - WRANGLER_ENV: '' run: | set -euo pipefail args=(workers versions create --worker private-laptop-bridge-smoke --tag "$GITHUB_SHA" --message "offline smoke validation" --prebuilt --dry-run) @@ -112,9 +85,6 @@ jobs: - name: Fetch exact init run and attempt evidence working-directory: pm-stack/private-laptop-bridge env: - INIT_RECEIPT: ${{ runner.temp }}/init/smoke-init-receipt.json - INIT_RUN_JSON: ${{ runner.temp }}/init-run.json - INIT_JOBS_JSON: ${{ runner.temp }}/init-jobs.json GITHUB_TOKEN: ${{ github.token }} run: node smoke-upload.mjs fetch-init "$INIT_RECEIPT" "$INIT_RUN_JSON" "$INIT_JOBS_JSON" @@ -122,9 +92,6 @@ jobs: id: init working-directory: pm-stack/private-laptop-bridge env: - INIT_RECEIPT: ${{ runner.temp }}/init/smoke-init-receipt.json - INIT_RUN_JSON: ${{ runner.temp }}/init-run.json - INIT_JOBS_JSON: ${{ runner.temp }}/init-jobs.json CF_SMOKE_UPLOAD_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} CF_SMOKE_UPLOAD_API_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_API_TOKEN }} CF_SMOKE_UPLOAD_READ_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_READ_TOKEN }} @@ -133,7 +100,6 @@ jobs: - name: Verify the initialized smoke target and exposure state read-only working-directory: pm-stack/private-laptop-bridge env: - INIT_RECEIPT: ${{ runner.temp }}/init/smoke-init-receipt.json CF_SMOKE_UPLOAD_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} CF_SMOKE_UPLOAD_READ_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_READ_TOKEN }} CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS: ${{ secrets.CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS }} @@ -142,17 +108,9 @@ jobs: - name: Upload one immutable version to the fixed smoke Worker working-directory: pm-stack/private-laptop-bridge env: - VERSION_RESPONSE: ${{ runner.temp }}/cf-version-response.json CF_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} CLOUDFLARE_API_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_API_TOKEN }} - CLOUDFLARE_CI_OVERRIDE_WORKER_NAME: '' - CF_WORKER_NAME: '' - CLOUDFLARE_WORKER_NAME: '' - WRANGLER_WORKER_NAME: '' - CF_MODE: '' - CLOUDFLARE_ENV: '' - WRANGLER_ENV: '' INIT_RECEIPT_DIGEST: ${{ steps.init.outputs.receipt_digest }} WRANGLER_OUTPUT_FILE_PATH: ${{ runner.temp }}/cf-version-response.json run: | @@ -169,7 +127,6 @@ jobs: - name: Read back exact version and prove no serving state changed working-directory: pm-stack/private-laptop-bridge env: - VERSION_RESPONSE: ${{ runner.temp }}/cf-version-response.json CF_SMOKE_UPLOAD_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} CF_SMOKE_UPLOAD_READ_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_READ_TOKEN }} CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS: ${{ secrets.CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS }} diff --git a/pm-stack/private-laptop-bridge/smoke-upload.mjs b/pm-stack/private-laptop-bridge/smoke-upload.mjs index 55ce9d27ca..f899b85621 100644 --- a/pm-stack/private-laptop-bridge/smoke-upload.mjs +++ b/pm-stack/private-laptop-bridge/smoke-upload.mjs @@ -1,7 +1,7 @@ #!/usr/bin/env node // Upload one immutable smoke Worker version and verify it remains unrouted. import { createHash } from 'node:crypto'; -import { appendFile, readFile, readdir, writeFile } from 'node:fs/promises'; +import { appendFile, readFile, writeFile } from 'node:fs/promises'; import { API, INIT_WORKFLOW, WORKER_NAME, verifySmokeEmptyTarget, verifySmokePostUpload } from './bootstrap-smoke.mjs'; const REPOSITORY = 'developing-today/code'; @@ -9,15 +9,6 @@ export const UPLOAD_WORKFLOW = '.github/workflows/private-laptop-bridge-smoke-up const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; const SHA = /^[0-9a-f]{40}$/; const HASH = /^[0-9a-f]{64}$/; -const TARGET_OVERRIDE_ENV = [ - 'CLOUDFLARE_CI_OVERRIDE_WORKER_NAME', - 'CF_WORKER_NAME', - 'CLOUDFLARE_WORKER_NAME', - 'WRANGLER_WORKER_NAME', - 'CF_MODE', - 'CLOUDFLARE_ENV', - 'WRANGLER_ENV', -]; const fail = message => { throw new Error(message); }; const hash = value => createHash('sha256').update(value).digest('hex'); const same = (a, b) => JSON.stringify(a) === JSON.stringify(b); @@ -27,12 +18,6 @@ function parseJson(value, label) { catch { fail(`${label} is not valid JSON`); } } -function hasNonemptyPreviewUrl(value) { - return value && typeof value === 'object' && Object.entries(value).some(([key, field]) => - key.toLowerCase().includes('preview') && key.toLowerCase().includes('url') && - field !== undefined && field !== null && field !== '' && (!Array.isArray(field) || field.length !== 0)); -} - function receiptShape(receipt) { const expectedKeys = ['account_id_sha256','branch','event','repository','run_attempt','run_id','schema','source_sha','status','worker_id','worker_name','workflow']; if (!receipt || typeof receipt !== 'object' || Array.isArray(receipt) || !same(Object.keys(receipt).sort(), expectedKeys)) fail('init receipt schema is missing or ambiguous'); @@ -105,66 +90,9 @@ export function assertDryRunOutput(text) { return true; } -export function assertNoTargetOverrides(environment = process.env) { - const set = TARGET_OVERRIDE_ENV.filter(name => typeof environment[name] === 'string' && environment[name] !== ''); - if (set.length) fail(`effective Worker target override variables must be empty: ${set.join(', ')}`); - return true; -} - -export function assertPrebuiltSmokePayload({ buildConfig, workerConfig, workerNames, bundleFiles }) { - const exactKeys = (value, expected) => value && typeof value === 'object' && !Array.isArray(value) && same(Object.keys(value).sort(), [...expected].sort()); - if (!exactKeys(buildConfig, ['producer', 'buildContext']) || !exactKeys(buildConfig.producer, ['name', 'version']) || - buildConfig.producer.name !== 'wrangler' || buildConfig.producer.version !== '4.166.0' || - !exactKeys(buildConfig.buildContext, ['isPreview']) || buildConfig.buildContext.isPreview !== false) { - fail('prebuilt Build Output producer or context is not the pinned non-preview build'); - } - if (!Array.isArray(workerNames) || workerNames.length !== 1 || workerNames[0] !== 'default') fail('prebuilt Build Output must contain only its default Worker'); - const expectedWorkerKeys = ['name','compatibilityDate','domains','triggers','limits','observability','workersDev','previewUrls','env','manifest']; - if (!exactKeys(workerConfig, expectedWorkerKeys) || workerConfig.name !== WORKER_NAME || workerConfig.compatibilityDate !== '2026-07-30' || - !Array.isArray(workerConfig.domains) || workerConfig.domains.length !== 0 || !Array.isArray(workerConfig.triggers) || workerConfig.triggers.length !== 0 || - workerConfig.workersDev !== false || workerConfig.previewUrls !== false || !exactKeys(workerConfig.limits, ['cpuMs']) || workerConfig.limits.cpuMs !== 10 || - !exactKeys(workerConfig.observability, ['enabled','logs','traces']) || workerConfig.observability.enabled !== false || - !exactKeys(workerConfig.observability.logs, ['enabled']) || workerConfig.observability.logs.enabled !== false || - !exactKeys(workerConfig.observability.traces, ['enabled']) || workerConfig.observability.traces.enabled !== false) { - fail('prebuilt Worker config has a changed target or an unexpected route, domain, trigger, preview, telemetry, DO, or binding field'); - } - const env = { - ENABLED: { type: 'text', value: 'false' }, - GATEWAY_HOST: { type: 'text', value: 'private-bridge-smoke.invalid' }, - GATEWAY_ACCOUNT_ID: { type: 'text', value: '' }, - GATEWAY_POLICY_ID: { type: 'text', value: '' }, - START_MS: { type: 'text', value: '' }, - END_MS: { type: 'text', value: '' }, - }; - if (!same(workerConfig.env, env)) fail('prebuilt Worker bindings differ from the fixed disabled smoke fixture'); - const manifest = workerConfig.manifest; - if (!exactKeys(manifest, ['type','mainModule','modules']) || manifest.type !== 'complete' || manifest.mainModule !== 'smoke.js' || - !exactKeys(manifest.modules, ['smoke.js','smoke.js.map']) || manifest.modules['smoke.js']?.type !== 'esm' || manifest.modules['smoke.js.map']?.type !== 'sourcemap') { - fail('prebuilt Worker manifest is not the fixed stateless smoke entrypoint'); - } - if (!Array.isArray(bundleFiles) || !same([...bundleFiles].sort(), ['smoke.js','smoke.js.map'])) fail('prebuilt Worker bundle contains an unexpected module or executable payload'); - return true; -} - -export async function validatePrebuiltSmokeOutput(outputPath) { - let buildConfig; - let workerConfig; - let workerNames; - let bundleFiles; - try { - buildConfig = JSON.parse(await readFile(`${outputPath}/config.json`, 'utf8')); - workerConfig = JSON.parse(await readFile(`${outputPath}/workers/default/worker.config.json`, 'utf8')); - workerNames = await readdir(`${outputPath}/workers`); - bundleFiles = await readdir(`${outputPath}/workers/default/bundle`); - } catch { fail('pinned cf Build Output files are missing or invalid'); } - return assertPrebuiltSmokePayload({ buildConfig, workerConfig, workerNames, bundleFiles }); -} - export function extractUploadedVersion(stdout, { receiptDigest, sourceSha }) { const body = parseJson(stdout, 'cf version-upload response'); - if (body?.type !== 'version-upload' || body.version !== 1 || body.worker_name !== WORKER_NAME || body.worker_name_overridden !== false || - (body.wrangler_environment !== undefined && body.wrangler_environment !== null && body.wrangler_environment !== '') || - hasNonemptyPreviewUrl(body) || !UUID.test(body.version_id ?? '')) { + if (body?.type !== 'version-upload' || body.version !== 1 || body.worker_name !== WORKER_NAME || !UUID.test(body.version_id ?? '')) { fail('cf version-upload response does not match the pinned exact Worker schema'); } if (!SHA.test(sourceSha ?? '') || !HASH.test(receiptDigest ?? '')) fail('upload provenance inputs are invalid'); @@ -220,48 +148,6 @@ export async function readVersions({ accountId, workerId, readToken, fetchImpl = fail('Cloudflare version pagination exceeded hard bound'); } -async function cloudflareRead({ accountId, path, readToken, fetchImpl, label }) { - const url = `${API}/accounts/${encodeURIComponent(accountId)}${path}`; - let response; - try { response = await fetchImpl(url, { headers: { authorization: `Bearer ${readToken}`, accept: 'application/json' }, redirect: 'error', signal: AbortSignal.timeout(15_000) }); } - catch { fail(`Cloudflare ${label} verification request failed`); } - let body; - try { body = await response.json(); } catch { fail(`Cloudflare ${label} response is invalid JSON (HTTP ${response.status})`); } - return apiEnvelope(response, body); -} - -export async function assertLegacyVersionsEmpty({ accountId, readToken, fetchImpl = fetch }) { - const { result, resultInfo } = await cloudflareRead({ accountId, readToken, fetchImpl, label: 'legacy version list', path: `/workers/scripts/${encodeURIComponent(WORKER_NAME)}/versions?per_page=100&page=1` }); - if (!result || typeof result !== 'object' || Array.isArray(result) || !Array.isArray(result.items) || result.items.length !== 0 || - (result.total_count !== undefined && result.total_count !== 0) || (result.count !== undefined && result.count !== 0) || - (resultInfo !== undefined && (!resultInfo || typeof resultInfo !== 'object' || Array.isArray(resultInfo) || - (resultInfo.total_count !== undefined && resultInfo.total_count !== 0) || (resultInfo.count !== undefined && resultInfo.count !== 0) || - (resultInfo.total_pages !== undefined && ![0, 1].includes(resultInfo.total_pages)) || - (resultInfo.page !== undefined && resultInfo.page !== 1) || (resultInfo.per_page !== undefined && resultInfo.per_page !== 100)))) { - fail('legacy Scripts version list is not explicitly empty for the fixed smoke Worker'); - } - return true; -} - -export async function readExactLegacyVersion({ accountId, versionId, readToken, fetchImpl = fetch }) { - return (await cloudflareRead({ accountId, readToken, fetchImpl, label: 'legacy exact version', path: `/workers/scripts/${encodeURIComponent(WORKER_NAME)}/versions/${encodeURIComponent(versionId)}` })).result; -} - -export async function readExactBetaVersion({ accountId, workerId, versionId, readToken, fetchImpl = fetch }) { - return (await cloudflareRead({ accountId, readToken, fetchImpl, label: 'Beta exact version', path: `/workers/workers/${encodeURIComponent(workerId)}/versions/${encodeURIComponent(versionId)}` })).result; -} - -export function assertMatchingLegacyBetaVersions({ legacyVersion, betaVersion, versionId, sourceSha, receiptDigest }) { - const expectedMessage = `init_receipt_sha256=${receiptDigest}`; - for (const [label, version] of [['legacy', legacyVersion], ['Beta', betaVersion]]) { - if (!version || typeof version !== 'object' || Array.isArray(version) || version.id !== versionId || - version.annotations?.['workers/tag'] !== sourceSha || version.annotations?.['workers/message'] !== expectedMessage) { - fail(`${label} exact-version readback does not match the server UUID and provenance`); - } - } - return true; -} - export function assertExactVersionReadback({ versionId, versions, sourceSha, receiptDigest }) { if (!UUID.test(versionId ?? '') || !SHA.test(sourceSha ?? '') || !HASH.test(receiptDigest ?? '') || !Array.isArray(versions) || versions.length !== 1) fail('version readback inputs are invalid or the Worker version set is not exactly one'); const exact = versions.filter(version => version?.id === versionId); @@ -270,7 +156,7 @@ export function assertExactVersionReadback({ versionId, versions, sourceSha, rec if (version.annotations?.['workers/tag'] !== sourceSha || version.annotations?.['workers/message'] !== `init_receipt_sha256=${receiptDigest}`) { fail('uploaded Worker version metadata does not bind the exact SHA and init receipt'); } - if (!Array.isArray(version.urls) || version.urls.length !== 0 || version.hasPreview === true || hasNonemptyPreviewUrl(version)) fail('uploaded Worker version has an unexpected routable or preview URL'); + if (!Array.isArray(version.urls) || version.urls.length !== 0 || version.hasPreview === true) fail('uploaded Worker version has an unexpected routable or preview URL'); return true; } @@ -313,7 +199,6 @@ async function main() { const accountId = required('CF_SMOKE_UPLOAD_ACCOUNT_ID'); if (receipt.account_id_sha256 !== hash(accountId.toLowerCase()) || receipt.source_sha !== required('GITHUB_SHA')) fail('init receipt does not match current upload account or SHA'); await verifySmokeEmptyTarget({ approvedAccountId: accountId, expectedZoneIds: required('CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS'), readToken: required('CF_SMOKE_UPLOAD_READ_TOKEN'), expectedWorkerId: receipt.worker_id }); - await assertLegacyVersionsEmpty({ accountId, readToken: required('CF_SMOKE_UPLOAD_READ_TOKEN') }); console.log('Smoke target identity, empty version/deployment state, routes and preview settings verified read-only.'); return; } @@ -326,13 +211,8 @@ async function main() { const readToken = required('CF_SMOKE_UPLOAD_READ_TOKEN'); const versions = await readVersions({ accountId, workerId, readToken }); assertExactVersionReadback({ versionId: upload.versionId, versions, sourceSha: required('GITHUB_SHA'), receiptDigest: required('INIT_RECEIPT_DIGEST') }); - const [legacyVersion, betaVersion] = await Promise.all([ - readExactLegacyVersion({ accountId, versionId: upload.versionId, readToken }), - readExactBetaVersion({ accountId, workerId, versionId: upload.versionId, readToken }), - ]); - assertMatchingLegacyBetaVersions({ legacyVersion, betaVersion, versionId: upload.versionId, sourceSha: required('GITHUB_SHA'), receiptDigest: required('INIT_RECEIPT_DIGEST') }); await verifySmokePostUpload({ approvedAccountId: accountId, expectedZoneIds: required('CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS'), readToken, expectedWorkerId: workerId }); - console.log(`Verified immutable smoke version ${upload.versionId} in legacy and Beta APIs; no deployment, route or preview was created.`); + console.log(`Verified immutable smoke version ${upload.versionId}; no deployment, route or preview was created.`); return; } if (action === 'dry-run') { @@ -340,17 +220,7 @@ async function main() { assertDryRunOutput(await readJsonFile(args[0], 'cf dry-run output')); return; } - if (action === 'guard-target-env') { - if (args.length !== 0) fail('usage: guard-target-env'); - assertNoTargetOverrides(); - return; - } - if (action === 'validate-payload') { - if (args.length !== 1) fail('usage: validate-payload '); - await validatePrebuiltSmokeOutput(args[0]); - return; - } - fail('action must be fetch-init, validate-init, preflight, verify-upload, dry-run, guard-target-env, or validate-payload'); + fail('action must be fetch-init, validate-init, preflight, verify-upload, or dry-run'); } if (process.argv[1] && new URL(import.meta.url).pathname === process.argv[1]) { diff --git a/pm-stack/private-laptop-bridge/smoke-upload.test.mjs b/pm-stack/private-laptop-bridge/smoke-upload.test.mjs index 45eb44532f..80bf157a9a 100644 --- a/pm-stack/private-laptop-bridge/smoke-upload.test.mjs +++ b/pm-stack/private-laptop-bridge/smoke-upload.test.mjs @@ -1,17 +1,11 @@ import test from 'node:test'; import assert from 'node:assert/strict'; import { - assertLegacyVersionsEmpty, - assertMatchingLegacyBetaVersions, - assertNoTargetOverrides, - assertPrebuiltSmokePayload, assertDryRunOutput, assertExactVersionReadback, extractUploadedVersion, fetchInitRunEvidence, readVersions, - readExactBetaVersion, - readExactLegacyVersion, validateInitReceipt, } from './smoke-upload.mjs'; import { createInitReceipt, verifySmokeEmptyTarget, WORKER_NAME, CREATE_BODY } from './bootstrap-smoke.mjs'; @@ -93,101 +87,17 @@ test('pinned cf dry-run must show the fixed disabled smoke config', () => { assert.deepEqual(CREATE_BODY.subdomain, { enabled: false, previews_enabled: false }); }); -function builtSmokeFixture() { - const env = { - ENABLED: { type: 'text', value: 'false' }, - GATEWAY_HOST: { type: 'text', value: 'private-bridge-smoke.invalid' }, - GATEWAY_ACCOUNT_ID: { type: 'text', value: '' }, - GATEWAY_POLICY_ID: { type: 'text', value: '' }, - START_MS: { type: 'text', value: '' }, - END_MS: { type: 'text', value: '' }, - }; - return { - buildConfig: { producer: { name: 'wrangler', version: '4.166.0' }, buildContext: { isPreview: false } }, - workerNames: ['default'], - bundleFiles: ['smoke.js', 'smoke.js.map'], - workerConfig: { - name: WORKER_NAME, compatibilityDate: '2026-07-30', domains: [], triggers: [], limits: { cpuMs: 10 }, - observability: { enabled: false, logs: { enabled: false }, traces: { enabled: false } }, workersDev: false, previewUrls: false, env, - manifest: { type: 'complete', mainModule: 'smoke.js', modules: { 'smoke.js': { type: 'esm' }, 'smoke.js.map': { type: 'sourcemap' } } }, - }, - }; -} - -test('effective Build Output contract excludes routes, domains, triggers, previews, DOs, and extra executable modules', () => { - const fixture = builtSmokeFixture(); - assert.equal(assertPrebuiltSmokePayload(fixture), true); - for (const mutate of [ - f => { f.workerConfig.domains = [{ hostname: 'public.invalid' }]; }, - f => { f.workerConfig.triggers = [{ cron: '*/1 * * * *' }]; }, - f => { f.workerConfig.routes = [{ pattern: 'public.invalid/*' }]; }, - f => { f.workerConfig.previewUrls = true; }, - f => { f.workerConfig.durable_objects = { bindings: [{ name: 'BRIDGE', class_name: 'Bridge' }] }; }, - f => { f.workerConfig.env.EXTRA = { type: 'service', service: 'other-worker' }; }, - f => { f.workerConfig.manifest.modules['extra.wasm'] = { type: 'compiled-wasm' }; }, - f => { f.buildConfig.buildContext.isPreview = true; }, - f => { f.workerNames.push('other'); }, - ]) { - const changed = structuredClone(fixture); mutate(changed); - assert.throws(() => assertPrebuiltSmokePayload(changed)); - } -}); - -test('inherited target and mode override variables are rejected', () => { - assert.equal(assertNoTargetOverrides({}), true); - for (const name of ['CLOUDFLARE_CI_OVERRIDE_WORKER_NAME','CF_WORKER_NAME','CLOUDFLARE_WORKER_NAME','WRANGLER_WORKER_NAME','CF_MODE','CLOUDFLARE_ENV','WRANGLER_ENV']) { - assert.throws(() => assertNoTargetOverrides({ [name]: 'wrong-target' }), new RegExp(name)); - } -}); - test('upload response must be the pinned exact version-upload schema and UUID', () => { - const good = extractUploadedVersion(JSON.stringify({ type: 'version-upload', version: 1, worker_name: WORKER_NAME, worker_name_overridden: false, wrangler_environment: null, preview_url: null, preview_alias_url: null, version_id: '00000000-0000-4000-8000-000000000001' }), { receiptDigest, sourceSha }); + const good = extractUploadedVersion(JSON.stringify({ type: 'version-upload', version: 1, worker_name: WORKER_NAME, version_id: '00000000-0000-4000-8000-000000000001' }), { receiptDigest, sourceSha }); assert.equal(good.versionId, '00000000-0000-4000-8000-000000000001'); assert.equal(good.message, `init_receipt_sha256=${receiptDigest}`); for (const response of [ - { type: 'version-upload', version: 1, worker_name: 'wrong', worker_name_overridden: false, version_id: good.versionId }, - { type: 'version-upload', version: 1, worker_name: WORKER_NAME, worker_name_overridden: false, version_id: 'latest' }, - { type: 'version-upload', version: 2, worker_name: WORKER_NAME, worker_name_overridden: false, version_id: good.versionId }, - { type: 'version-upload', version: 1, worker_name: WORKER_NAME, worker_name_overridden: true, version_id: good.versionId }, - { type: 'version-upload', version: 1, worker_name: WORKER_NAME, worker_name_overridden: false, preview_url: 'https://preview.invalid', version_id: good.versionId }, - { type: 'version-upload', version: 1, worker_name: WORKER_NAME, worker_name_overridden: false, preview_alias_url: 'https://alias.invalid', version_id: good.versionId }, - { type: 'version-upload', version: 1, worker_name: WORKER_NAME, worker_name_overridden: false, wrangler_environment: 'production', version_id: good.versionId }, + { type: 'version-upload', version: 1, worker_name: 'wrong', version_id: good.versionId }, + { type: 'version-upload', version: 1, worker_name: WORKER_NAME, version_id: 'latest' }, + { type: 'version-upload', version: 2, worker_name: WORKER_NAME, version_id: good.versionId }, ]) assert.throws(() => extractUploadedVersion(JSON.stringify(response), { receiptDigest, sourceSha })); }); -test('legacy scripts version list is empty before upload and pinned to the exact Worker name', async () => { - const seen = []; - const empty = await assertLegacyVersionsEmpty({ accountId, readToken, fetchImpl: async url => { - seen.push(String(url)); return ok({ items: [] }, { total_count: 0, count: 0 }); - } }); - assert.equal(empty, true); - assert.equal(seen[0], `https://api.cloudflare.com/client/v4/accounts/${accountId}/workers/scripts/${WORKER_NAME}/versions?per_page=100&page=1`); - await assert.rejects(assertLegacyVersionsEmpty({ accountId, readToken, fetchImpl: async () => ok({ items: [{ id: 'existing' }] }) }), /not explicitly empty/); - await assert.rejects(assertLegacyVersionsEmpty({ accountId, readToken, fetchImpl: async () => ok({ items: [] }, { total_count: 1 }) }), /not explicitly empty/); - await assert.rejects(assertLegacyVersionsEmpty({ accountId, readToken, fetchImpl: async () => ok({ items: [] }, { page: 2 }) }), /not explicitly empty/); - await assert.rejects(assertLegacyVersionsEmpty({ accountId, readToken, fetchImpl: async () => ok({}) }), /not explicitly empty/); - await assert.rejects(assertLegacyVersionsEmpty({ accountId, readToken, fetchImpl: async () => new Response('{}', { status: 403 }) }), /authorization denied/); -}); - -test('legacy and Beta exact-version GETs must return the same UUID and provenance', async () => { - const versionId = '00000000-0000-4000-8000-000000000001'; - const version = { id: versionId, annotations: { 'workers/tag': sourceSha, 'workers/message': `init_receipt_sha256=${receiptDigest}` } }; - const paths = []; - const fetchImpl = async url => { - const parsed = new URL(url); paths.push(parsed.pathname); - return ok(version); - }; - const [legacy, beta] = await Promise.all([ - readExactLegacyVersion({ accountId, versionId, readToken, fetchImpl }), - readExactBetaVersion({ accountId, workerId, versionId, readToken, fetchImpl }), - ]); - assertMatchingLegacyBetaVersions({ legacyVersion: legacy, betaVersion: beta, versionId, sourceSha, receiptDigest }); - assert.ok(paths.some(path => path.endsWith(`/workers/scripts/${WORKER_NAME}/versions/${versionId}`))); - assert.ok(paths.some(path => path.endsWith(`/workers/workers/${workerId}/versions/${versionId}`))); - assert.throws(() => assertMatchingLegacyBetaVersions({ legacyVersion: legacy, betaVersion: { ...beta, id: '00000000-0000-4000-8000-000000000002' }, versionId, sourceSha, receiptDigest }), /Beta exact-version readback/); - assert.throws(() => assertMatchingLegacyBetaVersions({ legacyVersion: { ...legacy, annotations: {} }, betaVersion: beta, versionId, sourceSha, receiptDigest }), /legacy exact-version readback/); -}); - test('version readback tolerates omitted optional pagination metadata but proves complete list', async () => { const f = uploadFixture({ versions: [{ id: 'old' }], omitMetadata: true }); const result = await readVersions({ accountId, workerId, readToken, fetchImpl: f.fetchImpl }); @@ -226,7 +136,6 @@ test('post-upload proof requires exactly the returned UUID, provenance, no publi assert.equal(assertExactVersionReadback({ versionId, versions: [valid], sourceSha, receiptDigest }), true); assert.throws(() => assertExactVersionReadback({ versionId, versions: [valid, { id: 'other' }], sourceSha, receiptDigest }), /version set is not exactly one/); assert.throws(() => assertExactVersionReadback({ versionId, versions: [{ ...valid, urls: ['https://preview.invalid'] }], sourceSha, receiptDigest }), /routable or preview URL/); - assert.throws(() => assertExactVersionReadback({ versionId, versions: [{ ...valid, preview_url: 'https://preview.invalid' }], sourceSha, receiptDigest }), /routable or preview URL/); assert.throws(() => assertExactVersionReadback({ versionId, versions: [{ ...valid, hasPreview: true }], sourceSha, receiptDigest }), /routable or preview URL/); assert.throws(() => assertExactVersionReadback({ versionId, versions: [{ ...valid, annotations: {} }], sourceSha, receiptDigest }), /does not bind/); }); From de5a9688d48a5ba00ad328d2c89426f9996bf82a Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Mon, 23 Nov 2026 01:44:16 +0000 Subject: [PATCH 6/7] Revert "Add isolated smoke versions upload workflow" This reverts commit b66e0e0e619c05353d762e425df25b31c3c80bae. --- .../private-laptop-bridge-smoke-init.yml | 8 - .../private-laptop-bridge-smoke-upload.yml | 135 - .../private-laptop-bridge/bootstrap-smoke.mjs | 145 +- .../bootstrap-smoke.test.mjs | 44 +- .../cloudflare.config.ts | 24 - .../private-laptop-bridge/package-lock.json | 2433 ----------------- pm-stack/private-laptop-bridge/package.json | 1 - .../private-laptop-bridge/smoke-upload.mjs | 231 -- .../smoke-upload.test.mjs | 141 - pm-stack/private-laptop-bridge/smoke.mjs | 20 - 10 files changed, 39 insertions(+), 3143 deletions(-) delete mode 100644 .github/workflows/private-laptop-bridge-smoke-upload.yml delete mode 100644 pm-stack/private-laptop-bridge/cloudflare.config.ts delete mode 100644 pm-stack/private-laptop-bridge/package-lock.json delete mode 100644 pm-stack/private-laptop-bridge/package.json delete mode 100644 pm-stack/private-laptop-bridge/smoke-upload.mjs delete mode 100644 pm-stack/private-laptop-bridge/smoke-upload.test.mjs delete mode 100644 pm-stack/private-laptop-bridge/smoke.mjs diff --git a/.github/workflows/private-laptop-bridge-smoke-init.yml b/.github/workflows/private-laptop-bridge-smoke-init.yml index 29d68e466b..afc10c4151 100644 --- a/.github/workflows/private-laptop-bridge-smoke-init.yml +++ b/.github/workflows/private-laptop-bridge-smoke-init.yml @@ -37,12 +37,4 @@ jobs: CF_SMOKE_INIT_EXPECTED_ZONE_IDS: ${{ secrets.CF_SMOKE_INIT_EXPECTED_ZONE_IDS }} CF_SMOKE_INIT_WRITE_TOKEN: ${{ secrets.CF_SMOKE_INIT_WRITE_TOKEN }} CF_SMOKE_INIT_READ_TOKEN: ${{ secrets.CF_SMOKE_INIT_READ_TOKEN }} - BOOTSTRAP_RECEIPT_PATH: ${{ runner.temp }}/smoke-init-receipt.json run: node pm-stack/private-laptop-bridge/bootstrap-smoke.mjs - - name: Preserve verified smoke initialization receipt - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - with: - name: private-laptop-smoke-init-${{ github.run_id }} - path: ${{ runner.temp }}/smoke-init-receipt.json - if-no-files-found: error - retention-days: 14 diff --git a/.github/workflows/private-laptop-bridge-smoke-upload.yml b/.github/workflows/private-laptop-bridge-smoke-upload.yml deleted file mode 100644 index 67c987ca92..0000000000 --- a/.github/workflows/private-laptop-bridge-smoke-upload.yml +++ /dev/null @@ -1,135 +0,0 @@ -name: Upload private laptop bridge smoke version - -on: - workflow_dispatch: - inputs: - init_run_id: - description: Successful private-laptop-bridge-smoke-init run on this exact main commit - required: true - type: string - -permissions: - contents: read - actions: read - -concurrency: - group: private-laptop-bridge-smoke-upload - cancel-in-progress: false - -jobs: - upload: - if: github.repository == 'developing-today/code' && github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' - # Configure required reviewers and main-only rules outside the repository. - environment: cloudflare-smoke-upload - runs-on: ubuntu-24.04 - timeout-minutes: 15 - env: - INIT_RUN_ID: ${{ inputs.init_run_id }} - INIT_RECEIPT: ${{ runner.temp }}/init/smoke-init-receipt.json - INIT_RUN_JSON: ${{ runner.temp }}/init-run.json - INIT_JOBS_JSON: ${{ runner.temp }}/init-jobs.json - VERSION_RESPONSE: ${{ runner.temp }}/cf-version-response.json - steps: - - name: Validate fixed repository, ref, and init run identifier - shell: bash - run: | - set -euo pipefail - [[ "$GITHUB_REPOSITORY" == developing-today/code ]] - [[ "$GITHUB_REF" == refs/heads/main ]] - [[ "$GITHUB_EVENT_NAME" == workflow_dispatch ]] - [[ "$INIT_RUN_ID" =~ ^[0-9]{1,20}$ ]] - - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - ref: ${{ github.sha }} - fetch-depth: 1 - persist-credentials: false - - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version: 24.22.0 - cache: npm - cache-dependency-path: pm-stack/private-laptop-bridge/package-lock.json - - - name: Install the exact pinned cf toolchain - working-directory: pm-stack/private-laptop-bridge - run: npm ci --ignore-scripts --no-audit --no-fund - - - name: Run offline smoke and provenance contracts - working-directory: pm-stack/private-laptop-bridge - run: node --test --test-reporter=spec bootstrap-smoke.test.mjs smoke-upload.test.mjs - - - name: Build the fixed disabled smoke artifact - working-directory: pm-stack/private-laptop-bridge - run: npx --no-install cf build - - - name: Verify the effective prebuilt payload with cf dry-run - working-directory: pm-stack/private-laptop-bridge - env: - DRY_RUN_OUTPUT: ${{ runner.temp }}/cf-version-dry-run.txt - run: | - set -euo pipefail - args=(workers versions create --worker private-laptop-bridge-smoke --tag "$GITHUB_SHA" --message "offline smoke validation" --prebuilt --dry-run) - npx --no-install cf -q "${args[@]}" 2>&1 | tee "$DRY_RUN_OUTPUT" - node smoke-upload.mjs dry-run "$DRY_RUN_OUTPUT" - - - name: Download the receipt from the selected init run - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - with: - name: private-laptop-smoke-init-${{ inputs.init_run_id }} - path: ${{ runner.temp }}/init - repository: developing-today/code - run-id: ${{ inputs.init_run_id }} - github-token: ${{ github.token }} - - - name: Fetch exact init run and attempt evidence - working-directory: pm-stack/private-laptop-bridge - env: - GITHUB_TOKEN: ${{ github.token }} - run: node smoke-upload.mjs fetch-init "$INIT_RECEIPT" "$INIT_RUN_JSON" "$INIT_JOBS_JSON" - - - name: Validate init receipt and trusted workflow provenance - id: init - working-directory: pm-stack/private-laptop-bridge - env: - CF_SMOKE_UPLOAD_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} - CF_SMOKE_UPLOAD_API_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_API_TOKEN }} - CF_SMOKE_UPLOAD_READ_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_READ_TOKEN }} - run: node smoke-upload.mjs validate-init "$INIT_RECEIPT" "$INIT_RUN_JSON" "$INIT_JOBS_JSON" - - - name: Verify the initialized smoke target and exposure state read-only - working-directory: pm-stack/private-laptop-bridge - env: - CF_SMOKE_UPLOAD_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} - CF_SMOKE_UPLOAD_READ_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_READ_TOKEN }} - CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS: ${{ secrets.CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS }} - run: node smoke-upload.mjs preflight "$INIT_RECEIPT" - - - name: Upload one immutable version to the fixed smoke Worker - working-directory: pm-stack/private-laptop-bridge - env: - CF_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} - CLOUDFLARE_API_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_API_TOKEN }} - INIT_RECEIPT_DIGEST: ${{ steps.init.outputs.receipt_digest }} - WRANGLER_OUTPUT_FILE_PATH: ${{ runner.temp }}/cf-version-response.json - run: | - set -euo pipefail - rm -f "$VERSION_RESPONSE" - message="init_receipt_sha256=${INIT_RECEIPT_DIGEST}" - npx --no-install cf -q workers versions create \ - --worker private-laptop-bridge-smoke \ - --tag "$GITHUB_SHA" \ - --message "$message" \ - --prebuilt - test -s "$VERSION_RESPONSE" - - - name: Read back exact version and prove no serving state changed - working-directory: pm-stack/private-laptop-bridge - env: - CF_SMOKE_UPLOAD_ACCOUNT_ID: ${{ secrets.CF_SMOKE_UPLOAD_ACCOUNT_ID }} - CF_SMOKE_UPLOAD_READ_TOKEN: ${{ secrets.CF_SMOKE_UPLOAD_READ_TOKEN }} - CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS: ${{ secrets.CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS }} - INIT_WORKER_ID: ${{ steps.init.outputs.worker_id }} - INIT_RECEIPT_DIGEST: ${{ steps.init.outputs.receipt_digest }} - run: node smoke-upload.mjs verify-upload "$VERSION_RESPONSE" diff --git a/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs b/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs index 88a7065222..ca3a0f2e4b 100644 --- a/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs +++ b/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs @@ -1,13 +1,10 @@ #!/usr/bin/env node // Create the smoke Worker metadata object only. No script/version/deployment, // routes, domains, workers.dev setting changes, or settings updates are made. -import { createHash } from 'node:crypto'; -import { writeFile } from 'node:fs/promises'; export const API = 'https://api.cloudflare.com/client/v4'; export const ACCOUNT_SUFFIX = 'cbfa'; export const WORKER_NAME = 'private-laptop-bridge-smoke'; -export const INIT_WORKFLOW = '.github/workflows/private-laptop-bridge-smoke-init.yml'; const PAGE_SIZE = 50; const VERSION_PAGE_SIZE = 100; @@ -100,37 +97,23 @@ function assertWorker(worker) { async function listAll(fetchImpl, accountId, readToken, pathname, pageSize, params = {}) { const all = []; let expectedTotal; - let expectedPages; for (let page = 1; page <= 100; page += 1) { const query = new URLSearchParams({ ...params, page: String(page), per_page: String(pageSize) }); const { result, resultInfo } = await request(fetchImpl, accountId, readToken, `${pathname}?${query}`); if (!Array.isArray(result)) fail('Cloudflare list response was not an array'); all.push(...result); - if (resultInfo !== undefined) { - if (!resultInfo || typeof resultInfo !== 'object' || Array.isArray(resultInfo)) fail('Cloudflare pagination metadata is invalid'); - if (resultInfo.page !== undefined && resultInfo.page !== page) fail('Cloudflare pagination page does not match the request'); - if (resultInfo.per_page !== undefined && resultInfo.per_page !== pageSize) fail('Cloudflare pagination size does not match the request'); - if (resultInfo.count !== undefined && resultInfo.count !== result.length) fail('Cloudflare pagination item count is inconsistent'); - if (resultInfo.total_count !== undefined) { - if (!Number.isInteger(resultInfo.total_count) || resultInfo.total_count < 0) fail('Cloudflare pagination total count is invalid'); - if (expectedTotal === undefined) expectedTotal = resultInfo.total_count; - if (resultInfo.total_count !== expectedTotal) fail('Cloudflare list changed during pagination'); - } - if (resultInfo.total_pages !== undefined) { - if (!Number.isInteger(resultInfo.total_pages) || resultInfo.total_pages < 0 || resultInfo.total_pages > 100) fail('Cloudflare pagination total pages is invalid'); - if (expectedPages === undefined) expectedPages = resultInfo.total_pages; - if (resultInfo.total_pages !== expectedPages) fail('Cloudflare list changed during pagination'); - } + if (!resultInfo || !Number.isInteger(resultInfo.total_pages) || resultInfo.total_pages < 0 || resultInfo.total_pages > 100 || + !Number.isInteger(resultInfo.total_count) || resultInfo.total_count < 0) { + fail('Cloudflare pagination metadata is missing or invalid'); } - if (expectedTotal !== undefined && all.length > expectedTotal) fail('Cloudflare list exceeded its reported total count'); - const completeByPages = expectedPages !== undefined && (expectedPages === 0 ? page === 1 && all.length === 0 : page >= expectedPages); - const completeByCount = expectedTotal !== undefined && all.length === expectedTotal; - const completeByShortPage = result.length < pageSize; - if (completeByPages || completeByCount || (expectedPages === undefined && expectedTotal === undefined && completeByShortPage)) { - if (expectedTotal !== undefined && all.length !== expectedTotal) fail('Cloudflare list did not return its complete item count'); + if (expectedTotal === undefined) expectedTotal = resultInfo.total_count; + if (resultInfo.total_count !== expectedTotal) fail('Cloudflare list changed during pagination'); + if (resultInfo.total_pages === 0 && page === 1 && expectedTotal === 0 && all.length === 0) return all; + if (resultInfo.total_pages < page) fail('Cloudflare pagination metadata is missing or invalid'); + if (page >= resultInfo.total_pages) { + if (all.length !== expectedTotal) fail('Cloudflare list did not return its complete item count'); return all; } - if (result.length < pageSize && !completeByCount) fail('Cloudflare list ended before its reported total count'); } fail('Cloudflare pagination exceeded the hard page bound'); } @@ -163,29 +146,22 @@ async function listZones(fetchImpl, accountId, readToken, expectedZoneIds) { pageIds.add(id); } all.push(...result); - if (resultInfo !== undefined) { - if (!resultInfo || typeof resultInfo !== 'object' || Array.isArray(resultInfo)) fail('Cloudflare zone pagination metadata is invalid'); - if (resultInfo.page !== undefined && resultInfo.page !== page) fail('Cloudflare zone page does not match the request'); - if (resultInfo.per_page !== undefined && resultInfo.per_page !== PAGE_SIZE) fail('Cloudflare zone page size does not match the request'); - if (resultInfo.count !== undefined && resultInfo.count !== result.length) fail('Cloudflare zone page count is inconsistent'); - if (resultInfo.total_count !== undefined) { - if (!Number.isInteger(resultInfo.total_count) || resultInfo.total_count !== expectedZoneIds.length) fail('Cloudflare zone total count differs from approved inventory'); - if (expectedTotal === undefined) expectedTotal = resultInfo.total_count; - if (resultInfo.total_count !== expectedTotal) fail('Cloudflare zone inventory changed during pagination'); - } - if (resultInfo.total_pages !== undefined) { - if (!Number.isInteger(resultInfo.total_pages) || resultInfo.total_pages < 0 || resultInfo.total_pages > 100) fail('Cloudflare zone total pages is invalid'); - if (resultInfo.total_pages > 0 && expectedZoneIds.length > 0 && resultInfo.total_pages !== Math.ceil(expectedZoneIds.length / PAGE_SIZE)) fail('Cloudflare zone total pages differs from approved inventory'); - if (expectedPages === undefined) expectedPages = resultInfo.total_pages; - if (resultInfo.total_pages !== expectedPages) fail('Cloudflare zone inventory changed during pagination'); - } + if (!resultInfo || resultInfo.page !== page || resultInfo.per_page !== PAGE_SIZE || + !Number.isInteger(resultInfo.total_pages) || resultInfo.total_pages < 0 || resultInfo.total_pages > 100 || + !Number.isInteger(resultInfo.total_count) || resultInfo.total_count !== expectedZoneIds.length || + (resultInfo.total_count > 0 && resultInfo.total_pages !== Math.ceil(resultInfo.total_count / PAGE_SIZE)) || + (resultInfo.count !== undefined && resultInfo.count !== result.length)) { + fail('Cloudflare zone pagination metadata is missing or invalid'); + } + if (expectedTotal === undefined) expectedTotal = resultInfo.total_count; + if (expectedPages === undefined) expectedPages = resultInfo.total_pages; + if (resultInfo.total_count !== expectedTotal || resultInfo.total_pages !== expectedPages) fail('Cloudflare zone inventory changed during pagination'); + if ((resultInfo.total_pages === 0 || resultInfo.total_pages === 1) && page === 1 && expectedTotal === 0 && all.length === 0) return all; + if (resultInfo.total_pages < page) fail('Cloudflare zone pagination metadata is missing or invalid'); + if (page >= resultInfo.total_pages) { + if (all.length !== expectedTotal) fail('Cloudflare zone inventory is incomplete'); + return all; } - if (all.length > expectedZoneIds.length) fail('Cloudflare zone inventory exceeds approved inventory'); - const completeByCount = all.length === expectedZoneIds.length; - const completeByPages = expectedPages !== undefined && (expectedPages === 0 ? page === 1 && all.length === 0 : page >= expectedPages); - if (completeByCount && (expectedPages === undefined || completeByPages)) return all; - if (result.length < PAGE_SIZE && !completeByCount) fail('Cloudflare zone inventory ended before all approved zones were returned'); - if (expectedPages !== undefined && page >= expectedPages && !completeByCount) fail('Cloudflare zone inventory is incomplete'); } fail('Cloudflare zone pagination exceeded the hard page bound'); } @@ -213,10 +189,6 @@ async function assertNoRoutes(fetchImpl, accountId, readToken, expectedZoneIds) async function assertNoVersionsAndDeployments(fetchImpl, accountId, readToken, workerId) { const versions = await listAll(fetchImpl, accountId, readToken, `/workers/workers/${encodeURIComponent(workerId)}/versions`, VERSION_PAGE_SIZE); if (versions.length !== 0) fail('Smoke Worker already has a version; no upload or deployment was attempted'); - await assertNoDeployments(fetchImpl, accountId, readToken); -} - -async function assertNoDeployments(fetchImpl, accountId, readToken) { const { result, resultInfo } = await request(fetchImpl, accountId, readToken, `/workers/scripts/${encodeURIComponent(WORKER_NAME)}/deployments?page=1&per_page=100`); if (!result || typeof result !== 'object' || Array.isArray(result) || !Object.hasOwn(result, 'deployments') || !Array.isArray(result.deployments) || result.deployments.length !== 0 || @@ -230,52 +202,6 @@ async function readWorker(fetchImpl, accountId, readToken) { return response.absent ? null : assertWorker(response.result); } -export async function verifySmokeEmptyTarget({ approvedAccountId, readToken, expectedZoneIds, expectedWorkerId, fetchImpl = fetch }) { - if (!/^[a-f0-9]{32}$/i.test(approvedAccountId ?? '') || !approvedAccountId.toLowerCase().endsWith(ACCOUNT_SUFFIX)) fail('approved account configuration is missing or invalid'); - if (typeof readToken !== 'string' || readToken.length < 20) fail('bootstrap read-only credential is missing'); - const zones = parseExpectedZoneIds(expectedZoneIds); - const worker = await readWorker(fetchImpl, approvedAccountId, readToken); - if (!worker) fail('Smoke Worker is not initialized; no upload was attempted'); - if (expectedWorkerId !== undefined && worker.id !== expectedWorkerId) fail('Smoke Worker identity differs from the initialization receipt'); - await assertNoRoutes(fetchImpl, approvedAccountId, readToken, zones); - await assertNoVersionsAndDeployments(fetchImpl, approvedAccountId, readToken, worker.id); - return { workerId: worker.id, workerName: worker.name }; -} - -export async function verifySmokePostUpload({ approvedAccountId, readToken, expectedZoneIds, expectedWorkerId, fetchImpl = fetch }) { - if (!/^[a-f0-9]{32}$/i.test(approvedAccountId ?? '') || !approvedAccountId.toLowerCase().endsWith(ACCOUNT_SUFFIX)) fail('approved account configuration is missing or invalid'); - if (typeof readToken !== 'string' || readToken.length < 20) fail('bootstrap read-only credential is missing'); - const zones = parseExpectedZoneIds(expectedZoneIds); - const worker = await readWorker(fetchImpl, approvedAccountId, readToken); - if (!worker) fail('Smoke Worker disappeared after version upload'); - if (expectedWorkerId !== undefined && worker.id !== expectedWorkerId) fail('Smoke Worker identity changed after version upload'); - await assertNoRoutes(fetchImpl, approvedAccountId, readToken, zones); - await assertNoDeployments(fetchImpl, approvedAccountId, readToken); - return { workerId: worker.id, workerName: worker.name }; -} - -export function createInitReceipt({ approvedAccountId, workerId, status, repository, sourceSha, runId, runAttempt, event, branch }) { - if (!/^[a-f0-9]{32}$/i.test(approvedAccountId ?? '') || !approvedAccountId.toLowerCase().endsWith(ACCOUNT_SUFFIX)) fail('approved account configuration is missing or invalid'); - if (!/^[a-f0-9]{32}$/i.test(workerId ?? '') || !['created', 'already-present'].includes(status)) fail('verified smoke Worker result is invalid'); - if (repository !== 'developing-today/code' || event !== 'workflow_dispatch' || branch !== 'main' || - !/^[a-f0-9]{40}$/.test(sourceSha ?? '') || !/^\d{1,20}$/.test(String(runId ?? '')) || - !Number.isInteger(runAttempt) || runAttempt < 1) fail('trusted workflow run metadata is invalid'); - return { - schema: 1, - repository, - workflow: INIT_WORKFLOW, - event, - branch, - source_sha: sourceSha, - run_id: String(runId), - run_attempt: runAttempt, - account_id_sha256: createHash('sha256').update(approvedAccountId.toLowerCase()).digest('hex'), - worker_name: WORKER_NAME, - worker_id: workerId.toLowerCase(), - status, - }; -} - export async function bootstrapSmoke({ approvedAccountId, writeToken, readToken, expectedZoneIds, fetchImpl = fetch }) { const approved = validateInputs({ approvedAccountId, writeToken, readToken, expectedZoneIds }); const accountId = approved.approvedAccountId; @@ -284,7 +210,7 @@ export async function bootstrapSmoke({ approvedAccountId, writeToken, readToken, if (before) { await assertNoRoutes(fetchImpl, accountId, readToken, approved.expectedZoneIds); await assertNoVersionsAndDeployments(fetchImpl, accountId, readToken, before.id); - return { status: 'already-present', workerId: before.id }; + return 'already-present'; } // The complete account route inventory is checked immediately before the @@ -298,33 +224,18 @@ export async function bootstrapSmoke({ approvedAccountId, writeToken, readToken, if (!after || after.id !== created.result.id) fail('Created Worker identity does not match read-only provider readback'); await assertNoRoutes(fetchImpl, accountId, readToken, approved.expectedZoneIds); await assertNoVersionsAndDeployments(fetchImpl, accountId, readToken, after.id); - return { status: 'created', workerId: after.id }; + return 'created'; } if (process.argv[1] && new URL(import.meta.url).pathname === process.argv[1]) { try { - const approvedAccountId = process.env.CF_SMOKE_INIT_APPROVED_ACCOUNT_ID; - const result = await bootstrapSmoke({ + const status = await bootstrapSmoke({ approvedAccountId: process.env.CF_SMOKE_INIT_APPROVED_ACCOUNT_ID, expectedZoneIds: process.env.CF_SMOKE_INIT_EXPECTED_ZONE_IDS, writeToken: process.env.CF_SMOKE_INIT_WRITE_TOKEN, readToken: process.env.CF_SMOKE_INIT_READ_TOKEN, }); - const receiptPath = process.env.BOOTSTRAP_RECEIPT_PATH; - if (!receiptPath) fail('init receipt output path is missing'); - const receipt = createInitReceipt({ - approvedAccountId, - workerId: result.workerId, - status: result.status, - repository: process.env.GITHUB_REPOSITORY, - sourceSha: process.env.GITHUB_SHA, - runId: process.env.GITHUB_RUN_ID, - runAttempt: Number(process.env.GITHUB_RUN_ATTEMPT), - event: process.env.GITHUB_EVENT_NAME, - branch: process.env.GITHUB_REF_NAME, - }); - await writeFile(receiptPath, `${JSON.stringify(receipt)}\n`, { flag: 'wx', mode: 0o600 }); - console.log(`Smoke Worker init preflight passed (${result.status}); no code or deployment was uploaded.`); + console.log(`Smoke Worker init preflight passed (${status}); no code or deployment was uploaded.`); } catch (error) { console.error(error instanceof Error ? error.message : 'Smoke Worker initialization failed'); process.exitCode = 1; diff --git a/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs b/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs index 6a4dc5f6e3..447a7e378d 100644 --- a/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs +++ b/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs @@ -1,6 +1,6 @@ import test from 'node:test'; import assert from 'node:assert/strict'; -import { bootstrapSmoke, createInitReceipt, verifySmokeEmptyTarget, verifySmokePostUpload, CREATE_BODY, WORKER_NAME } from './bootstrap-smoke.mjs'; +import { bootstrapSmoke, CREATE_BODY, WORKER_NAME } from './bootstrap-smoke.mjs'; const accountId = `${'a'.repeat(28)}cbfa`; const zoneId = '1'.repeat(32); @@ -52,7 +52,7 @@ function fixture({ worker = null, createdWorker = safeWorker(), route = null, zo state.worker = state.createdWorker; return ok(state.createResult ?? state.createdWorker, undefined); } - if (parsed.pathname.endsWith(`/workers/workers/${workerId}/versions`)) return ok(state.versions, state.versionResultInfo ?? { total_pages: 0, page: 1, per_page: 100, total_count: state.versions.length }); + if (parsed.pathname.endsWith(`/workers/workers/${workerId}/versions`)) return ok(state.versions, state.versionResultInfo); if (parsed.pathname.endsWith(`/workers/scripts/${WORKER_NAME}/deployments`)) { if (state.deploymentNoInfo) return okNoInfo({ deployments: state.deployments }); return ok({ deployments: state.deployments }, state.deploymentResultInfo ?? { total_pages: 1, page: 1, per_page: 100, total_count: state.deployments.length }); @@ -68,7 +68,7 @@ function run({ fetchImpl, ...overrides }) { test('missing target creates exactly one metadata-only Worker and verifies exposure read-only', async () => { const { state, fetchImpl } = fixture(); - assert.deepEqual(await run({ fetchImpl }), { status: 'created', workerId }); + assert.equal(await run({ fetchImpl }), 'created'); const writes = state.calls.filter(call => call.method !== 'GET'); assert.equal(writes.length, 1); assert.equal(writes[0].method, 'POST'); @@ -80,7 +80,7 @@ test('missing target creates exactly one metadata-only Worker and verifies expos test('same protected configuration is idempotent for an existing safe target', async () => { const { state, fetchImpl } = fixture({ worker: safeWorker() }); - assert.deepEqual(await run({ fetchImpl }), { status: 'already-present', workerId }); + assert.equal(await run({ fetchImpl }), 'already-present'); assert.equal(state.calls.some(call => call.method === 'POST'), false); }); @@ -134,8 +134,8 @@ test('zone scan requires owner, unique IDs and exact full-account inventory', as const cases = [ { zones: [{ id: zoneId, account: { id: 'f'.repeat(32) } }], expected: /owner or ID/ }, { zones: [{ id: zoneId, account: { id: accountId } }, { id: zoneId, account: { id: accountId } }], expected: /duplicate ID/ }, - { zones: [], expected: /zone total count|does not match the approved/ }, - { zones: [{ id: zoneId, account: { id: accountId } }], zoneResultInfo: { total_pages: 1, page: 2, per_page: 50, total_count: 1 }, expected: /zone page does not match/ }, + { zones: [], expected: /pagination metadata/ }, + { zones: [{ id: zoneId, account: { id: accountId } }], zoneResultInfo: { total_pages: 1, page: 2, per_page: 50, total_count: 1 }, expected: /pagination metadata/ }, { zones: [{ id: '2'.repeat(32), account: { id: accountId } }], expected: /does not match the approved/ }, ]; for (const item of cases) { @@ -151,14 +151,14 @@ test('complete multi-page route inventory is compared to protected zone IDs', as const ids = Array.from({ length: 51 }, (_, index) => index.toString(16).padStart(32, '0')); const zones = ids.map(id => ({ id, account: { id: accountId } })); const f = fixture({ zonePages: [zones.slice(0, 50), zones.slice(50)] }); - assert.deepEqual(await run({ fetchImpl: f.fetchImpl, expectedZoneIds: ids }), { status: 'created', workerId }); + assert.equal(await run({ fetchImpl: f.fetchImpl, expectedZoneIds: ids }), 'created'); const zoneRequests = f.state.calls.filter(call => call.url.pathname === '/client/v4/zones'); assert.equal(zoneRequests.length, 4); // two complete scans: before and after create }); test('known zero-zone inventory is accepted only when explicitly configured', async () => { const f = fixture({ zones: [], zoneResultInfo: { total_pages: 0, page: 1, per_page: 50, total_count: 0 } }); - assert.deepEqual(await bootstrapSmoke({ approvedAccountId: accountId, expectedZoneIds: [], writeToken, readToken, fetchImpl: f.fetchImpl }), { status: 'created', workerId }); + assert.equal(await bootstrapSmoke({ approvedAccountId: accountId, expectedZoneIds: [], writeToken, readToken, fetchImpl: f.fetchImpl }), 'created'); assert.equal(f.state.calls.some(call => call.method === 'POST'), true); }); @@ -189,7 +189,7 @@ test('route conflict and incomplete pagination block creation', async () => { assert.equal(routed.state.calls.some(call => call.method === 'POST'), false); const incomplete = fixture({ zoneResultInfo: { total_pages: 1, page: 1, per_page: 50, total_count: 2 } }); - await assert.rejects(run({ fetchImpl: incomplete.fetchImpl }), /zone total count/); + await assert.rejects(run({ fetchImpl: incomplete.fetchImpl }), /pagination metadata/); assert.equal(incomplete.state.calls.some(call => call.method === 'POST'), false); }); @@ -202,7 +202,7 @@ test('create response identity mismatch stops after its single write', async () test('empty deployment list is explicit evidence; missing list or conflicting metadata is denied', async t => { const empty = fixture({ worker: safeWorker(), deploymentNoInfo: true }); - assert.deepEqual(await run({ fetchImpl: empty.fetchImpl }), { status: 'already-present', workerId }); + assert.equal(await run({ fetchImpl: empty.fetchImpl }), 'already-present'); for (const response of [ { result: {}, result_info: { total_count: 0 } }, @@ -226,7 +226,7 @@ test('empty deployment list is explicit evidence; missing list or conflicting me test('zero versions and deployment history are required', async () => { const { state, fetchImpl } = fixture({ worker: safeWorker() }); - assert.deepEqual(await run({ fetchImpl }), { status: 'already-present', workerId }); + assert.equal(await run({ fetchImpl }), 'already-present'); assert.ok(state.calls.some(call => call.url.pathname.endsWith('/versions'))); assert.ok(state.calls.some(call => call.url.pathname.endsWith('/deployments'))); @@ -234,25 +234,3 @@ test('zero versions and deployment history are required', async () => { await assert.rejects(run({ fetchImpl: withVersion.fetchImpl }), /already has a version/); assert.equal(withVersion.state.calls.some(call => call.method === 'POST'), false); }); - -test('read-only upload preflight binds the init Worker ID and postflight keeps it private', async () => { - const f = fixture({ worker: safeWorker() }); - assert.deepEqual(await verifySmokeEmptyTarget({ approvedAccountId: accountId, expectedZoneIds, readToken, expectedWorkerId: workerId, fetchImpl: f.fetchImpl }), { workerId, workerName: WORKER_NAME }); - assert.deepEqual(await verifySmokePostUpload({ approvedAccountId: accountId, expectedZoneIds, readToken, expectedWorkerId: workerId, fetchImpl: f.fetchImpl }), { workerId, workerName: WORKER_NAME }); - assert.equal(f.state.calls.some(call => call.method !== 'GET'), false); - - await assert.rejects(verifySmokeEmptyTarget({ approvedAccountId: accountId, expectedZoneIds, readToken, expectedWorkerId: 'f'.repeat(32), fetchImpl: f.fetchImpl }), /differs from the initialization receipt/); -}); - -test('init receipt binds exact trusted run, account hash and Worker without storing account ID', () => { - const receipt = createInitReceipt({ - approvedAccountId: accountId, workerId, status: 'created', repository: 'developing-today/code', - sourceSha: 'a'.repeat(40), runId: '123456789', runAttempt: 1, event: 'workflow_dispatch', branch: 'main', - }); - assert.equal(receipt.worker_name, WORKER_NAME); - assert.equal(receipt.worker_id, workerId); - assert.equal(receipt.source_sha, 'a'.repeat(40)); - assert.equal(receipt.account_id_sha256.length, 64); - assert.equal(JSON.stringify(receipt).includes(accountId), false); - assert.throws(() => createInitReceipt({ approvedAccountId: accountId, workerId, status: 'created', repository: 'developing.today/code', sourceSha: 'a'.repeat(40), runId: '123456789', runAttempt: 1, event: 'workflow_dispatch', branch: 'main' }), /trusted workflow run metadata/); -}); diff --git a/pm-stack/private-laptop-bridge/cloudflare.config.ts b/pm-stack/private-laptop-bridge/cloudflare.config.ts deleted file mode 100644 index b65c79d077..0000000000 --- a/pm-stack/private-laptop-bridge/cloudflare.config.ts +++ /dev/null @@ -1,24 +0,0 @@ -import {bindings, defineConfig} from 'cf/config'; -import * as smoke from './smoke.mjs' with {type:'cf-worker'}; - -export default defineConfig({ - worker: { - name: 'private-laptop-bridge-smoke', - compatibilityDate: '2026-07-30', - workersDev: false, - previewUrls: false, - domains: [], - triggers: [], - limits: {cpuMs: 10}, - observability: {enabled: false, logs: {enabled: false}, traces: {enabled: false}}, - entrypoint: smoke, - env: { - ENABLED: bindings.text('false'), - GATEWAY_HOST: bindings.text('private-bridge-smoke.invalid'), - GATEWAY_ACCOUNT_ID: bindings.text(''), - GATEWAY_POLICY_ID: bindings.text(''), - START_MS: bindings.text(''), - END_MS: bindings.text(''), - }, - }, -}); diff --git a/pm-stack/private-laptop-bridge/package-lock.json b/pm-stack/private-laptop-bridge/package-lock.json deleted file mode 100644 index 06220cd84a..0000000000 --- a/pm-stack/private-laptop-bridge/package-lock.json +++ /dev/null @@ -1,2433 +0,0 @@ -{ - "name": "private-laptop-bridge-smoke", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "private-laptop-bridge-smoke", - "devDependencies": { - "cf": "1.0.0-rc.1", - "wrangler": "4.166.0" - }, - "engines": { - "node": ">=24.22.0" - } - }, - "node_modules/@cloudflare/build-output-utils": { - "version": "1.0.0-rc.1", - "resolved": "https://registry.npmjs.org/@cloudflare/build-output-utils/-/build-output-utils-1.0.0-rc.1.tgz", - "integrity": "sha512-IrzZL1UEdVMZPRarrKu2VpnL3MIeNVhCItTebB88SwQ1YJ4mLAe1kQtXmIH7MpdgDYnxAsTZXMtuw9q5jRWCcw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@cloudflare/config": "1.0.0-rc.1" - } - }, - "node_modules/@cloudflare/config": { - "version": "1.0.0-rc.1", - "resolved": "https://registry.npmjs.org/@cloudflare/config/-/config-1.0.0-rc.1.tgz", - "integrity": "sha512-NQgB+fQbk8IU0iJ6/G9LCSQjJ7JuyRn5CALrPKnQ8vxqayOJlX+av9adhLCMYBeC80ocncW1Gy7quv00uLV3LQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "zod": "4.6.6" - } - }, - "node_modules/@cloudflare/kv-asset-handler": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.5.1.tgz", - "integrity": "sha512-48OysfSW3MkQY1XjkhkpPkgrEkOvgfoyHzA2eyX5wpzFpijC02uWigv3hkNdJdT3C7ybW/U17yYHXeR68pLeww==", - "dev": true, - "license": "MIT OR Apache-2.0", - "engines": { - "node": ">=22.0.0" - } - }, - "node_modules/@cloudflare/runtime-types": { - "version": "0.1.30", - "resolved": "https://registry.npmjs.org/@cloudflare/runtime-types/-/runtime-types-0.1.30.tgz", - "integrity": "sha512-p68T70lDZT7Vyv5c2SDzB0uqVRVCtj/3WMgXVQESnWVyTybcCwXRM9Ekmh2rQ+aPGhtIWiACvd8pX2yGA9Z5mw==", - "dev": true, - "license": "MIT", - "dependencies": { - "miniflare": "5.20261117.0-beta", - "workerd": "1.20261117.1" - } - }, - "node_modules/@cloudflare/runtime-types/node_modules/@cloudflare/workerd-darwin-64": { - "version": "1.20261117.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20261117.1.tgz", - "integrity": "sha512-qfAYw6iPoey0BmPsp4z5ARWOa+XSBD3gQzmcBI2ql9pKTSA5eEC8F1oI6BIk/FVguhomfSn5gS4RzbWhTd/EpQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/runtime-types/node_modules/@cloudflare/workerd-darwin-arm64": { - "version": "1.20261117.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20261117.1.tgz", - "integrity": "sha512-cInx5Cr9O27oW+ujyI49lTRQZra/lMgWUFiKmGY3jxDncATSxzfQ6udXHkVvK4//1/PfxQTDyMjdQUIN8m6Aqg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/runtime-types/node_modules/@cloudflare/workerd-linux-64": { - "version": "1.20261117.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20261117.1.tgz", - "integrity": "sha512-gZLA8X11m/luZwn+YA3+mDu61vdxNJzpksP/QZqjydKTQ+VUCulsK5gtn9Bqst1p3KJu2kafQpJ1nDQv4B23jA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/runtime-types/node_modules/@cloudflare/workerd-linux-arm64": { - "version": "1.20261117.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20261117.1.tgz", - "integrity": "sha512-gxWngFojq41ULKNKb9rpWYvKotN5hT2I/xot+Bpy31cXzrwcTgtDLSMb2t75sW5BJxH7hihFvikgYb577kB3Zg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/runtime-types/node_modules/@cloudflare/workerd-windows-64": { - "version": "1.20261117.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20261117.1.tgz", - "integrity": "sha512-0OR2Btx5EDonOKvvuGDq8rxBSggxoF1ThQjbZN3vsu3GlaF/oXW5f9/iB78OgV0CzMPTi+hZgzc1NR95UJCURA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/runtime-types/node_modules/miniflare": { - "version": "5.20261117.0-beta", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-5.20261117.0-beta.tgz", - "integrity": "sha512-D2ygY04wQUmbpwgBhj828piErZoj7UMlXNGr4EWQp/c1PNGHyYOh0dMIyobjwOXiD5Ifl1EaEVAoNuBHK+qtkw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@cspotcode/source-map-support": "0.8.1", - "sharp": "0.35.5", - "undici": "7.30.1", - "workerd": "1.20261117.1", - "ws": "8.21.0", - "youch": "4.1.0-beta.10" - }, - "engines": { - "node": ">=22.12.0" - }, - "peerDependencies": { - "kerberos": "^2.0.0" - }, - "peerDependenciesMeta": { - "kerberos": { - "optional": true - } - } - }, - "node_modules/@cloudflare/runtime-types/node_modules/undici": { - "version": "7.30.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.1.tgz", - "integrity": "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20.18.1" - } - }, - "node_modules/@cloudflare/runtime-types/node_modules/workerd": { - "version": "1.20261117.1", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20261117.1.tgz", - "integrity": "sha512-iakDbGVtJRiErpWSM5fYT0z3spJ2Mo1x/POsEajBNLqUbTRwm8vMqbB7g8zPN2tzs6eZYNiO5ECyEnAXO9Foxw==", - "dev": true, - "hasInstallScript": true, - "license": "Apache-2.0", - "bin": { - "workerd": "bin/workerd" - }, - "engines": { - "node": ">=16" - }, - "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20261117.1", - "@cloudflare/workerd-darwin-arm64": "1.20261117.1", - "@cloudflare/workerd-linux-64": "1.20261117.1", - "@cloudflare/workerd-linux-arm64": "1.20261117.1", - "@cloudflare/workerd-windows-64": "1.20261117.1" - } - }, - "node_modules/@cloudflare/unenv-preset": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.16.2.tgz", - "integrity": "sha512-JBP1+Z7ZSNG/d4mRP+y8VC5dka3tZVMLEZRvS+rzQ4DGV1EoxRFQckcJTTkXbHSQiTj0DtNI01Zwb/V2fX0mvQ==", - "dev": true, - "license": "MIT OR Apache-2.0", - "peerDependencies": { - "unenv": "2.0.0-rc.24", - "workerd": ">1.20260305.0 <2.0.0-0" - }, - "peerDependenciesMeta": { - "workerd": { - "optional": true - } - } - }, - "node_modules/@cloudflare/workerd-darwin-64": { - "version": "1.20261119.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20261119.1.tgz", - "integrity": "sha512-yotoiTGXCl1gTRX+y5ZWSAmzAg6CcBJXhJL6C1DGWUhsjjezNe8FdzraNsefVTOeKsOid2EC+hqOzewczKLvmQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/workerd-darwin-arm64": { - "version": "1.20261119.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20261119.1.tgz", - "integrity": "sha512-VPOmfEmMubvw4SPcg/yDgamQXsiVAENgxeCJO8pDggRJFaF93SP0g/hktD8sbfmWBS19BO1kX1EsdgHSgRL9jA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/workerd-linux-64": { - "version": "1.20261119.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20261119.1.tgz", - "integrity": "sha512-aaDf78smiN12Uuwtg6TG6iLVS61sLpy/7DC5PYORf2+TCYw/bygcaqqb8zQJ+XwZ3xYhm/Ws80c/yMMhCMTFYA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/workerd-linux-arm64": { - "version": "1.20261119.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20261119.1.tgz", - "integrity": "sha512-LkyAvTMcKqRUP73HRScWWwTSz3pw09um1hxR+rcGdvsGzao8IR59XXTp/tul6kFdVBL2mD8U3X6j2O8t7I4viw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/workerd-windows-64": { - "version": "1.20261119.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20261119.1.tgz", - "integrity": "sha512-y4RO3QFNWt4j4uq2kmP5tklTvdA3qOA0PXuA66vsCmEtZYYb71ldefJcq5Dt0jrexKf/i4BBaLXZMVYLnohb0g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/workers-utils": { - "version": "0.56.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-utils/-/workers-utils-0.56.0.tgz", - "integrity": "sha512-Fw3/zR+pQp+5hKn1CHIRkCYz49fyAb2qRqCq01jBGqlKL0rRnZyXYD4j0h9cjaWPYYQUOe5y6L7BNp2ZwsHg5A==", - "dev": true, - "license": "MIT OR Apache-2.0", - "dependencies": { - "@cspotcode/source-map-support": "0.8.1", - "chalk": "5.3.0", - "dotenv": "16.3.1", - "undici": "7.30.2" - }, - "peerDependencies": { - "vitest": "^4.1.0 || ^5.0.0" - }, - "peerDependenciesMeta": { - "vitest": { - "optional": true - } - } - }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@emnapi/runtime": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz", - "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", - "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", - "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", - "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", - "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", - "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", - "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", - "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", - "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", - "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", - "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", - "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", - "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", - "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", - "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", - "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", - "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", - "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", - "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", - "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", - "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", - "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", - "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", - "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", - "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", - "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", - "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@img/colour": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", - "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/@img/sharp-darwin-arm64": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.5.tgz", - "integrity": "sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.3.4" - } - }, - "node_modules/@img/sharp-darwin-x64": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.5.tgz", - "integrity": "sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.3.4" - } - }, - "node_modules/@img/sharp-freebsd-wasm32": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.5.tgz", - "integrity": "sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw==", - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "freebsd" - ], - "dependencies": { - "@img/sharp-wasm32": "0.35.5" - }, - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.4.tgz", - "integrity": "sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "darwin" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.4.tgz", - "integrity": "sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "darwin" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.4.tgz", - "integrity": "sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.4.tgz", - "integrity": "sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-ppc64": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.4.tgz", - "integrity": "sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-riscv64": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.4.tgz", - "integrity": "sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.4.tgz", - "integrity": "sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-x64": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.4.tgz", - "integrity": "sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.4.tgz", - "integrity": "sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linuxmusl-x64": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.4.tgz", - "integrity": "sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "LGPL-3.0-or-later", - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-linux-arm": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.5.tgz", - "integrity": "sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.3.4" - } - }, - "node_modules/@img/sharp-linux-arm64": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.5.tgz", - "integrity": "sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.3.4" - } - }, - "node_modules/@img/sharp-linux-ppc64": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.5.tgz", - "integrity": "sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-ppc64": "1.3.4" - } - }, - "node_modules/@img/sharp-linux-riscv64": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.5.tgz", - "integrity": "sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-riscv64": "1.3.4" - } - }, - "node_modules/@img/sharp-linux-s390x": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.5.tgz", - "integrity": "sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.3.4" - } - }, - "node_modules/@img/sharp-linux-x64": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.5.tgz", - "integrity": "sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-x64": "1.3.4" - } - }, - "node_modules/@img/sharp-linuxmusl-arm64": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.5.tgz", - "integrity": "sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.3.4" - } - }, - "node_modules/@img/sharp-linuxmusl-x64": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.5.tgz", - "integrity": "sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-x64": "1.3.4" - } - }, - "node_modules/@img/sharp-wasm32": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.5.tgz", - "integrity": "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==", - "dev": true, - "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", - "optional": true, - "dependencies": { - "@emnapi/runtime": "^1.11.3" - }, - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-webcontainers-wasm32": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.5.tgz", - "integrity": "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==", - "cpu": [ - "wasm32" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "dependencies": { - "@img/sharp-wasm32": "0.35.5" - }, - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-win32-arm64": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.5.tgz", - "integrity": "sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0 AND LGPL-3.0-or-later", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-win32-ia32": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.5.tgz", - "integrity": "sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "Apache-2.0 AND LGPL-3.0-or-later", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-win32-x64": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.5.tgz", - "integrity": "sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0 AND LGPL-3.0-or-later", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.3.tgz", - "integrity": "sha512-lhTtjtoEArWBjismtfS761S9Hlyn+nIZqOZVYoZ1Xn82PMNMVnk+jj/NhC4fAXGTs7ydONcJiR5vyQBTMDu27g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", - "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, - "node_modules/@poppinss/colors": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz", - "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==", - "dev": true, - "license": "MIT", - "dependencies": { - "kleur": "^4.1.5" - } - }, - "node_modules/@poppinss/dumper": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.5.tgz", - "integrity": "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@poppinss/colors": "^4.1.5", - "@sindresorhus/is": "^7.0.2", - "supports-color": "^10.0.0" - } - }, - "node_modules/@poppinss/exception": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz", - "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@sindresorhus/is": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.2.0.tgz", - "integrity": "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/@speed-highlight/core": { - "version": "1.2.24", - "resolved": "https://registry.npmjs.org/@speed-highlight/core/-/core-1.2.24.tgz", - "integrity": "sha512-qeW2e1l78afw8VhRPfPQ1Gjj+KU5XFQ/OFV5ti6eTa9bruO7mJyZtA4vw0ofqmA3tKCkROE9xLk3VZoeRc98nw==", - "dev": true, - "license": "CC0-1.0" - }, - "node_modules/@types/node": { - "version": "18.19.130", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.130.tgz", - "integrity": "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/@types/node-fetch": { - "version": "2.6.13", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.13.tgz", - "integrity": "sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*", - "form-data": "^4.0.4" - } - }, - "node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@types/yargs-parser": { - "version": "21.0.3", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", - "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "dev": true, - "license": "MIT", - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, - "node_modules/agentkeepalive": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", - "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "humanize-ms": "^1.2.1" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/blake3-wasm": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", - "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==", - "dev": true, - "license": "MIT" - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/cf": { - "version": "1.0.0-rc.1", - "resolved": "https://registry.npmjs.org/cf/-/cf-1.0.0-rc.1.tgz", - "integrity": "sha512-mQ9X/FVE1QP2ebXVF/9tlbqoO0TB3tKxUJocaWsic6IuNvThmJc/Ou/4ABJNB/Sj8HxEzvrjT1PRqjySVO5YoA==", - "dev": true, - "license": "MIT OR Apache-2.0", - "dependencies": { - "@cloudflare/build-output-utils": "1.0.0-rc.1", - "@cloudflare/config": "1.0.0-rc.1", - "@cloudflare/runtime-types": "0.1.30", - "blake3-wasm": "2.1.5", - "miniflare": "5.20261117.0-beta" - }, - "bin": { - "cf": "bin/cf", - "cloudflare": "bin/cf" - }, - "engines": { - "node": "^22.23.0 || ^24.22.0 || ^26.12.0" - } - }, - "node_modules/cf/node_modules/@cloudflare/workerd-darwin-64": { - "version": "1.20261117.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20261117.1.tgz", - "integrity": "sha512-qfAYw6iPoey0BmPsp4z5ARWOa+XSBD3gQzmcBI2ql9pKTSA5eEC8F1oI6BIk/FVguhomfSn5gS4RzbWhTd/EpQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/cf/node_modules/@cloudflare/workerd-darwin-arm64": { - "version": "1.20261117.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20261117.1.tgz", - "integrity": "sha512-cInx5Cr9O27oW+ujyI49lTRQZra/lMgWUFiKmGY3jxDncATSxzfQ6udXHkVvK4//1/PfxQTDyMjdQUIN8m6Aqg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/cf/node_modules/@cloudflare/workerd-linux-64": { - "version": "1.20261117.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20261117.1.tgz", - "integrity": "sha512-gZLA8X11m/luZwn+YA3+mDu61vdxNJzpksP/QZqjydKTQ+VUCulsK5gtn9Bqst1p3KJu2kafQpJ1nDQv4B23jA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/cf/node_modules/@cloudflare/workerd-linux-arm64": { - "version": "1.20261117.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20261117.1.tgz", - "integrity": "sha512-gxWngFojq41ULKNKb9rpWYvKotN5hT2I/xot+Bpy31cXzrwcTgtDLSMb2t75sW5BJxH7hihFvikgYb577kB3Zg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/cf/node_modules/@cloudflare/workerd-windows-64": { - "version": "1.20261117.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20261117.1.tgz", - "integrity": "sha512-0OR2Btx5EDonOKvvuGDq8rxBSggxoF1ThQjbZN3vsu3GlaF/oXW5f9/iB78OgV0CzMPTi+hZgzc1NR95UJCURA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/cf/node_modules/miniflare": { - "version": "5.20261117.0-beta", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-5.20261117.0-beta.tgz", - "integrity": "sha512-D2ygY04wQUmbpwgBhj828piErZoj7UMlXNGr4EWQp/c1PNGHyYOh0dMIyobjwOXiD5Ifl1EaEVAoNuBHK+qtkw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@cspotcode/source-map-support": "0.8.1", - "sharp": "0.35.5", - "undici": "7.30.1", - "workerd": "1.20261117.1", - "ws": "8.21.0", - "youch": "4.1.0-beta.10" - }, - "engines": { - "node": ">=22.12.0" - }, - "peerDependencies": { - "kerberos": "^2.0.0" - }, - "peerDependenciesMeta": { - "kerberos": { - "optional": true - } - } - }, - "node_modules/cf/node_modules/undici": { - "version": "7.30.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.1.tgz", - "integrity": "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20.18.1" - } - }, - "node_modules/cf/node_modules/workerd": { - "version": "1.20261117.1", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20261117.1.tgz", - "integrity": "sha512-iakDbGVtJRiErpWSM5fYT0z3spJ2Mo1x/POsEajBNLqUbTRwm8vMqbB7g8zPN2tzs6eZYNiO5ECyEnAXO9Foxw==", - "dev": true, - "hasInstallScript": true, - "license": "Apache-2.0", - "bin": { - "workerd": "bin/workerd" - }, - "engines": { - "node": ">=16" - }, - "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20261117.1", - "@cloudflare/workerd-darwin-arm64": "1.20261117.1", - "@cloudflare/workerd-linux-64": "1.20261117.1", - "@cloudflare/workerd-linux-arm64": "1.20261117.1", - "@cloudflare/workerd-windows-64": "1.20261117.1" - } - }, - "node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/cloudflare": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/cloudflare/-/cloudflare-5.2.0.tgz", - "integrity": "sha512-dVzqDpPFYR9ApEC9e+JJshFJZXcw4HzM8W+3DHzO5oy9+8rLC53G7x6fEf9A7/gSuSCxuvndzui5qJKftfIM9A==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/node": "^18.11.18", - "@types/node-fetch": "^2.6.4", - "abort-controller": "^3.0.0", - "agentkeepalive": "^4.2.1", - "form-data-encoder": "1.7.2", - "formdata-node": "^4.3.2", - "node-fetch": "^2.6.7" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/cookie": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", - "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/detect-libc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=8" - } - }, - "node_modules/devtools-protocol": { - "version": "0.0.1182435", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1182435.tgz", - "integrity": "sha512-EmlkWb62wSbQNE1gRZZsi4KZYRaF5Skpp183LhRU7+sadKR06O1dHCjZmFSEG6Kv7P6S/UYLxcY3NlYwqKM99w==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/dotenv": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/error-stack-parser-es": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/error-stack-parser-es/-/error-stack-parser-es-1.0.5.tgz", - "integrity": "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", - "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/esbuild": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", - "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.28.2", - "@esbuild/android-arm": "0.28.2", - "@esbuild/android-arm64": "0.28.2", - "@esbuild/android-x64": "0.28.2", - "@esbuild/darwin-arm64": "0.28.2", - "@esbuild/darwin-x64": "0.28.2", - "@esbuild/freebsd-arm64": "0.28.2", - "@esbuild/freebsd-x64": "0.28.2", - "@esbuild/linux-arm": "0.28.2", - "@esbuild/linux-arm64": "0.28.2", - "@esbuild/linux-ia32": "0.28.2", - "@esbuild/linux-loong64": "0.28.2", - "@esbuild/linux-mips64el": "0.28.2", - "@esbuild/linux-ppc64": "0.28.2", - "@esbuild/linux-riscv64": "0.28.2", - "@esbuild/linux-s390x": "0.28.2", - "@esbuild/linux-x64": "0.28.2", - "@esbuild/netbsd-arm64": "0.28.2", - "@esbuild/netbsd-x64": "0.28.2", - "@esbuild/openbsd-arm64": "0.28.2", - "@esbuild/openbsd-x64": "0.28.2", - "@esbuild/openharmony-arm64": "0.28.2", - "@esbuild/sunos-x64": "0.28.2", - "@esbuild/win32-arm64": "0.28.2", - "@esbuild/win32-ia32": "0.28.2", - "@esbuild/win32-x64": "0.28.2" - } - }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/form-data": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", - "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.4", - "mime-types": "^2.1.35" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/form-data-encoder": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", - "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==", - "dev": true, - "license": "MIT" - }, - "node_modules/formdata-node": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", - "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "node-domexception": "1.0.0", - "web-streams-polyfill": "4.0.0-beta.3" - }, - "engines": { - "node": ">= 12.20" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", - "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/humanize-ms": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.0.0" - } - }, - "node_modules/kleur": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", - "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/miniflare": { - "version": "5.20261119.0-beta", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-5.20261119.0-beta.tgz", - "integrity": "sha512-HdNQIUPgde5Yg0qFaI6iiYd0aOxAgKQTXDstkBN2G1tPBdslNrUKdySwaGdBix0IFd+yh8M0gkqzw68dIZ2Ugw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@cspotcode/source-map-support": "0.8.1", - "sharp": "0.35.5", - "undici": "7.30.2", - "workerd": "1.20261119.1", - "ws": "8.21.0", - "youch": "4.1.0-beta.10" - }, - "engines": { - "node": ">=22.12.0" - }, - "peerDependencies": { - "kerberos": "^2.0.0" - }, - "peerDependenciesMeta": { - "kerberos": { - "optional": true - } - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "deprecated": "Use your platform's native DOMException instead", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "engines": { - "node": ">=10.5.0" - } - }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/path-to-regexp": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", - "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", - "dev": true, - "license": "MIT" - }, - "node_modules/semver": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", - "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/sharp": { - "version": "0.35.5", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.5.tgz", - "integrity": "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@img/colour": "^1.1.0", - "detect-libc": "^2.1.2", - "semver": "^7.8.5" - }, - "engines": { - "node": ">=20.9.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.35.5", - "@img/sharp-darwin-x64": "0.35.5", - "@img/sharp-freebsd-wasm32": "0.35.5", - "@img/sharp-libvips-darwin-arm64": "1.3.4", - "@img/sharp-libvips-darwin-x64": "1.3.4", - "@img/sharp-libvips-linux-arm": "1.3.4", - "@img/sharp-libvips-linux-arm64": "1.3.4", - "@img/sharp-libvips-linux-ppc64": "1.3.4", - "@img/sharp-libvips-linux-riscv64": "1.3.4", - "@img/sharp-libvips-linux-s390x": "1.3.4", - "@img/sharp-libvips-linux-x64": "1.3.4", - "@img/sharp-libvips-linuxmusl-arm64": "1.3.4", - "@img/sharp-libvips-linuxmusl-x64": "1.3.4", - "@img/sharp-linux-arm": "0.35.5", - "@img/sharp-linux-arm64": "0.35.5", - "@img/sharp-linux-ppc64": "0.35.5", - "@img/sharp-linux-riscv64": "0.35.5", - "@img/sharp-linux-s390x": "0.35.5", - "@img/sharp-linux-x64": "0.35.5", - "@img/sharp-linuxmusl-arm64": "0.35.5", - "@img/sharp-linuxmusl-x64": "0.35.5", - "@img/sharp-webcontainers-wasm32": "0.35.5", - "@img/sharp-win32-arm64": "0.35.5", - "@img/sharp-win32-ia32": "0.35.5", - "@img/sharp-win32-x64": "0.35.5" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/supports-color": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", - "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true, - "license": "MIT" - }, - "node_modules/tslib": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz", - "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==", - "dev": true, - "license": "0BSD", - "optional": true - }, - "node_modules/undici": { - "version": "7.30.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.2.tgz", - "integrity": "sha512-mLyPQnHwUxaM/rideoK/+KL8DaAJLRl4aBCfmX444aCSLnIaomqPLtNRe2jdCYcsk5wZzXrDIQC8ZeYNRAYyIA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20.18.1" - } - }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true, - "license": "MIT" - }, - "node_modules/unenv": { - "version": "2.0.0-rc.24", - "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.24.tgz", - "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "pathe": "^2.0.3" - } - }, - "node_modules/web-streams-polyfill": { - "version": "4.0.0-beta.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", - "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true, - "license": "BSD-2-Clause" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/workerd": { - "version": "1.20261119.1", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20261119.1.tgz", - "integrity": "sha512-lalSvY+ad5asqMgzA/DfrZo7wvuvOHJc/aS1UctUrwu76fJE/LkSKJlprfBu0LeU79Qai5d+xFooQA9CIfj+dQ==", - "dev": true, - "hasInstallScript": true, - "license": "Apache-2.0", - "bin": { - "workerd": "bin/workerd" - }, - "engines": { - "node": ">=16" - }, - "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20261119.1", - "@cloudflare/workerd-darwin-arm64": "1.20261119.1", - "@cloudflare/workerd-linux-64": "1.20261119.1", - "@cloudflare/workerd-linux-arm64": "1.20261119.1", - "@cloudflare/workerd-windows-64": "1.20261119.1" - } - }, - "node_modules/wrangler": { - "version": "4.166.0", - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.166.0.tgz", - "integrity": "sha512-qMz0sHGXqEC0Va8T6dAaG0ggp9tCcuHHYMUQzRKbtZg6+MPAPb6oBu1757IaeugNJHPAz+twHiA+zDyXWQLsLw==", - "dev": true, - "license": "MIT OR Apache-2.0", - "dependencies": { - "@cloudflare/kv-asset-handler": "0.5.1", - "@cloudflare/unenv-preset": "2.16.2", - "@cloudflare/workers-utils": "0.56.0", - "@cspotcode/source-map-support": "0.8.1", - "@types/yargs": "17.0.24", - "cloudflare": "5.2.0", - "devtools-protocol": "0.0.1182435", - "esbuild": "0.28.2", - "miniflare": "5.20261119.0-beta", - "path-to-regexp": "6.3.0", - "undici": "7.30.2", - "unenv": "2.0.0-rc.24", - "workerd": "1.20261119.1" - }, - "bin": { - "cf-wrangler": "bin/cf-wrangler.js", - "wrangler": "bin/wrangler.js", - "wrangler2": "bin/wrangler.js" - }, - "engines": { - "node": ">=22.12.0" - }, - "optionalDependencies": { - "fsevents": "2.3.3" - }, - "peerDependencies": { - "@cloudflare/workers-types": "^5.20261119.1" - }, - "peerDependenciesMeta": { - "@cloudflare/workers-types": { - "optional": true - } - } - }, - "node_modules/ws": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", - "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/youch": { - "version": "4.1.0-beta.10", - "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz", - "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@poppinss/colors": "^4.1.5", - "@poppinss/dumper": "^0.6.4", - "@speed-highlight/core": "^1.2.7", - "cookie": "^1.0.2", - "youch-core": "^0.3.3" - } - }, - "node_modules/youch-core": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz", - "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@poppinss/exception": "^1.2.2", - "error-stack-parser-es": "^1.0.5" - } - }, - "node_modules/zod": { - "version": "4.6.6", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.6.tgz", - "integrity": "sha512-4UmzQUF5fxvfcYHlbjBmejU+w+hbDnWFx4aS8kBx7nPBHcO2SqPbpAG8snbdg+Xse4pRefR98hgjFgIMCI/UhA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - } - } -} diff --git a/pm-stack/private-laptop-bridge/package.json b/pm-stack/private-laptop-bridge/package.json deleted file mode 100644 index 857d3a763a..0000000000 --- a/pm-stack/private-laptop-bridge/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"private-laptop-bridge-smoke","private":true,"type":"module","engines":{"node":">=24.22.0"},"devDependencies":{"cf":"1.0.0-rc.1","wrangler":"4.166.0"}} diff --git a/pm-stack/private-laptop-bridge/smoke-upload.mjs b/pm-stack/private-laptop-bridge/smoke-upload.mjs deleted file mode 100644 index f899b85621..0000000000 --- a/pm-stack/private-laptop-bridge/smoke-upload.mjs +++ /dev/null @@ -1,231 +0,0 @@ -#!/usr/bin/env node -// Upload one immutable smoke Worker version and verify it remains unrouted. -import { createHash } from 'node:crypto'; -import { appendFile, readFile, writeFile } from 'node:fs/promises'; -import { API, INIT_WORKFLOW, WORKER_NAME, verifySmokeEmptyTarget, verifySmokePostUpload } from './bootstrap-smoke.mjs'; - -const REPOSITORY = 'developing-today/code'; -export const UPLOAD_WORKFLOW = '.github/workflows/private-laptop-bridge-smoke-upload.yml'; -const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; -const SHA = /^[0-9a-f]{40}$/; -const HASH = /^[0-9a-f]{64}$/; -const fail = message => { throw new Error(message); }; -const hash = value => createHash('sha256').update(value).digest('hex'); -const same = (a, b) => JSON.stringify(a) === JSON.stringify(b); - -function parseJson(value, label) { - try { return typeof value === 'string' ? JSON.parse(value) : value; } - catch { fail(`${label} is not valid JSON`); } -} - -function receiptShape(receipt) { - const expectedKeys = ['account_id_sha256','branch','event','repository','run_attempt','run_id','schema','source_sha','status','worker_id','worker_name','workflow']; - if (!receipt || typeof receipt !== 'object' || Array.isArray(receipt) || !same(Object.keys(receipt).sort(), expectedKeys)) fail('init receipt schema is missing or ambiguous'); - if (receipt.schema !== 1 || receipt.repository !== REPOSITORY || receipt.workflow !== INIT_WORKFLOW || receipt.event !== 'workflow_dispatch' || - receipt.branch !== 'main' || !SHA.test(receipt.source_sha ?? '') || !/^\d{1,20}$/.test(String(receipt.run_id)) || - !Number.isInteger(receipt.run_attempt) || receipt.run_attempt < 1 || !HASH.test(receipt.account_id_sha256 ?? '') || - receipt.worker_name !== WORKER_NAME || !/^[a-f0-9]{32}$/i.test(receipt.worker_id ?? '') || - !['created','already-present'].includes(receipt.status)) fail('init receipt fields do not identify the fixed trusted target'); - return receipt; -} - -export function validateInitReceipt({ receiptJson, runJson, jobsJson, expectedAccountId, currentSha, initRunId }) { - const receipt = receiptShape(parseJson(receiptJson, 'init receipt')); - const run = parseJson(runJson, 'init workflow run'); - const jobsResponse = parseJson(jobsJson, 'init workflow jobs'); - if (!/^[a-f0-9]{32}$/i.test(expectedAccountId ?? '') || !expectedAccountId.toLowerCase().endsWith('cbfa') || - receipt.account_id_sha256 !== hash(expectedAccountId.toLowerCase())) fail('init receipt account does not match protected upload configuration'); - if (!SHA.test(currentSha ?? '') || receipt.source_sha !== currentSha || receipt.run_id !== String(initRunId)) fail('init receipt does not match this exact main dispatch SHA and run ID'); - if (!run || !Number.isSafeInteger(run.id) || String(run.id) !== String(initRunId) || run.run_attempt !== receipt.run_attempt || run.status !== 'completed' || run.conclusion !== 'success' || - run.event !== 'workflow_dispatch' || run.head_branch !== 'main' || run.head_sha !== currentSha || run.path?.split('@')[0] !== INIT_WORKFLOW || - run.repository?.full_name !== REPOSITORY) fail('init receipt is not from the exact successful protected-main workflow run'); - const jobs = jobsResponse?.jobs; - if (!Array.isArray(jobs) || jobsResponse.total_count !== 1 || jobs.length !== 1) fail('init workflow job evidence is missing or ambiguous'); - const job = jobs[0]; - if (job.name !== 'initialize' || job.run_id !== run.id || job.head_sha !== currentSha || job.status !== 'completed' || job.conclusion !== 'success' || !Array.isArray(job.steps)) { - fail('init workflow job is not the exact successful main job'); - } - const steps = new Map(job.steps.map(step => [step.name, step])); - for (const name of ['Run offline bootstrap contract tests','Create only the fixed empty Worker and verify it read-only','Preserve verified smoke initialization receipt']) { - const step = steps.get(name); - if (step?.status !== 'completed' || step?.conclusion !== 'success') fail(`init workflow did not complete required evidence step: ${name}`); - } - return { - workerId: receipt.worker_id.toLowerCase(), - receiptDigest: hash(typeof receiptJson === 'string' ? receiptJson : JSON.stringify(receipt)), - status: receipt.status, - }; -} - -export async function fetchInitRunEvidence({ receiptJson, initRunId, githubToken, fetchImpl = fetch }) { - const receipt = receiptShape(parseJson(receiptJson, 'init receipt')); - if (!/^\d{1,20}$/.test(String(initRunId)) || receipt.run_id !== String(initRunId)) fail('init run ID does not match the receipt'); - if (typeof githubToken !== 'string' || githubToken.length < 20) fail('GitHub read-only token is missing'); - const base = `https://api.github.com/repos/${REPOSITORY}/actions/runs/${encodeURIComponent(initRunId)}`; - async function get(path) { - let response; - try { - response = await fetchImpl(path, { headers: { authorization: `Bearer ${githubToken}`, accept: 'application/vnd.github+json', 'x-github-api-version': '2022-11-28' }, redirect: 'error', signal: AbortSignal.timeout(15_000) }); - } catch { fail('GitHub init-run evidence request failed'); } - if (!response.ok) fail(`GitHub init-run evidence request denied or unavailable (HTTP ${response.status})`); - try { return await response.json(); } catch { fail('GitHub init-run evidence was invalid JSON'); } - } - const run = await get(base); - const jobs = await get(`${base}/attempts/${receipt.run_attempt}/jobs?per_page=100`); - return { run, jobs }; -} - -export function assertDryRunOutput(text) { - const requiredBindings = [ - 'env.ENABLED ("false")', - 'env.GATEWAY_HOST ("private-bridge-smoke.invalid")', - 'env.GATEWAY_ACCOUNT_ID ("")', - 'env.GATEWAY_POLICY_ID ("")', - 'env.START_MS ("")', - 'env.END_MS ("")', - ]; - if (typeof text !== 'string' || !text.includes('--dry-run: exiting now.') || requiredBindings.some(binding => !text.includes(binding))) { - fail('pinned cf prebuilt dry-run did not validate the fixed disabled smoke Worker'); - } - return true; -} - -export function extractUploadedVersion(stdout, { receiptDigest, sourceSha }) { - const body = parseJson(stdout, 'cf version-upload response'); - if (body?.type !== 'version-upload' || body.version !== 1 || body.worker_name !== WORKER_NAME || !UUID.test(body.version_id ?? '')) { - fail('cf version-upload response does not match the pinned exact Worker schema'); - } - if (!SHA.test(sourceSha ?? '') || !HASH.test(receiptDigest ?? '')) fail('upload provenance inputs are invalid'); - return { versionId: body.version_id, message: `init_receipt_sha256=${receiptDigest}` }; -} - -function apiEnvelope(response, body) { - if (!body || typeof body !== 'object' || Array.isArray(body) || !response.ok || body.success !== true || !Object.hasOwn(body, 'result')) { - const status = response.status; - fail(status === 401 || status === 403 ? `Cloudflare verification authorization denied (HTTP ${status})` : `Cloudflare verification request failed (HTTP ${status})`); - } - return { result: body.result, resultInfo: body.result_info }; -} - -export async function readVersions({ accountId, workerId, readToken, fetchImpl = fetch }) { - const rows = []; - let totalCount; - let totalPages; - for (let page = 1; page <= 100; page += 1) { - const url = `${API}/accounts/${encodeURIComponent(accountId)}/workers/workers/${encodeURIComponent(workerId)}/versions?page=${page}&per_page=100`; - let response; - try { response = await fetchImpl(url, { headers: { authorization: `Bearer ${readToken}`, accept: 'application/json' }, redirect: 'error', signal: AbortSignal.timeout(15_000) }); } - catch { fail('Cloudflare version verification request failed; upload result is uncertain'); } - let body; try { body = await response.json(); } catch { fail(`Cloudflare version response is invalid JSON (HTTP ${response.status})`); } - const { result, resultInfo } = apiEnvelope(response, body); - if (!Array.isArray(result)) fail('Cloudflare Beta versions response has an ambiguous result schema'); - rows.push(...result); - if (resultInfo !== undefined) { - if (!resultInfo || typeof resultInfo !== 'object' || Array.isArray(resultInfo)) fail('Cloudflare version pagination metadata is invalid'); - if (resultInfo.page !== undefined && resultInfo.page !== page) fail('Cloudflare version page does not match request'); - if (resultInfo.per_page !== undefined && resultInfo.per_page !== 100) fail('Cloudflare version page size does not match request'); - if (resultInfo.count !== undefined && resultInfo.count !== result.length) fail('Cloudflare version page count is inconsistent'); - if (resultInfo.total_count !== undefined) { - if (!Number.isInteger(resultInfo.total_count) || resultInfo.total_count < 0) fail('Cloudflare version total count is invalid'); - if (totalCount === undefined) totalCount = resultInfo.total_count; - if (totalCount !== resultInfo.total_count) fail('Cloudflare version list changed during pagination'); - } - if (resultInfo.total_pages !== undefined) { - if (!Number.isInteger(resultInfo.total_pages) || resultInfo.total_pages < 0 || resultInfo.total_pages > 100) fail('Cloudflare version total pages is invalid'); - if (totalPages === undefined) totalPages = resultInfo.total_pages; - if (totalPages !== resultInfo.total_pages) fail('Cloudflare version list changed during pagination'); - } - } - if (totalCount !== undefined && rows.length > totalCount) fail('Cloudflare version list exceeded reported total count'); - const doneByPages = totalPages !== undefined && (totalPages === 0 ? page === 1 && rows.length === 0 : page >= totalPages); - const doneByCount = totalCount !== undefined && rows.length === totalCount; - if (doneByPages || doneByCount || (totalPages === undefined && totalCount === undefined && result.length < 100)) { - if (totalCount !== undefined && totalCount !== rows.length) fail('Cloudflare version list is incomplete'); - return rows; - } - if (result.length < 100 && !doneByCount) fail('Cloudflare version list ended before its reported total count'); - } - fail('Cloudflare version pagination exceeded hard bound'); -} - -export function assertExactVersionReadback({ versionId, versions, sourceSha, receiptDigest }) { - if (!UUID.test(versionId ?? '') || !SHA.test(sourceSha ?? '') || !HASH.test(receiptDigest ?? '') || !Array.isArray(versions) || versions.length !== 1) fail('version readback inputs are invalid or the Worker version set is not exactly one'); - const exact = versions.filter(version => version?.id === versionId); - if (exact.length !== 1) fail('server-returned version UUID is absent or ambiguous on the exact Worker'); - const version = exact[0]; - if (version.annotations?.['workers/tag'] !== sourceSha || version.annotations?.['workers/message'] !== `init_receipt_sha256=${receiptDigest}`) { - fail('uploaded Worker version metadata does not bind the exact SHA and init receipt'); - } - if (!Array.isArray(version.urls) || version.urls.length !== 0 || version.hasPreview === true) fail('uploaded Worker version has an unexpected routable or preview URL'); - return true; -} - -function required(name) { - const value = process.env[name]; - if (!value) fail(`required ${name} is missing`); - return value; -} - -async function readJsonFile(path, name) { - try { return await readFile(path, 'utf8'); } catch { fail(`${name} file is unavailable`); } -} - -async function main() { - const [action, ...args] = process.argv.slice(2); - if (action === 'validate-init') { - if (args.length !== 3) fail('usage: validate-init '); - const result = validateInitReceipt({ - receiptJson: await readJsonFile(args[0], 'init receipt'), runJson: await readJsonFile(args[1], 'init run'), jobsJson: await readJsonFile(args[2], 'init jobs'), - expectedAccountId: required('CF_SMOKE_UPLOAD_ACCOUNT_ID'), currentSha: required('GITHUB_SHA'), initRunId: required('INIT_RUN_ID'), - }); - const uploadToken = process.env.CF_SMOKE_UPLOAD_API_TOKEN; - const readToken = process.env.CF_SMOKE_UPLOAD_READ_TOKEN; - if (typeof uploadToken !== 'string' || uploadToken.length < 20 || typeof readToken !== 'string' || readToken.length < 20) fail('smoke upload and read-only credentials are both required'); - if (uploadToken === readToken) fail('smoke upload and read-only credentials must be distinct'); - await appendFile(required('GITHUB_OUTPUT'), `worker_id=${result.workerId}\nreceipt_digest=${result.receiptDigest}\n`); - return; - } - if (action === 'fetch-init') { - if (args.length !== 3) fail('usage: fetch-init '); - const receiptJson = await readJsonFile(args[0], 'init receipt'); - const evidence = await fetchInitRunEvidence({ receiptJson, initRunId: required('INIT_RUN_ID'), githubToken: required('GITHUB_TOKEN') }); - await writeFile(args[1], `${JSON.stringify(evidence.run)}\n`, { flag: 'wx', mode: 0o600 }); - await writeFile(args[2], `${JSON.stringify(evidence.jobs)}\n`, { flag: 'wx', mode: 0o600 }); - return; - } - if (action === 'preflight') { - if (args.length !== 1) fail('usage: preflight '); - const receipt = receiptShape(parseJson(await readJsonFile(args[0], 'init receipt'), 'init receipt')); - const accountId = required('CF_SMOKE_UPLOAD_ACCOUNT_ID'); - if (receipt.account_id_sha256 !== hash(accountId.toLowerCase()) || receipt.source_sha !== required('GITHUB_SHA')) fail('init receipt does not match current upload account or SHA'); - await verifySmokeEmptyTarget({ approvedAccountId: accountId, expectedZoneIds: required('CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS'), readToken: required('CF_SMOKE_UPLOAD_READ_TOKEN'), expectedWorkerId: receipt.worker_id }); - console.log('Smoke target identity, empty version/deployment state, routes and preview settings verified read-only.'); - return; - } - if (action === 'verify-upload') { - if (args.length !== 1) fail('usage: verify-upload '); - const responseText = await readJsonFile(args[0], 'cf upload response'); - const upload = extractUploadedVersion(responseText, { receiptDigest: required('INIT_RECEIPT_DIGEST'), sourceSha: required('GITHUB_SHA') }); - const accountId = required('CF_SMOKE_UPLOAD_ACCOUNT_ID'); - const workerId = required('INIT_WORKER_ID'); - const readToken = required('CF_SMOKE_UPLOAD_READ_TOKEN'); - const versions = await readVersions({ accountId, workerId, readToken }); - assertExactVersionReadback({ versionId: upload.versionId, versions, sourceSha: required('GITHUB_SHA'), receiptDigest: required('INIT_RECEIPT_DIGEST') }); - await verifySmokePostUpload({ approvedAccountId: accountId, expectedZoneIds: required('CF_SMOKE_UPLOAD_EXPECTED_ZONE_IDS'), readToken, expectedWorkerId: workerId }); - console.log(`Verified immutable smoke version ${upload.versionId}; no deployment, route or preview was created.`); - return; - } - if (action === 'dry-run') { - if (args.length !== 1) fail('usage: dry-run '); - assertDryRunOutput(await readJsonFile(args[0], 'cf dry-run output')); - return; - } - fail('action must be fetch-init, validate-init, preflight, verify-upload, or dry-run'); -} - -if (process.argv[1] && new URL(import.meta.url).pathname === process.argv[1]) { - main().catch(error => { - console.error(error instanceof Error ? error.message : 'Smoke version upload validation failed'); - process.exitCode = 1; - }); -} diff --git a/pm-stack/private-laptop-bridge/smoke-upload.test.mjs b/pm-stack/private-laptop-bridge/smoke-upload.test.mjs deleted file mode 100644 index 80bf157a9a..0000000000 --- a/pm-stack/private-laptop-bridge/smoke-upload.test.mjs +++ /dev/null @@ -1,141 +0,0 @@ -import test from 'node:test'; -import assert from 'node:assert/strict'; -import { - assertDryRunOutput, - assertExactVersionReadback, - extractUploadedVersion, - fetchInitRunEvidence, - readVersions, - validateInitReceipt, -} from './smoke-upload.mjs'; -import { createInitReceipt, verifySmokeEmptyTarget, WORKER_NAME, CREATE_BODY } from './bootstrap-smoke.mjs'; - -const accountId = `${'a'.repeat(28)}cbfa`; -const zoneId = '1'.repeat(32); -const workerId = '0123456789abcdef0123456789abcdef'; -const sourceSha = 'a'.repeat(40); -const receiptDigest = 'b'.repeat(64); -const readToken = 'synthetic-read-token-0000000'; -const ok = (result, resultInfo) => new Response(JSON.stringify({ success: true, result, ...(resultInfo === undefined ? {} : { result_info: resultInfo }) })); -const worker = () => ({ id: workerId, name: WORKER_NAME, logpush: false, observability: { enabled: false }, subdomain: { enabled: false, previews_enabled: false }, deployed_on: null, references: { domains: [] } }); - -function uploadFixture({ versions = [], versionPages, route, deployments = [], workerRecord = worker(), omitMetadata = false } = {}) { - const calls = []; - const fetchImpl = async (url, init = {}) => { - const parsed = new URL(url); - calls.push({ parsed, init }); - if (parsed.pathname === '/client/v4/zones') return ok([{ id: zoneId, account: { id: accountId } }], omitMetadata ? undefined : { total_pages: 1, total_count: 1, page: 1, per_page: 50, count: 1 }); - if (parsed.pathname === `/client/v4/zones/${zoneId}/workers/routes`) return ok(route ? [route] : []); - if (parsed.pathname.endsWith(`/workers/workers/${WORKER_NAME}`)) return ok(workerRecord); - if (parsed.pathname.endsWith(`/workers/scripts/${WORKER_NAME}/deployments`)) return ok({ deployments }); - if (parsed.pathname.endsWith(`/workers/workers/${workerId}/versions`)) { - if (versionPages) { - const page = Number(parsed.searchParams.get('page')); - const result = versionPages[page - 1] ?? []; - return ok(result, omitMetadata ? undefined : { page, per_page: 100, count: result.length, total_count: versionPages.flat().length, total_pages: versionPages.length }); - } - return ok(versions, omitMetadata ? undefined : { page: 1, per_page: 100, count: versions.length, total_count: versions.length, total_pages: versions.length ? 1 : 0 }); - } - throw new Error(`unexpected request ${parsed.pathname}`); - }; - return { calls, fetchImpl }; -} - -function trustedEvidence() { - const receipt = createInitReceipt({ approvedAccountId: accountId, workerId, status: 'created', repository: 'developing-today/code', sourceSha, runId: '123456789', runAttempt: 1, event: 'workflow_dispatch', branch: 'main' }); - const run = { id: 123456789, run_attempt: 1, status: 'completed', conclusion: 'success', event: 'workflow_dispatch', head_branch: 'main', head_sha: sourceSha, path: '.github/workflows/private-laptop-bridge-smoke-init.yml@refs/heads/main', repository: { full_name: 'developing-today/code' } }; - const names = ['Run offline bootstrap contract tests', 'Create only the fixed empty Worker and verify it read-only', 'Preserve verified smoke initialization receipt']; - const jobs = { total_count: 1, jobs: [{ name: 'initialize', run_id: run.id, head_sha: sourceSha, status: 'completed', conclusion: 'success', steps: names.map(name => ({ name, status: 'completed', conclusion: 'success' })) }] }; - return { receiptJson: `${JSON.stringify(receipt)}\n`, run, jobs }; -} - -test('successful init receipt is tied to exact protected main run, attempt, account, and SHA', () => { - const { receiptJson, run, jobs } = trustedEvidence(); - const validated = validateInitReceipt({ receiptJson, runJson: JSON.stringify(run), jobsJson: JSON.stringify(jobs), expectedAccountId: accountId, currentSha: sourceSha, initRunId: '123456789' }); - assert.equal(validated.workerId, workerId); - assert.match(validated.receiptDigest, /^[a-f0-9]{64}$/); - for (const edit of [ - value => { value.run.status = 'in_progress'; }, - value => { value.run.head_sha = 'c'.repeat(40); }, - value => { value.run.event = 'pull_request'; }, - value => { value.run.path = '.github/workflows/other.yml@refs/heads/main'; }, - value => { value.jobs.jobs[0].steps[1].conclusion = 'failure'; }, - ]) { - const evidence = trustedEvidence(); edit(evidence); - assert.throws(() => validateInitReceipt({ receiptJson: evidence.receiptJson, runJson: JSON.stringify(evidence.run), jobsJson: JSON.stringify(evidence.jobs), expectedAccountId: accountId, currentSha: sourceSha, initRunId: '123456789' })); - } - assert.throws(() => validateInitReceipt({ receiptJson, runJson: JSON.stringify(run), jobsJson: JSON.stringify(jobs), expectedAccountId: `${'f'.repeat(28)}cbfa`, currentSha: sourceSha, initRunId: '123456789' }), /account/); - assert.throws(() => validateInitReceipt({ receiptJson, runJson: JSON.stringify(run), jobsJson: JSON.stringify(jobs), expectedAccountId: accountId, currentSha: 'c'.repeat(40), initRunId: '123456789' }), /exact main dispatch SHA/); -}); - -test('init evidence fetch is fixed to repository and receipt attempt', async () => { - const { receiptJson } = trustedEvidence(); - const urls = []; - const evidence = await fetchInitRunEvidence({ receiptJson, initRunId: '123456789', githubToken: 'synthetic-github-token-000000', fetchImpl: async url => { - urls.push(String(url)); - return new Response(JSON.stringify(urls.length === 1 ? { id: 123456789 } : { jobs: [], total_count: 0 })); - } }); - assert.equal(urls[0], 'https://api.github.com/repos/developing-today/code/actions/runs/123456789'); - assert.match(urls[1], /attempts\/1\/jobs\?per_page=100$/); - assert.equal(evidence.jobs.total_count, 0); - await assert.rejects(fetchInitRunEvidence({ receiptJson, initRunId: 'not-an-id', githubToken: 'synthetic-github-token-000000', fetchImpl: async () => new Response('{}') }), /run ID/); -}); - -test('pinned cf dry-run must show the fixed disabled smoke config', () => { - assert.equal(assertDryRunOutput('env.ENABLED ("false")\nenv.GATEWAY_HOST ("private-bridge-smoke.invalid")\nenv.GATEWAY_ACCOUNT_ID ("")\nenv.GATEWAY_POLICY_ID ("")\nenv.START_MS ("")\nenv.END_MS ("")\n--dry-run: exiting now.'), true); - assert.throws(() => assertDryRunOutput('--dry-run: exiting now. private-laptop-bridge-smoke'), /did not validate/); - assert.deepEqual(CREATE_BODY.subdomain, { enabled: false, previews_enabled: false }); -}); - -test('upload response must be the pinned exact version-upload schema and UUID', () => { - const good = extractUploadedVersion(JSON.stringify({ type: 'version-upload', version: 1, worker_name: WORKER_NAME, version_id: '00000000-0000-4000-8000-000000000001' }), { receiptDigest, sourceSha }); - assert.equal(good.versionId, '00000000-0000-4000-8000-000000000001'); - assert.equal(good.message, `init_receipt_sha256=${receiptDigest}`); - for (const response of [ - { type: 'version-upload', version: 1, worker_name: 'wrong', version_id: good.versionId }, - { type: 'version-upload', version: 1, worker_name: WORKER_NAME, version_id: 'latest' }, - { type: 'version-upload', version: 2, worker_name: WORKER_NAME, version_id: good.versionId }, - ]) assert.throws(() => extractUploadedVersion(JSON.stringify(response), { receiptDigest, sourceSha })); -}); - -test('version readback tolerates omitted optional pagination metadata but proves complete list', async () => { - const f = uploadFixture({ versions: [{ id: 'old' }], omitMetadata: true }); - const result = await readVersions({ accountId, workerId, readToken, fetchImpl: f.fetchImpl }); - assert.deepEqual(result, [{ id: 'old' }]); - assert.equal(f.calls.length, 1); - - const pages = uploadFixture({ versionPages: [Array.from({ length: 100 }, (_, index) => ({ id: `v${index}` })), [{ id: 'last' }]] }); - assert.equal((await readVersions({ accountId, workerId, readToken, fetchImpl: pages.fetchImpl })).length, 101); - assert.equal(pages.calls.length, 2); -}); - -test('version pagination mismatch and unavailable readback fail closed', async () => { - const mismatch = uploadFixture(); - mismatch.fetchImpl = async url => new Response(JSON.stringify({ success: true, result: [], result_info: { page: 2, total_count: 0 } })); - await assert.rejects(readVersions({ accountId, workerId, readToken, fetchImpl: mismatch.fetchImpl }), /page does not match/); - await assert.rejects(readVersions({ accountId, workerId, readToken, fetchImpl: async () => new Response('{}', { status: 403 }) }), /authorization denied/); - await assert.rejects(readVersions({ accountId, workerId, readToken, fetchImpl: async () => { throw new Error('offline'); } }), /request failed/); -}); - -test('preflight checks exact unrouted target and rejects identity, route, or existing version state', async () => { - const good = uploadFixture(); - const result = await readVersions({ accountId, workerId, readToken, fetchImpl: good.fetchImpl }); - assert.deepEqual(result, []); - - const wrongWorker = uploadFixture({ workerRecord: { ...worker(), id: 'f'.repeat(32) } }); - await assert.rejects(verifySmokeEmptyTarget({ approvedAccountId: accountId, expectedZoneIds: [zoneId], readToken, expectedWorkerId: workerId, fetchImpl: wrongWorker.fetchImpl }), /identity differs/); - const routed = uploadFixture({ route: { id: 'route', pattern: 'example.invalid/*', script: WORKER_NAME } }); - await assert.rejects(verifySmokeEmptyTarget({ approvedAccountId: accountId, expectedZoneIds: [zoneId], readToken, expectedWorkerId: workerId, fetchImpl: routed.fetchImpl }), /route already targets/); - const nonempty = uploadFixture({ versions: [{ id: 'old' }] }); - await assert.rejects(verifySmokeEmptyTarget({ approvedAccountId: accountId, expectedZoneIds: [zoneId], readToken, expectedWorkerId: workerId, fetchImpl: nonempty.fetchImpl }), /already has a version/); -}); - -test('post-upload proof requires exactly the returned UUID, provenance, no public URLs, and no preview', () => { - const versionId = '00000000-0000-4000-8000-000000000001'; - const valid = { id: versionId, annotations: { 'workers/tag': sourceSha, 'workers/message': `init_receipt_sha256=${receiptDigest}` }, urls: [], hasPreview: false }; - assert.equal(assertExactVersionReadback({ versionId, versions: [valid], sourceSha, receiptDigest }), true); - assert.throws(() => assertExactVersionReadback({ versionId, versions: [valid, { id: 'other' }], sourceSha, receiptDigest }), /version set is not exactly one/); - assert.throws(() => assertExactVersionReadback({ versionId, versions: [{ ...valid, urls: ['https://preview.invalid'] }], sourceSha, receiptDigest }), /routable or preview URL/); - assert.throws(() => assertExactVersionReadback({ versionId, versions: [{ ...valid, hasPreview: true }], sourceSha, receiptDigest }), /routable or preview URL/); - assert.throws(() => assertExactVersionReadback({ versionId, versions: [{ ...valid, annotations: {} }], sourceSha, receiptDigest }), /does not bind/); -}); diff --git a/pm-stack/private-laptop-bridge/smoke.mjs b/pm-stack/private-laptop-bridge/smoke.mjs deleted file mode 100644 index 106bd4df38..0000000000 --- a/pm-stack/private-laptop-bridge/smoke.mjs +++ /dev/null @@ -1,20 +0,0 @@ -// Stateless Gateway routing rehearsal. No bridge credentials, storage or Fleet data. -import { WorkerEntrypoint } from 'cloudflare:workers'; -const reply = (status) => new Response(status === 200 ? 'private-bridge-smoke-v1\n' : 'denied\n', { - status, headers: {'cache-control':'no-store','content-type':'text/plain','x-content-type-options':'nosniff'} -}); -export class GatewayMiddleware extends WorkerEntrypoint { - async handle(request, context, _next) { - const {ENABLED, GATEWAY_HOST:host, GATEWAY_ACCOUNT_ID:account, GATEWAY_POLICY_ID:policy, START_MS:start, END_MS:end} = this.env; - const now = Date.now(), begins = Number(start), ends = Number(end); - if (ENABLED !== 'true' || !/^\d{13}$/.test(start || '') || !/^\d{13}$/.test(end || '') || ends <= begins || ends - begins > 600000 || now < begins || now >= ends) return reply(503); - if (typeof host !== 'string' || host.length > 253 || host.split('.').some(x => x.length > 63) || !/^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,63}$/.test(host) || !/^[0-9a-f]{32}$/.test(account || '') || !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(policy || '')) return reply(503); - const expected = `https://${host}/smoke/v1`; - if (request.method !== 'GET' || request.url !== expected || request.body !== null || [...request.headers.keys()].some(h => ['authorization','proxy-authorization','cookie','upgrade'].includes(h) || h.startsWith('x-bridge-'))) return reply(403); - if (!context || context.accountId !== account || context.policyId !== policy || context.host !== host || context.uri !== expected || (context.sni !== undefined && context.sni !== host)) return reply(403); - // Gateway policy supplies the approved transport restriction. Service bindings - // could fabricate context and must never be granted to other Workers. - return reply(200); - } -} -export default {fetch() {return reply(403);}}; From 4b36e4c59e5ece24827ab91bb5200c086d587e12 Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Mon, 23 Nov 2026 01:46:15 +0000 Subject: [PATCH 7/7] Accept exact Worker-not-found provider response --- .../private-laptop-bridge/bootstrap-smoke.mjs | 11 ++++- .../bootstrap-smoke.test.mjs | 48 ++++++++++++++----- 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs b/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs index ca3a0f2e4b..8bc4789df7 100644 --- a/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs +++ b/pm-stack/private-laptop-bridge/bootstrap-smoke.mjs @@ -72,8 +72,15 @@ async function requestWithInfo(fetchImpl, url, token, { method = 'GET', body, al let payload; try { payload = await response.json(); } catch { fail(`Cloudflare returned invalid JSON (HTTP ${response.status})`); } if (response.status === 404 && allowWorkerNotFound) { - if (payload?.success === false && Array.isArray(payload.errors) && payload.errors.length === 1 && - payload.errors[0]?.code === 10007 && /^worker not found\.?$/i.test(String(payload.errors[0].message))) { + let requestedUrl; + try { requestedUrl = new URL(url); } catch { fail('Cloudflare Worker lookup URL is invalid'); } + const exactEndpoint = requestedUrl.origin === new URL(API).origin && + new RegExp(`^${new URL(API).pathname}/accounts/[a-f0-9]{32}/workers/workers/${WORKER_NAME}$`, 'i').test(requestedUrl.pathname) && + requestedUrl.search === '' && requestedUrl.hash === ''; + const exactResponseUrl = !response.url || response.url === url; + if (method === 'GET' && exactEndpoint && exactResponseUrl && payload?.success === false && + (!Object.hasOwn(payload, 'result') || payload.result === null) && Array.isArray(payload.errors) && payload.errors.length === 1 && + payload.errors[0]?.code === 10007) { return { absent: true, resultInfo: payload.result_info }; } } diff --git a/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs b/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs index 447a7e378d..3212f17bf5 100644 --- a/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs +++ b/pm-stack/private-laptop-bridge/bootstrap-smoke.test.mjs @@ -20,11 +20,16 @@ const safeWorker = () => ({ const ok = (result, result_info = { total_pages: 1, page: 1, per_page: 50, total_count: Array.isArray(result) ? result.length : 0 }) => new Response(JSON.stringify({ success: true, result, ...(result_info === undefined ? {} : { result_info }) }), { status: 200 }); const okNoInfo = result => new Response(JSON.stringify({ success: true, result }), { status: 200 }); -const missing = (code = 10007, message = 'Worker not found.') => - new Response(JSON.stringify({ success: false, errors: [{ code, message }] }), { status: 404 }); +const missing = (code = 10007, message = 'Worker not found.', { result = undefined, includeResult = false, status = 404, responseUrl } = {}) => { + const body = { success: false, errors: [{ code, message }] }; + if (includeResult) body.result = result; + const response = new Response(JSON.stringify(body), { status }); + if (responseUrl !== undefined) Object.defineProperty(response, 'url', { value: responseUrl }); + return response; +}; -function fixture({ worker = null, createdWorker = safeWorker(), route = null, zones = [{ id: zoneId, account: { id: accountId } }], zoneResultInfo, zonePages, versions = [], versionResultInfo, deployments = [], deploymentResultInfo, deploymentNoInfo = false, createResult = null, authFailure = false, writeAuthFailure = false, missingCode = 10007, missingMessage = 'Worker not found.' } = {}) { - const state = { worker, createdWorker, route, zones, zoneResultInfo, zonePages, versions, versionResultInfo, deployments, deploymentResultInfo, deploymentNoInfo, createResult, authFailure, writeAuthFailure, missingCode, missingMessage, calls: [] }; +function fixture({ worker = null, createdWorker = safeWorker(), route = null, zones = [{ id: zoneId, account: { id: accountId } }], zoneResultInfo, zonePages, versions = [], versionResultInfo, deployments = [], deploymentResultInfo, deploymentNoInfo = false, createResult = null, authFailure = false, writeAuthFailure = false, missingCode = 10007, missingMessage = 'Worker not found.', missingResult, includeMissingResult = false, missingResponseUrl, zoneFailure = false } = {}) { + const state = { worker, createdWorker, route, zones, zoneResultInfo, zonePages, versions, versionResultInfo, deployments, deploymentResultInfo, deploymentNoInfo, createResult, authFailure, writeAuthFailure, missingCode, missingMessage, missingResult, includeMissingResult, missingResponseUrl, zoneFailure, calls: [] }; const fetchImpl = async (url, init = {}) => { const parsed = new URL(url); const method = init.method ?? 'GET'; @@ -37,6 +42,7 @@ function fixture({ worker = null, createdWorker = safeWorker(), route = null, zo return new Response(JSON.stringify({ success: false, errors: [{ code: 10000, message: 'Authentication error' }] }), { status: 403 }); } if (parsed.pathname === '/client/v4/zones') { + if (state.zoneFailure) return missing(10007, 'Not found'); if (state.zonePages) { const page = Number(parsed.searchParams.get('page')); const result = state.zonePages[page - 1] ?? []; @@ -46,7 +52,7 @@ function fixture({ worker = null, createdWorker = safeWorker(), route = null, zo } if (parsed.pathname.endsWith('/workers/routes')) return ok(state.route ? [state.route] : []); if (parsed.pathname.endsWith(`/workers/workers/${WORKER_NAME}`) && method === 'GET') { - return state.worker ? ok(state.worker, undefined) : missing(state.missingCode, state.missingMessage); + return state.worker ? ok(state.worker, undefined) : missing(state.missingCode, state.missingMessage, { result: state.missingResult, includeResult: state.includeMissingResult, responseUrl: state.missingResponseUrl }); } if (parsed.pathname.endsWith('/workers/workers') && method === 'POST') { state.worker = state.createdWorker; @@ -111,13 +117,33 @@ test('missing credentials fail before any network request', async () => { }); test('only the documented Worker-specific 404 means absent', async () => { - const generic = fixture({ missingCode: 10000, missingMessage: 'Resource not found' }); - await assert.rejects(run({ fetchImpl: generic.fetchImpl }), /API request failed/); - assert.equal(generic.state.calls.some(call => call.method === 'POST'), false); + for (const options of [ + { missingMessage: 'The worker resource does not exist for this account.' }, + { missingMessage: 'Not found', includeMissingResult: true, missingResult: null }, + ]) { + const actual = fixture(options); + assert.equal(await run({ fetchImpl: actual.fetchImpl }), 'created'); + assert.equal(actual.state.calls.filter(call => call.method === 'POST').length, 1); + } + + for (const denied of [ + fixture({ missingCode: 10000, missingMessage: 'Resource not found' }), + fixture({ missingCode: '10007', missingMessage: 'Worker not found' }), + fixture({ includeMissingResult: true, missingResult: {} }), + fixture({ missingMessage: 'Worker not found', missingResponseUrl: 'https://api.cloudflare.com/client/v4/accounts/aaaaaaaaaaaaaaaaaaaaaaaaaaaacbfa/workers/workers/other' }), + fixture({ zoneFailure: true }), + ]) { + await assert.rejects(run({ fetchImpl: denied.fetchImpl })); + assert.equal(denied.state.calls.some(call => call.method === 'POST'), false); + } - const wrongMessage = fixture({ missingCode: 10007, missingMessage: 'Not found' }); - await assert.rejects(run({ fetchImpl: wrongMessage.fetchImpl }), /API request failed/); - assert.equal(wrongMessage.state.calls.some(call => call.method === 'POST'), false); + const html = fixture(); + const htmlFetch = html.fetchImpl; + html.fetchImpl = async (url, init) => new URL(url).pathname.endsWith(`/workers/workers/${WORKER_NAME}`) + ? new Response('not found', { status: 404, headers: { 'content-type': 'text/html' } }) + : htmlFetch(url, init); + await assert.rejects(run({ fetchImpl: html.fetchImpl }), /invalid JSON/); + assert.equal(html.state.calls.some(call => call.method === 'POST'), false); }); test('read and create authorization failures stop without retry', async () => {