IF Commons GitHub

governance/ids

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

The names of Archon, each a branded text made only by the function that validates it: a requirement, a kind of resource, a subject (a host name), a dialect and a reference to a secret (never the secret itself).

import { parseSubjectName } from "./ids.ts";
parseSubjectName("web-01.example.test").kind; // "ok"
parseSubjectName("Web 01").kind; // "err"

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

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

RequirementIdtype
type RequirementId = Brand<string, "archon requirement id">;

The identity of a requirement, stable for the life of the requirement.

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

ResourceKindIdtypeno test imports it
type ResourceKindId = Brand<string, "archon resource kind">;

The identity of a kind of resource.

SubjectNametypeno test imports it
type SubjectName = Brand<string, "archon subject name">;

The name of a subject: a host name.

DialectIdtypeno test imports it
type DialectId = Brand<string, "archon dialect id">;

The identity of a dialect.

SecretReftypeno test imports it
type SecretRef = Brand<string, "archon secret reference">;

A reference to a secret kept in a store: secret:<store>/<name>.

parseRequirementIdconst
const parseRequirementId: (text: string) => Result<RequirementId, string>

A requirement id from text: lower case words of letters and digits joined by dots or hyphens, starting with a letter, at most 100 characters.

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

parseKindIdconst
const parseKindId: (text: string) => Result<ResourceKindId, string>

A kind id from text: lower case words joined by hyphens, starting with a letter.

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

parseSubjectNameconst
const parseSubjectName: (text: string) => Result<SubjectName, string>

A subject name from text: a host name of labels of lower case letters, digits and hyphens joined by dots, at most 253 characters.

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

parseDialectIdconst
const parseDialectId: (text: string) => Result<DialectId, string>

A dialect id from text: lower case words joined by hyphens, starting with a letter.

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

parseSecretRefconst
const parseSecretRef: (text: string) => Result<SecretRef, string>

A secret reference from text: secret:<store>/<name>.

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

isSecretReffunctionno test imports it
function isSecretRef(text: string): boolean

Whether a text is a secret reference.

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