IF Commons GitHub

loginAttempt

conceptpersonal data

A sign-in attempt, kept for lockout and for risk, with the identifier hashed so that an unknown user leaves nothing personal

Model identity. Written in commons/data/models/identity/concepts.ts:232. Identified by loginAttemptId.

Governance: attributes

atinstantrequired

When it was

Becomes the column at of login_attempt.

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

iptextrequiredpersonal data

Where it came from

Becomes the column ip of login_attempt.

Annotations: privacy.personal={"category":"IPAddress","purposes":["limit guessing and spot abuse"]}

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

loginAttemptIdidentifierrequired

What identifies the attempt, made by the application

Becomes the column login_attempt_id of login_attempt.

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

loginIdentifierHashtextrequired

The identifier, hashed with a pepper

Becomes the column login_identifier_hash of login_attempt.

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

outcomecode of loginOutcomerequired

How it ended

Becomes the column outcome of login_attempt.

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

Governance: relationships

principaloptional

Who it was for, where that is known To principal. Written at commons/data/models/identity/concepts.ts:285

Logical: the table

Projects to the table login_attempt with the primary key login_attempt_id.

ColumnTypeNullRoleFrom
attimestampfalseattributeloginAttempt.at
iptextfalseattributeloginAttempt.ip
login_attempt_idtextfalseattributeloginAttempt.loginAttemptId
login_identifier_hashtextfalseattributeloginAttempt.loginIdentifierHash
outcometextfalseattributeloginAttempt.outcome
principal_idtexttruereferenceloginAttempt.principal

Physical: SQL

CREATE TABLE IF NOT EXISTS "login_attempt" (
    "login_attempt_id" VARCHAR NOT NULL PRIMARY KEY,
    "login_identifier_hash" VARCHAR NOT NULL,
    "ip" VARCHAR NOT NULL,
    "outcome" VARCHAR NOT NULL,
    "at" TIMESTAMPTZ NOT NULL,
    "principal_id" VARCHAR,
    CONSTRAINT "login_attempt_principal_id_fk" FOREIGN KEY ("principal_id") REFERENCES "principal" ("principal_id"),
    CONSTRAINT "login_attempt_outcome_ck" CHECK ("outcome" IN ('success', 'wrong_secret', 'unknown_user', 'locked', 'mfa_failed', 'blocked'))
);

Physical: the typed table

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

const rows = await from(loginAttempt).select((s) => ({ loginAttemptId: s.loginAttempt.loginAttemptId, loginIdentifierHash: s.loginAttempt.loginIdentifierHash })).run(runner);

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