IF Commons GitHub

governance/services

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0007-estate-kinds FR-004

The common services: the well known network services an estate has endpoints for, by name, with the transport and the port each is usually found on, what kind of service it is, and whether it speaks in the clear. An endpoint names its service from this catalog, so that a passive check, a scope or a query can say "every management service that is open to the internet" and mean the same thing every time. The data is ours: ports and protocols are facts of the standards, the classes are the estate's own words.

import { serviceByName } from "./services.ts";
serviceByName("postgres")?.port; // 5432

Source: commons/estate/src/governance/services.ts

4 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.

SERVICE_CLASSESconst
const SERVICE_CLASSES: readonly ["web", "management", "data", "mail", "directory", "file", "name", "time", "orchestration"]

The class of a service, in the estate's own words: what reaching it lets someone do.

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

ServiceClasstypeno test imports it
type ServiceClass = (typeof SERVICE_CLASSES)[number];

A class of service.

ServiceSpectypeno test imports it
type ServiceSpec = {
  readonly name: string;
  readonly transport: "tcp" | "udp";
  readonly port: number;
  readonly class: ServiceClass;
  /** Whether the service, spoken on this port as it stands, carries its traffic in the clear. */
  readonly cleartext: boolean;
  readonly summary: string;
};

A common service.

SERVICESconst
const SERVICES: readonly ServiceSpec[]

The common services, by name.

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

serviceByNamefunction
function serviceByName(name: string): ServiceSpec | undefined

A service by its name.

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

servicesOnPortfunction
function servicesOnPort(port: number, transport: "tcp" | "udp"): readonly ServiceSpec[]

The services found on a port and transport (more than one where a port is shared, such as ssh and sftp).

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

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