Files
inventory-plus-plus/database_migrations/000010_oauth_login_states.up.sql
T
angel ccc00d5c89 Claude-assisted improvements (untested)
- dev auth flow (side-step OAuth)
- db event processing integration tests
- dev scripts (eg Makefile)
- db / test db migration setup scripts.
2026-08-05 17:56:21 -06:00

26 lines
695 B
SQL

CREATE TABLE oauth_login_states (
state BYTEA NOT NULL,
expiration TIMESTAMPTZ NOT NULL DEFAULT (NOW() + '10 minutes'::interval),
PRIMARY KEY (state)
);
CREATE TABLE oauth_tokens (
access_token TEXT NOT NULL,
token_type TEXT NOT NULL,
refresh_token TEXT NOT NULL,
expiry TIMESTAMPTZ NOT NULL,
id_token_issuer TEXT NOT NULL,
id_token_audience TEXT[] NOT NULL,
id_token_subject TEXT NOT NULL,
id_token_expiry TIMESTAMPTZ NOT NULL,
id_token_issued_at TIMESTAMPTZ NOT NULL,
id_token_nonce TEXT NOT NULL,
id_token_access_token_hash TEXT NOT NULL,
claims JSONB NOT NULL,
PRIMARY KEY (access_token)
);