environmentcode of environmentoptionalWhere it runs
Becomes the column environment_code of machine.
A program that acts for itself, with a person or a group accountable for it
Model identityMachine. Written in commons/data/models/identity-machine/mod.ts:21. Identified by principal.
environmentcode of environmentoptionalWhere it runs
Becomes the column environment_code of machine.
isBreakGlassbooleanrequiredWhether it is an account kept for emergencies, whose every use is reviewed
Becomes the column is_break_glass of machine.
machineKindcode of machineKindrequiredWhat kind of program it is
Becomes the column machine_kind of machine.
maxCredentialDaysintegeroptionalThe longest a credential of the machine may live
Becomes the column max_credential_days of machine.
purposetextrequiredWhat it is for
Becomes the column purpose of machine.
reviewByinstantoptionalWhen the machine must next be reviewed by its owner
Becomes the column review_by of machine.
principaloneThe principal the machine is To principal. Written at commons/data/models/identity-machine/mod.ts:21
Projects to the table machine with the primary key principal_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
environment_code | text | true | reference | machine.environment |
is_break_glass | boolean | false | attribute | machine.isBreakGlass |
machine_kind | text | false | attribute | machine.machineKind |
max_credential_days | integer | true | attribute | machine.maxCredentialDays |
principal_id | text | false | reference | machine.principal |
purpose | text | false | attribute | machine.purpose |
review_by | timestamp | true | attribute | machine.reviewBy |
CREATE TABLE IF NOT EXISTS "machine" (
"principal_id" VARCHAR NOT NULL PRIMARY KEY,
"machine_kind" VARCHAR NOT NULL,
"purpose" VARCHAR NOT NULL,
"environment_code" VARCHAR,
"is_break_glass" BOOLEAN NOT NULL,
"max_credential_days" INTEGER,
"review_by" TIMESTAMPTZ,
CONSTRAINT "machine_principal_id_fk" FOREIGN KEY ("principal_id") REFERENCES "principal" ("principal_id"),
CONSTRAINT "machine_environment_code_fk" FOREIGN KEY ("environment_code") REFERENCES "environment" ("code"),
CONSTRAINT "machine_machine_kind_ck" CHECK ("machine_kind" IN ('service', 'workload', 'pipeline', 'integration', 'bot'))
);CREATE TABLE IF NOT EXISTS "machine" (
"principal_id" TEXT NOT NULL PRIMARY KEY,
"machine_kind" TEXT NOT NULL,
"purpose" TEXT NOT NULL,
"environment_code" TEXT,
"is_break_glass" BOOLEAN NOT NULL,
"max_credential_days" INTEGER,
"review_by" TIMESTAMPTZ,
CONSTRAINT "machine_principal_id_fk" FOREIGN KEY ("principal_id") REFERENCES "principal" ("principal_id"),
CONSTRAINT "machine_environment_code_fk" FOREIGN KEY ("environment_code") REFERENCES "environment" ("code"),
CONSTRAINT "machine_machine_kind_ck" CHECK ("machine_kind" IN ('service', 'workload', 'pipeline', 'integration', 'bot'))
);CREATE TABLE IF NOT EXISTS "machine" (
"principal_id" TEXT NOT NULL PRIMARY KEY,
"machine_kind" TEXT NOT NULL,
"purpose" TEXT NOT NULL,
"environment_code" TEXT,
"is_break_glass" INTEGER NOT NULL,
"max_credential_days" INTEGER,
"review_by" TEXT,
CONSTRAINT "machine_principal_id_fk" FOREIGN KEY ("principal_id") REFERENCES "principal" ("principal_id"),
CONSTRAINT "machine_environment_code_fk" FOREIGN KEY ("environment_code") REFERENCES "environment" ("code"),
CONSTRAINT "machine_machine_kind_ck" CHECK ("machine_kind" IN ('service', 'workload', 'pipeline', 'integration', 'bot'))
);Read and written from TypeScript with the types the model gives: import { machine } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity-machine.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { machine } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(machine).select((s) => ({ principalId: s.machine.principalId, machineKind: s.machine.machineKind })).run(runner);