IF Commons GitHub

governance/pins

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-scanners-catalog FR-004

The pin of a scanner's binary: its version, where it is and the SHA-256 of the file. A tool is run only when the file at the pin's path has the pinned digest: a tool that was replaced, updated in place or never pinned is refused, and so is one whose pin is missing a field. The pins are the tenant's and an owner's approval is a commit that holds them; nothing here installs a tool or fetches one.

import { parsePins } from "./pins.ts";
parsePins({ nuclei: { version: "3.3.0", path: "/opt/tools/nuclei", sha256: "a".repeat(64) } }).kind; // "ok"

Source: commons/scanners/src/governance/pins.ts

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

governance.Pintypeno test imports it
type Pin = { readonly version: string; readonly path: string; readonly sha256: string };

The pin of one tool.

governance.Pinstypeno test imports it
type Pins = Readonly<Record<string, Pin>>;

The pins of a tenant, by tool.

governance.parsePinsfunctionno test imports it
function parsePins(data: unknown): Result<Readonly<Record<string, Pin>>, readonly string[]>

The pins from data, or every reason it is refused.

Pintypeno test imports it
type Pin = { readonly version: string; readonly path: string; readonly sha256: string };

The pin of one tool.

Pinstype
type Pins = Readonly<Record<string, Pin>>;

The pins of a tenant, by tool.

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

parsePinsfunction
function parsePins(data: unknown): Result<Readonly<Record<string, Pin>>, readonly string[]>

The pins from data, or every reason it is refused.

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

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