api_key


Description

{“what”:“API keys issued to users for authenticating API requests.”,“why”:“Without it, there is no record of valid credentials or their owners.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:06:20.928468523+00:00”}

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id int4 10 √ null

{“what”:“Unique integer primary key for the API key row.”,“why”:“Without it, rows cannot be uniquely referenced for updates or deletion.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:06:20.949413249+00:00”}

user_id int4 10 √ null
core_user.id fk_api_key_user_id R

{“what”:“ID of the user who owns this API key.”,“why”:“Without it, it is unknown which user the key belongs to, breaking authorization.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:06:20.976787988+00:00”}

key varchar 254 null
setting.key Implied Constraint R

{“what”:“The full secret key string used to authenticate requests.”,“why”:“Without it, there is no credential to compare against incoming requests.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:06:21.032365616+00:00”}

key_prefix varchar 7 null

{“what”:“Short prefix of the key used for fast lookup and identification.”,“why”:“Without it, the full key must be scanned, slowing authentication and preventing partial matches.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:06:21.088850385+00:00”}

creator_id int4 10 null
core_user.id fk_api_key_created_by_user_id R

{“what”:“ID of the user who created this API key.”,“why”:“Without it, it is unknown who issued the key, complicating audit and revocation.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:06:21.112795290+00:00”}

created_at timestamptz 35,6 now()

{“what”:“Timestamp when the key was created, in UTC.”,“why”:“Without it, key age and rotation schedules cannot be determined.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:06:21.149610823+00:00”}

updated_at timestamptz 35,6 now()

{“what”:“Timestamp of the last update to this key record, in UTC.”,“why”:“Without it, it is unknown when key metadata last changed, hindering change tracking.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:06:21.161985381+00:00”}

name varchar 254 null

{“what”:“Human-readable label for the key, e.g., ‘CI pipeline’.”,“why”:“Without it, keys are indistinguishable by purpose, making management confusing.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:06:21.180439770+00:00”}

updated_by_id int4 10 null
core_user.id fk_api_key_updated_by_id_user_id R

{“what”:“ID of the user who last modified this key record.”,“why”:“Without it, it is unknown who made changes, complicating audit trails.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:06:21.193590964+00:00”}

scope varchar 64 √ null

{“what”:“Comma-separated list of permissions or scopes granted to this key.”,“why”:“Without it, all keys have the same access level, preventing least-privilege security.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:06:21.211475212+00:00”}

Indexes

Constraint Name Type Sort Column(s)
api_key_pkey Primary key Asc id
api_key_key_prefix_key Must be unique Asc key_prefix
api_key_name_key Must be unique Asc name
idx_api_key_created_by Performance Asc creator_id
idx_api_key_updated_by_id Performance Asc updated_by_id
idx_api_key_user_id Performance Asc user_id

Relationships