Added user apps and token resources.

This commit is contained in:
2026-10-07 22:37:59 +02:00
parent 1f1f027368
commit ca4b6542ea
47 changed files with 1923 additions and 8 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);