allowedKindscode of credentialKindmanyThe factors that may be used
Becomes the column allowed_kinds of mfa_policy.
Written at commons/data/models/identity/concepts.ts:425
The rules for second factors
Model identity. Written in commons/data/models/identity/concepts.ts:420. Identified by mfaPolicyId.
allowedKindscode of credentialKindmanyThe factors that may be used
Becomes the column allowed_kinds of mfa_policy.
Written at commons/data/models/identity/concepts.ts:425
graceDaysintegerrequiredHow long a user may go without one when it becomes required
Becomes the column grace_days of mfa_policy.
Written at commons/data/models/identity/concepts.ts:426
mfaPolicyIdidentifierrequiredWhat identifies the policy, made by the application
Becomes the column mfa_policy_id of mfa_policy.
Written at commons/data/models/identity/concepts.ts:423
rememberDeviceDaysintegerrequiredHow long a device is trusted not to be asked
Becomes the column remember_device_days of mfa_policy.
Written at commons/data/models/identity/concepts.ts:427
requiredForRolestextmanyThe roles whose holders must always use one, by key
Becomes the column required_for_roles of mfa_policy.
Written at commons/data/models/identity/concepts.ts:428
requirementcode of mfaRequirementrequiredWhether a second factor is needed
Becomes the column requirement of mfa_policy.
Written at commons/data/models/identity/concepts.ts:424
tenantoptionalThe tenant the policy is for; empty for the platform's, which a tenant's replaces To tenant. Written at commons/data/models/identity/concepts.ts:466
Projects to the table mfa_policy with the primary key mfa_policy_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
grace_days | integer | false | attribute | mfaPolicy.graceDays |
mfa_policy_id | text | false | attribute | mfaPolicy.mfaPolicyId |
remember_device_days | integer | false | attribute | mfaPolicy.rememberDeviceDays |
requirement | text | false | attribute | mfaPolicy.requirement |
tenant_id | text | true | reference | mfaPolicy.tenant |
CREATE TABLE IF NOT EXISTS "mfa_policy" (
"mfa_policy_id" VARCHAR NOT NULL PRIMARY KEY,
"requirement" VARCHAR NOT NULL,
"grace_days" INTEGER NOT NULL,
"remember_device_days" INTEGER NOT NULL,
"tenant_id" VARCHAR,
CONSTRAINT "mfa_policy_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "mfa_policy_requirement_ck" CHECK ("requirement" IN ('none', 'optional', 'required', 'adaptive'))
);CREATE TABLE IF NOT EXISTS "mfa_policy" (
"mfa_policy_id" TEXT NOT NULL PRIMARY KEY,
"requirement" TEXT NOT NULL,
"grace_days" INTEGER NOT NULL,
"remember_device_days" INTEGER NOT NULL,
"tenant_id" TEXT,
CONSTRAINT "mfa_policy_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "mfa_policy_requirement_ck" CHECK ("requirement" IN ('none', 'optional', 'required', 'adaptive'))
);CREATE TABLE IF NOT EXISTS "mfa_policy" (
"mfa_policy_id" TEXT NOT NULL PRIMARY KEY,
"requirement" TEXT NOT NULL,
"grace_days" INTEGER NOT NULL,
"remember_device_days" INTEGER NOT NULL,
"tenant_id" TEXT,
CONSTRAINT "mfa_policy_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "mfa_policy_requirement_ck" CHECK ("requirement" IN ('none', 'optional', 'required', 'adaptive'))
);Read and written from TypeScript with the types the model gives: import { mfaPolicy } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { mfaPolicy } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(mfaPolicy).select((s) => ({ mfaPolicyId: s.mfaPolicy.mfaPolicyId, requirement: s.mfaPolicy.requirement })).run(runner);