IF Commons GitHub

mfaPolicy

concept

The rules for second factors

Model identity. Written in commons/data/models/identity/concepts.ts:420. Identified by mfaPolicyId.

Governance: attributes

allowedKindscode of credentialKindmany

The factors that may be used

Becomes the column allowed_kinds of mfa_policy.

Written at commons/data/models/identity/concepts.ts:425

graceDaysintegerrequired

How 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

mfaPolicyIdidentifierrequired

What 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

rememberDeviceDaysintegerrequired

How 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

requiredForRolestextmany

The 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 mfaRequirementrequired

Whether a second factor is needed

Becomes the column requirement of mfa_policy.

Written at commons/data/models/identity/concepts.ts:424

Governance: relationships

tenantoptional

The 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

Logical: the table

Projects to the table mfa_policy with the primary key mfa_policy_id.

ColumnTypeNullRoleFrom
grace_daysintegerfalseattributemfaPolicy.graceDays
mfa_policy_idtextfalseattributemfaPolicy.mfaPolicyId
remember_device_daysintegerfalseattributemfaPolicy.rememberDeviceDays
requirementtextfalseattributemfaPolicy.requirement
tenant_idtexttruereferencemfaPolicy.tenant

Physical: SQL

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'))
);

Physical: the typed table

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);

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