IF Commons GitHub

trustAnchor

concept

What certificates and keys are checked against: a certificate authority, or a set of public keys

Model identityPki. Written in commons/data/models/identity-pki/mod.ts:17. Identified by trustAnchorId.

Governance: attributes

kindcode of trustAnchorKindrequired

What it is

Becomes the column kind of trust_anchor.

Written at commons/data/models/identity-pki/mod.ts:22

materialtextrequired

The public certificate, or the address of the public keys; public by nature

Becomes the column material of trust_anchor.

Written at commons/data/models/identity-pki/mod.ts:23

notAfterinstantoptional

When it stops being trusted

Becomes the column not_after of trust_anchor.

Written at commons/data/models/identity-pki/mod.ts:24

statuscode of useStatusrequired

Whether it is trusted

Becomes the column status of trust_anchor.

Written at commons/data/models/identity-pki/mod.ts:25

trustAnchorIdidentifierrequired

What identifies the trust anchor, made by the application

Becomes the column trust_anchor_id of trust_anchor.

Written at commons/data/models/identity-pki/mod.ts:20

trustDomaintextrequired

The domain of trust it anchors, such as a SPIFFE trust domain

Becomes the column trust_domain of trust_anchor.

Written at commons/data/models/identity-pki/mod.ts:21

Governance: relationships

tenantoptional

The tenant it is for; empty for the platform's To tenant. Written at commons/data/models/identity-pki/mod.ts:17

Logical: the table

Projects to the table trust_anchor with the primary key trust_anchor_id.

ColumnTypeNullRoleFrom
kindtextfalseattributetrustAnchor.kind
materialtextfalseattributetrustAnchor.material
not_aftertimestamptrueattributetrustAnchor.notAfter
statustextfalseattributetrustAnchor.status
tenant_idtexttruereferencetrustAnchor.tenant
trust_anchor_idtextfalseattributetrustAnchor.trustAnchorId
trust_domaintextfalseattributetrustAnchor.trustDomain

Physical: SQL

CREATE TABLE IF NOT EXISTS "trust_anchor" (
    "trust_anchor_id" VARCHAR NOT NULL PRIMARY KEY,
    "trust_domain" VARCHAR NOT NULL,
    "kind" VARCHAR NOT NULL,
    "material" VARCHAR NOT NULL,
    "not_after" TIMESTAMPTZ,
    "status" VARCHAR NOT NULL,
    "tenant_id" VARCHAR,
    CONSTRAINT "trust_anchor_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
    CONSTRAINT "trust_anchor_kind_ck" CHECK ("kind" IN ('x_509', 'jwks')),
    CONSTRAINT "trust_anchor_status_ck" CHECK ("status" IN ('active', 'retired'))
);

Physical: the typed table

Read and written from TypeScript with the types the model gives: import { trustAnchor } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity-pki.auto.ts: do not edit.

import { from } from "@intellectual-frontiers/data/sql/typed";
import { trustAnchor } from "@intellectual-frontiers/data/sql/typed/models";

const rows = await from(trustAnchor).select((s) => ({ trustAnchorId: s.trustAnchor.trustAnchorId, trustDomain: s.trustAnchor.trustDomain })).run(runner);

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