Lindenii Project Forge
Login

server

Vireo IdP server

Hi… I am well aware that this diff view is very suboptimal. It will be fixed when the refactored server comes along!

Commit info
ID
619a38a2e72c72ec7c822ae6e11b5fa7e6e6b6c8
Author
Author date
Mon, 26 Feb 2024 13:52:36 +0100
Committer
Committer date
Mon, 26 Feb 2024 13:52:36 +0100
Actions
Inline foreign key definitions in DB schema
CREATE TABLE User (
	id INTEGER PRIMARY KEY,
	username TEXT NOT NULL UNIQUE,
	password_hash TEXT,
	admin INTEGER NOT NULL DEFAULT 0
);

CREATE TABLE Client (
	id INTEGER PRIMARY KEY,
	client_id TEXT NOT NULL UNIQUE,
	client_secret_hash BLOB,
	owner INTEGER,
	owner INTEGER REFERENCES User(id),
	redirect_uris TEXT,
	client_name TEXT,
	client_uri TEXT,
	FOREIGN KEY(owner) REFERENCES User(id)
	client_uri TEXT
);

CREATE TABLE AccessToken (
	id INTEGER PRIMARY KEY,
	hash BLOB NOT NULL UNIQUE,
	user INTEGER NOT NULL,
	client INTEGER,
	user INTEGER NOT NULL REFERENCES User(id),
	client INTEGER REFERENCES Client(id),
	scope TEXT,
	issued_at datetime NOT NULL,
	expires_at datetime NOT NULL,
	refresh_hash BLOB UNIQUE,
	refresh_expires_at datetime,
	FOREIGN KEY(user) REFERENCES User(id),
	FOREIGN KEY(client) REFERENCES Client(id)
	refresh_expires_at datetime
);

CREATE TABLE AuthCode (
	id INTEGER PRIMARY KEY,
	hash BLOB NOT NULL UNIQUE,
	created_at datetime NOT NULL,
	user INTEGER NOT NULL,
	client INTEGER NOT NULL,
	user INTEGER NOT NULL REFERENCES User(id),
	client INTEGER NOT NULL REFERENCES Client(id),
	redirect_uri TEXT,
	scope TEXT,
	FOREIGN KEY(user) REFERENCES User(id),
	FOREIGN KEY(client) REFERENCES Client(id)
	scope TEXT
);