IF Commons GitHub

physical/catalog

Written to: 5 requirements: 5 proved, 0 partly, 0 failing, 0 with no test recorded. 0008-grc-catalogs FR-001, 0008-grc-catalogs FR-002, 0008-grc-catalogs FR-003, 0008-grc-catalogs FR-004, 0008-grc-catalogs FR-005

Reading a catalog package from a folder (0008-grc-catalogs): the manifest (manifest.json, a grc.catalog-package), then each document it holds through the registry of kinds, after the SHA-256 of its file is checked against the manifest. A package is data and nothing else: a file that is not listed (but a README, a LICENSE or a NOTICE), a file that could run, a path that leaves the folder, a document of a kind or a schema this release does not know, a digest that differs, a document that is not what the manifest says and a crosswalk that names a control a held framework does not have are each refused, naming the file. The package says where its content came from and under what licence, and a package whose content may not be redistributed is held to identifiers and mappings.

import { readCatalogPackage } from "./catalog.ts";
// const loaded = await readCatalogPackage("./catalog-nist-csf-2/data");

Source: commons/grc/src/physical/catalog.ts

2 of 8 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.LoadedCatalogtypeno test imports it
type LoadedCatalog = { readonly manifest: CatalogPackage; readonly documents: readonly Document[] };

A package read: its manifest and the documents it holds, in the order of the manifest.

physical.CatalogProblemtypeno test imports it
type CatalogProblem = { readonly file: string; readonly reason: string };

Why a package was refused: the file (or the manifest) and the reason.

physical.readCatalogPackagefunctionno test imports it
function readCatalogPackage(dir: string, kinds: Kinds): Promise<Result<LoadedCatalog, readonly CatalogProblem[]>>

Reads a package: the manifest first, then every file it lists; a folder that holds anything else, or whose content does not match its manifest, is refused with every problem found (so that a person fixes the package once).

physical.catalogControlUrnsfunctionno test imports it
function catalogControlUrns(loaded: LoadedCatalog): readonly string[]

The URNs of the controls of a loaded package's frameworks.

LoadedCatalogtypeno test imports it
type LoadedCatalog = { readonly manifest: CatalogPackage; readonly documents: readonly Document[] };

A package read: its manifest and the documents it holds, in the order of the manifest.

CatalogProblemtypeno test imports it
type CatalogProblem = { readonly file: string; readonly reason: string };

Why a package was refused: the file (or the manifest) and the reason.

readCatalogPackagefunction
function readCatalogPackage(dir: string, kinds: Kinds): Promise<Result<LoadedCatalog, readonly CatalogProblem[]>>

Reads a package: the manifest first, then every file it lists; a folder that holds anything else, or whose content does not match its manifest, is refused with every problem found (so that a person fixes the package once).

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

catalogControlUrnsfunction
function catalogControlUrns(loaded: LoadedCatalog): readonly string[]

The URNs of the controls of a loaded package's frameworks.

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

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