Added user apps and token resources.

This commit is contained in:
2026-10-07 22:50:18 +02:00
parent 1f1f027368
commit 9038120734
47 changed files with 1940 additions and 29 deletions
@@ -0,0 +1,11 @@
CREATE TABLE user_app_secrets (
id UUID PRIMARY KEY DEFAULT gen_random_uuid (),
app_id UUID NOT NULL CONSTRAINT fk_user_app_secrets_app REFERENCES user_apps (id) ON DELETE CASCADE,
secret_hash BYTEA NOT NULL CHECK (
octet_length(secret_hash) = 32
),
expires_at TIMESTAMPTZ NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX ix_user_app_secrets_app_id ON user_app_secrets (app_id);