IF Commons GitHub

loginSession

conceptpersonal data

A principal's being signed in, from a device, for a time

Model identity. Written in commons/data/models/identity/concepts.ts:265. Identified by sessionId.

Governance: attributes

absoluteExpiresAtinstantrequired

When it ends whatever

Becomes the column absolute_expires_at of login_session.

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

assuranceLevelcode of assuranceLevelrequired

How sure it is of who it is for

Becomes the column assurance_level of login_session.

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

authMethodscode of authMethodmany

How it was authenticated

Becomes the column auth_methods of login_session.

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

authenticatedAtinstantrequired

When the principal proved who they are

Becomes the column authenticated_at of login_session.

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

federatedProvidertextoptional

The identity provider it was signed in through, where it was

Becomes the column federated_provider of login_session.

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

idleExpiresAtinstantrequired

When it ends if it is not used

Becomes the column idle_expires_at of login_session.

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

iptextrequiredpersonal data

Where it came from

Becomes the column ip of login_session.

Annotations: privacy.personal={"category":"IPAddress","purposes":["spot a session used from somewhere new"]}

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

lastSeenAtinstantrequired

When the session was last used

Becomes the column last_seen_at of login_session.

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

revokedAtinstantoptional

When it was ended early

Becomes the column revoked_at of login_session.

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

revokedReasoncode of revokedReasonoptional

Why it was ended early

Becomes the column revoked_reason of login_session.

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

sessionIdidentifierrequired

What identifies the session, made by the application

Becomes the column session_id of login_session.

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

statuscode of sessionStatusrequired

Where the session is

Becomes the column status of login_session.

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

stepUpAtinstantoptional

When the principal last proved who they are again

Becomes the column step_up_at of login_session.

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

userAgenttextrequiredpersonal data

What the browser says it is

Becomes the column user_agent of login_session.

Annotations: privacy.personal={"category":"UserAgent","purposes":["show the user where they are signed in"]}

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

Governance: relationships

knownBrowseroptional

The browser or app it is on To knownBrowser. Written at commons/data/models/identity/concepts.ts:287

principalone

Who is signed in To principal. Written at commons/data/models/identity/concepts.ts:285

tenantoptional

The tenant the session is working in To tenant. Written at commons/data/models/identity/concepts.ts:286

Logical: the table

Projects to the table login_session with the primary key session_id.

ColumnTypeNullRoleFrom
absolute_expires_attimestampfalseattributeloginSession.absoluteExpiresAt
assurance_leveltextfalseattributeloginSession.assuranceLevel
authenticated_attimestampfalseattributeloginSession.authenticatedAt
federated_providertexttrueattributeloginSession.federatedProvider
idle_expires_attimestampfalseattributeloginSession.idleExpiresAt
iptextfalseattributeloginSession.ip
known_browser_idtexttruereferenceloginSession.knownBrowser
last_seen_attimestampfalseattributeloginSession.lastSeenAt
principal_idtextfalsereferenceloginSession.principal
revoked_attimestamptrueattributeloginSession.revokedAt
revoked_reasontexttrueattributeloginSession.revokedReason
session_idtextfalseattributeloginSession.sessionId
statustextfalseattributeloginSession.status
step_up_attimestamptrueattributeloginSession.stepUpAt
tenant_idtexttruereferenceloginSession.tenant
user_agenttextfalseattributeloginSession.userAgent

Physical: SQL

CREATE TABLE IF NOT EXISTS "login_session" (
    "session_id" VARCHAR NOT NULL PRIMARY KEY,
    "authenticated_at" TIMESTAMPTZ NOT NULL,
    "last_seen_at" TIMESTAMPTZ NOT NULL,
    "idle_expires_at" TIMESTAMPTZ NOT NULL,
    "absolute_expires_at" TIMESTAMPTZ NOT NULL,
    "assurance_level" VARCHAR NOT NULL,
    "federated_provider" VARCHAR,
    "ip" VARCHAR NOT NULL,
    "user_agent" VARCHAR NOT NULL,
    "status" VARCHAR NOT NULL,
    "revoked_at" TIMESTAMPTZ,
    "revoked_reason" VARCHAR,
    "step_up_at" TIMESTAMPTZ,
    "principal_id" VARCHAR NOT NULL,
    "tenant_id" VARCHAR,
    "known_browser_id" VARCHAR,
    CONSTRAINT "login_session_principal_id_fk" FOREIGN KEY ("principal_id") REFERENCES "principal" ("principal_id"),
    CONSTRAINT "login_session_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
    CONSTRAINT "login_session_known_browser_id_fk" FOREIGN KEY ("known_browser_id") REFERENCES "known_browser" ("known_browser_id"),
    CONSTRAINT "login_session_assurance_level_ck" CHECK ("assurance_level" IN ('aal_1', 'aal_2', 'aal_3')),
    CONSTRAINT "login_session_status_ck" CHECK ("status" IN ('active', 'expired', 'revoked', 'signed_out')),
    CONSTRAINT "login_session_revoked_reason_ck" CHECK ("revoked_reason" IN ('user', 'admin', 'reuse_detected', 'policy', 'password_change', 'risk'))
);

Physical: the typed table

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

const rows = await from(loginSession).select((s) => ({ sessionId: s.loginSession.sessionId, authenticatedAt: s.loginSession.authenticatedAt })).run(runner);

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