failedAttemptsintegerrequiredHow many failures lock it
Becomes the column failed_attempts of lockout_policy.
Written at commons/data/models/identity/concepts.ts:393
The rules for locking an account after failed sign-ins
Model identity. Written in commons/data/models/identity/concepts.ts:389. Identified by lockoutPolicyId.
failedAttemptsintegerrequiredHow many failures lock it
Becomes the column failed_attempts of lockout_policy.
Written at commons/data/models/identity/concepts.ts:393
lockMinutesintegerrequiredHow long it stays locked
Becomes the column lock_minutes of lockout_policy.
Written at commons/data/models/identity/concepts.ts:395
lockoutPolicyIdidentifierrequiredWhat 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 unlockModerequiredHow it is freed
Becomes the column unlock_mode of lockout_policy.
Written at commons/data/models/identity/concepts.ts:396
windowMinutesintegerrequiredThe time they are counted in
Becomes the column window_minutes of lockout_policy.
Written at commons/data/models/identity/concepts.ts:394
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 lockout_policy with the primary key lockout_policy_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
failed_attempts | integer | false | attribute | lockoutPolicy.failedAttempts |
lock_minutes | integer | false | attribute | lockoutPolicy.lockMinutes |
lockout_policy_id | text | false | attribute | lockoutPolicy.lockoutPolicyId |
tenant_id | text | true | reference | lockoutPolicy.tenant |
unlock_mode | text | false | attribute | lockoutPolicy.unlockMode |
window_minutes | integer | false | attribute | lockoutPolicy.windowMinutes |
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'))
);CREATE TABLE IF NOT EXISTS "lockout_policy" (
"lockout_policy_id" TEXT NOT NULL PRIMARY KEY,
"failed_attempts" INTEGER NOT NULL,
"window_minutes" INTEGER NOT NULL,
"lock_minutes" INTEGER NOT NULL,
"unlock_mode" TEXT NOT NULL,
"tenant_id" TEXT,
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'))
);CREATE TABLE IF NOT EXISTS "lockout_policy" (
"lockout_policy_id" TEXT NOT NULL PRIMARY KEY,
"failed_attempts" INTEGER NOT NULL,
"window_minutes" INTEGER NOT NULL,
"lock_minutes" INTEGER NOT NULL,
"unlock_mode" TEXT NOT NULL,
"tenant_id" TEXT,
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'))
);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);