IF Commons GitHub

governance/secret

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

A guard against a secret in a model: a model holds a reference to a secret and never the secret, and this finds the text of a desired state that looks like one. It is a guard, never a proof that no secret is present: the rule is that the model holds references only.

import { findSecretLike } from "./secret.ts";
findSecretLike({ content: "-----BEGIN PRIVATE KEY-----" }); // [{ path: "$.content", why: "private-key" }]

Source: commons/archon/src/governance/secret.ts

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

SecretReasontypeno test imports it
type SecretReason = "private-key" | "cloud-key" | "token" | "named-secret";

Why a text was taken for a secret.

SecretFindingtypeno test imports it
type SecretFinding = { readonly path: string; readonly why: SecretReason };

A text of a desired state that looks like a secret, and where it is.

findSecretLikefunction
function findSecretLike(value: JsonValue, path?: string, key?: string): readonly SecretFinding[]

Every text of a value that looks like a secret, by the path where it is: a text in a private key, a key of a cloud or a token of a code host, and any non-empty text under a key named for a secret that is not a reference to one.

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

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