Pool host-approved restricted code with scoped and fair graph execution
This commit is contained in:
@@ -11,8 +11,12 @@ import {
|
||||
} from "./metadata.js";
|
||||
const rootPattern = /^\/nix\/store\/[a-z0-9]{32}-[^/\s]+$/;
|
||||
async function readJson(root: string, file: string, scope: CandidateMetadataScope): Promise<any> {
|
||||
const bytes = await readCandidateMetadata(join(root, file), scope, 32 * 1024 * 1024);
|
||||
return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
||||
const input = await readCandidateMetadata(join(root, file), scope, 32 * 1024 * 1024);
|
||||
try {
|
||||
return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(input.bytes));
|
||||
} finally {
|
||||
input.releaseInput();
|
||||
}
|
||||
}
|
||||
/** Load the checked Nix output, preserving its original compilation and provenance.
|
||||
* The selected toolchain validates generated code during the build. This loader
|
||||
|
||||
Reference in New Issue
Block a user