IF Commons GitHub

deviceAttestation

concept

What a device proved about itself, and how it was judged

Model identityDevice. Written in commons/data/models/identity-device/mod.ts:51. Identified by deviceAttestationId.

Governance: attributes

attestedAtinstantrequired

When it was judged

Becomes the column attested_at of device_attestation.

Written at commons/data/models/identity-device/mod.ts:59

deviceAttestationIdidentifierrequired

What identifies the attestation, made by the application

Becomes the column device_attestation_id of device_attestation.

Written at commons/data/models/identity-device/mod.ts:54

evidenceHashtextrequired

A hash of the evidence; the evidence is kept by the verifier

Becomes the column evidence_hash of device_attestation.

Written at commons/data/models/identity-device/mod.ts:56

expiresAtinstantrequired

When it stops counting

Becomes the column expires_at of device_attestation.

Written at commons/data/models/identity-device/mod.ts:60

kindcode of attestationKindrequired

What was proved

Becomes the column kind of device_attestation.

Written at commons/data/models/identity-device/mod.ts:55

nonceHashtextrequired

A hash of the nonce the device was challenged with

Becomes the column nonce_hash of device_attestation.

Written at commons/data/models/identity-device/mod.ts:61

resultcode of attestationResultrequired

How it was judged

Becomes the column result of device_attestation.

Written at commons/data/models/identity-device/mod.ts:58

verifiertextrequired

What judged it

Becomes the column verifier of device_attestation.

Written at commons/data/models/identity-device/mod.ts:57

Governance: relationships

deviceone

The device To device. Written at commons/data/models/identity-device/mod.ts:51

Logical: the table

Projects to the table device_attestation with the primary key device_attestation_id.

ColumnTypeNullRoleFrom
attested_attimestampfalseattributedeviceAttestation.attestedAt
device_attestation_idtextfalseattributedeviceAttestation.deviceAttestationId
device_principal_idtextfalsereferencedeviceAttestation.device
evidence_hashtextfalseattributedeviceAttestation.evidenceHash
expires_attimestampfalseattributedeviceAttestation.expiresAt
kindtextfalseattributedeviceAttestation.kind
nonce_hashtextfalseattributedeviceAttestation.nonceHash
resulttextfalseattributedeviceAttestation.result
verifiertextfalseattributedeviceAttestation.verifier

Physical: SQL

CREATE TABLE IF NOT EXISTS "device_attestation" (
    "device_attestation_id" VARCHAR NOT NULL PRIMARY KEY,
    "kind" VARCHAR NOT NULL,
    "evidence_hash" VARCHAR NOT NULL,
    "verifier" VARCHAR NOT NULL,
    "result" VARCHAR NOT NULL,
    "attested_at" TIMESTAMPTZ NOT NULL,
    "expires_at" TIMESTAMPTZ NOT NULL,
    "nonce_hash" VARCHAR NOT NULL,
    "device_principal_id" VARCHAR NOT NULL,
    CONSTRAINT "device_attestation_device_principal_id_fk" FOREIGN KEY ("device_principal_id") REFERENCES "device" ("principal_id"),
    CONSTRAINT "device_attestation_kind_ck" CHECK ("kind" IN ('tpm', 'platform_attestation', 'webauthn_attestation', 'spiffe_node', 'cloud_instance', 'mdm_enrollment')),
    CONSTRAINT "device_attestation_result_ck" CHECK ("result" IN ('passed', 'failed', 'unknown'))
);

Physical: the typed table

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

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

const rows = await from(deviceAttestation).select((s) => ({ deviceAttestationId: s.deviceAttestation.deviceAttestationId, kind: s.deviceAttestation.kind })).run(runner);

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