CJVT updates August and September 2026

This commit is contained in:
Luka Romih
2026-10-01 00:49:26 +02:00
parent fd02e25719
commit 83f73aeb58
135 changed files with 6146 additions and 1970 deletions
+18
View File
@@ -0,0 +1,18 @@
-- Adds support for federated/SSO login (OIDC) alongside local username+password accounts. Only
-- one external identity provider is modeled today: the University of Ljubljana (backed by
-- Microsoft Entra ID in production; a throwaway local Authentik instance stands in for it in dev
-- - see dev/authentik/). The auth_provider enum intentionally has just these two values.
CREATE TYPE auth_provider AS ENUM ('local', 'uni_lj');
-- SSO-only users are authenticated entirely by the external IdP and never set a local password.
ALTER TABLE "user" ALTER COLUMN bcrypt_hash DROP NOT NULL;
CREATE TABLE user_external_identity (
auth_provider auth_provider NOT NULL,
subject VARCHAR NOT NULL,
user_id INT NOT NULL REFERENCES "user",
time_linked TIMESTAMPTZ NOT NULL DEFAULT NOW(),
PRIMARY KEY (auth_provider, subject),
UNIQUE (user_id, auth_provider)
);