attestedAtinstantrequiredWhen it was judged
Becomes the column attested_at of device_attestation.
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.
attestedAtinstantrequiredWhen it was judged
Becomes the column attested_at of device_attestation.
deviceAttestationIdidentifierrequiredWhat identifies the attestation, made by the application
Becomes the column device_attestation_id of device_attestation.
evidenceHashtextrequiredA hash of the evidence; the evidence is kept by the verifier
Becomes the column evidence_hash of device_attestation.
expiresAtinstantrequiredWhen it stops counting
Becomes the column expires_at of device_attestation.
kindcode of attestationKindrequiredWhat was proved
Becomes the column kind of device_attestation.
nonceHashtextrequiredA hash of the nonce the device was challenged with
Becomes the column nonce_hash of device_attestation.
resultcode of attestationResultrequiredHow it was judged
Becomes the column result of device_attestation.
verifiertextrequiredWhat judged it
Becomes the column verifier of device_attestation.
deviceoneThe device To device. Written at commons/data/models/identity-device/mod.ts:51
Projects to the table device_attestation with the primary key device_attestation_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
attested_at | timestamp | false | attribute | deviceAttestation.attestedAt |
device_attestation_id | text | false | attribute | deviceAttestation.deviceAttestationId |
device_principal_id | text | false | reference | deviceAttestation.device |
evidence_hash | text | false | attribute | deviceAttestation.evidenceHash |
expires_at | timestamp | false | attribute | deviceAttestation.expiresAt |
kind | text | false | attribute | deviceAttestation.kind |
nonce_hash | text | false | attribute | deviceAttestation.nonceHash |
result | text | false | attribute | deviceAttestation.result |
verifier | text | false | attribute | deviceAttestation.verifier |
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'))
);CREATE TABLE IF NOT EXISTS "device_attestation" (
"device_attestation_id" TEXT NOT NULL PRIMARY KEY,
"kind" TEXT NOT NULL,
"evidence_hash" TEXT NOT NULL,
"verifier" TEXT NOT NULL,
"result" TEXT NOT NULL,
"attested_at" TIMESTAMPTZ NOT NULL,
"expires_at" TIMESTAMPTZ NOT NULL,
"nonce_hash" TEXT NOT NULL,
"device_principal_id" TEXT 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'))
);CREATE TABLE IF NOT EXISTS "device_attestation" (
"device_attestation_id" TEXT NOT NULL PRIMARY KEY,
"kind" TEXT NOT NULL,
"evidence_hash" TEXT NOT NULL,
"verifier" TEXT NOT NULL,
"result" TEXT NOT NULL,
"attested_at" TEXT NOT NULL,
"expires_at" TEXT NOT NULL,
"nonce_hash" TEXT NOT NULL,
"device_principal_id" TEXT 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'))
);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);