Adds LDAP auth support

This commit is contained in:
Jamie Curnow
2024-11-02 21:36:07 +10:00
parent 8434a2d1fa
commit a277a5d167
54 changed files with 765 additions and 306 deletions

View File

@ -17,7 +17,6 @@ CREATE TABLE IF NOT EXISTS `user`
`updated_at` BIGINT NOT NULL DEFAULT 0,
`is_deleted` INT NOT NULL DEFAULT 0, -- int on purpose, gormism
`name` VARCHAR(50) NOT NULL,
`nickname` VARCHAR(50) NOT NULL,
`email` VARCHAR(255) NOT NULL,
`is_system` BOOLEAN NOT NULL DEFAULT FALSE,
`is_disabled` BOOLEAN NOT NULL DEFAULT FALSE
@ -45,6 +44,7 @@ CREATE TABLE IF NOT EXISTS `auth`
`is_deleted` INT NOT NULL DEFAULT 0, -- int on purpose, gormism
`user_id` INT NOT NULL,
`type` VARCHAR(50) NOT NULL,
`identity` VARCHAR(255) NOT NULL,
`secret` VARCHAR(255) NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE,
UNIQUE (`user_id`, `type`)

View File

@ -37,6 +37,27 @@ INSERT INTO `setting` (
"default-site",
"What to show users who hit your Nginx server by default",
'"welcome"' -- remember this is json
),
(
ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000),
ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000),
"auth-methods",
"Which methods are enabled for authentication",
'["local"]' -- remember this is json
),
(
ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000),
ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000),
"oidc-auth",
"Configuration for OIDC authentication",
'{}' -- remember this is json
),
(
ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000),
ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000),
"ldap-auth",
"Configuration for LDAP authentication",
'{"host": "", "dn": "", "sync_by": "uid"}' -- remember this is json
);
-- Default Certificate Authorities