core_session


Description

{“what”:“A session record for an authenticated user, with a unique ID and hashed key.”,“why”:“Without it, authenticated requests cannot be tied to a user, so every request would require re-authentication.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:15.248459939+00:00”}

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id varchar 254 null
login_history.session_id fk_login_history_session_id N
notification.internal_id Implied Constraint R

{“what”:“Unique session token string, the primary key.”,“why”:“Without it, a session cannot be referenced by its token, breaking session lookup.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:15.292846659+00:00”}

user_id int4 10 null
core_user.id fk_session_ref_user_id C

{“what”:“Integer ID of the authenticated user.”,“why”:“Without it, the session cannot be associated with a user, so authorization fails.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:15.322609527+00:00”}

created_at timestamptz 35,6 null

{“what”:“Creation time of the session, with time zone.”,“why”:“Without it, session age cannot be computed, so expiry policies based on creation time are impossible.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:15.345429536+00:00”}

anti_csrf_token text 2147483647 √ null

{“what”:“Optional opaque token for CSRF protection.”,“why”:“Without it, requests cannot be validated against CSRF, leaving the session vulnerable to forged actions.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:15.362211490+00:00”}

key_hashed varchar 254 null

{“what”:“Hashed session key, used to verify the session token.”,“why”:“Without it, the session token cannot be verified securely, so a stolen token would be usable directly.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:15.373854401+00:00”}

auth_identity_id int4 10 √ null
auth_identity.id fk_session_auth_identity C

{“what”:“ID of the authentication identity used to log in, if any.”,“why”:“Without it, the authentication provider for the session is unknown, so multi-provider login cannot be distinguished.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:15.386794311+00:00”}

expires_at timestamptz 35,6 √ null

{“what”:“Optional timestamp when the session expires.”,“why”:“Without it, sessions do not expire, so stolen tokens remain valid forever.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:15.400860360+00:00”}

Indexes

Constraint Name Type Sort Column(s)
core_session_pkey Primary key Asc id
idx_core_session_auth_identity_id Performance Asc auth_identity_id
idx_core_session_key_hashed Performance Asc key_hashed
idx_core_session_user_id Performance Asc user_id

Relationships