IF Commons GitHub

physical/bundle-files

Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0011-grc-bundles FR-002, 0011-grc-bundles FR-010, 0011-grc-bundles FR-012

The file adapter of bundle verification (0011-grc-bundles FR-002): it reads a folder into the contents verifyBundle takes, and reads the keys and the evidence policy the verifier gives. It reads files only: no network, and nothing is written.

import { readBundle } from "./bundle-files.ts";
// const contents = await readBundle("./bundle"); // { kind: "ok", value: { manifest, ledger, evidence, signature, items } }

Source: commons/grc/src/physical/bundle-files.ts

2 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

physical.readBundlefunctionno test imports it
function readBundle(dir: string): Promise<Result<BundleContents, string>>

The bundle in a folder: its documents' text (absent where a file is) and the bytes of items/<digest>; or why the folder cannot be read.

// const contents = await readBundle("./bundle");
physical.readTrustfunctionno test imports it
function readTrust(policyFile: string, keysFilePath: string, signer: Signer): Promise<Result<Trust, string>>

The trust of a verifier: the evidence policy file (a grc.evidence-policy), the keys file ({ "keys": [{ keyid, role, jwk }] } of public keys) and the signer that verifies; or why a file cannot be read.

// const trust = await readTrust("policy.json", "keys.json", dsseSigner);
readBundlefunction
function readBundle(dir: string): Promise<Result<BundleContents, string>>

The bundle in a folder: its documents' text (absent where a file is) and the bytes of items/<digest>; or why the folder cannot be read.

// const contents = await readBundle("./bundle");

Imported by 12 tests of the run (12 passed, 0 failed): the library's results

readTrustfunction
function readTrust(policyFile: string, keysFilePath: string, signer: Signer): Promise<Result<Trust, string>>

The trust of a verifier: the evidence policy file (a grc.evidence-policy), the keys file ({ "keys": [{ keyid, role, jwk }] } of public keys) and the signer that verifies; or why a file cannot be read.

// const trust = await readTrust("policy.json", "keys.json", dsseSigner);

Imported by 12 tests of the run (12 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.