db: add API-key owner and pre-auth-key description for v2

Give API keys an optional owning user and pre-auth keys a free-text
description, plus the state accessors the v2 API needs to act as a
key's owner and to persist descriptions.
This commit is contained in:
Kristoffer Dalby
2026-06-20 20:16:51 +00:00
parent 4fa6af0102
commit 3d811f29a6
9 changed files with 180 additions and 35 deletions
+2
View File
@@ -44,6 +44,7 @@ CREATE TABLE pre_auth_keys(
prefix text,
hash blob,
user_id integer,
description text,
reusable numeric,
ephemeral numeric DEFAULT false,
used numeric DEFAULT false,
@@ -60,6 +61,7 @@ CREATE TABLE api_keys(
id integer PRIMARY KEY AUTOINCREMENT,
prefix text,
hash blob,
user_id integer,
expiration datetime,
last_seen datetime,