IF Commons GitHub

lockoutPolicy

concept

The rules for locking an account after failed sign-ins

Model identity. Written in commons/data/models/identity/concepts.ts:389. Identified by lockoutPolicyId.

Governance: attributes

failedAttemptsintegerrequired

How many failures lock it

Becomes the column failed_attempts of lockout_policy.

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

lockMinutesintegerrequired

How long it stays locked

Becomes the column lock_minutes of lockout_policy.

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

lockoutPolicyIdidentifierrequired

What identifies the policy, made by the application

Becomes the column lockout_policy_id of lockout_policy.

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

unlockModecode of unlockModerequired

How it is freed

Becomes the column unlock_mode of lockout_policy.

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

windowMinutesintegerrequired

The time they are counted in

Becomes the column window_minutes of lockout_policy.

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

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 lockout_policy with the primary key lockout_policy_id.

ColumnTypeNullRoleFrom
failed_attemptsintegerfalseattributelockoutPolicy.failedAttempts
lock_minutesintegerfalseattributelockoutPolicy.lockMinutes
lockout_policy_idtextfalseattributelockoutPolicy.lockoutPolicyId
tenant_idtexttruereferencelockoutPolicy.tenant
unlock_modetextfalseattributelockoutPolicy.unlockMode
window_minutesintegerfalseattributelockoutPolicy.windowMinutes

Physical: SQL

CREATE TABLE IF NOT EXISTS "lockout_policy" (
    "lockout_policy_id" VARCHAR NOT NULL PRIMARY KEY,
    "failed_attempts" INTEGER NOT NULL,
    "window_minutes" INTEGER NOT NULL,
    "lock_minutes" INTEGER NOT NULL,
    "unlock_mode" VARCHAR NOT NULL,
    "tenant_id" VARCHAR,
    CONSTRAINT "lockout_policy_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
    CONSTRAINT "lockout_policy_unlock_mode_ck" CHECK ("unlock_mode" IN ('timer', 'admin', 'self_service'))
);

Physical: the typed table

Read and written from TypeScript with the types the model gives: import { lockoutPolicy } 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 { lockoutPolicy } from "@intellectual-frontiers/data/sql/typed/models";

const rows = await from(lockoutPolicy).select((s) => ({ lockoutPolicyId: s.lockoutPolicy.lockoutPolicyId, failedAttempts: s.lockoutPolicy.failedAttempts })).run(runner);

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