Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(db): add ldap_credential table #3612

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ee/tabby-db/migrations/0041_ldap-credential.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE ldap_credential;
27 changes: 27 additions & 0 deletions ee/tabby-db/migrations/0041_ldap-credential.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
CREATE TABLE ldap_credential(
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name VARCHAR(255) NOT NULL,

host STRING NOT NULL,
port INTEGER NOT NULL DEFAULT 389,

bind_dn STRING NOT NULL,
bind_password STRING NOT NULL,
base_dn STRING NOT NULL,
user_filter STRING NOT NULL,

-- enum of none, starttls, ldaps
encryption STRING NOT NULL DEFAULT 'none',
zwpaper marked this conversation as resolved.
Show resolved Hide resolved
skip_tls_verify BOOLEAN NOT NULL DEFAULT FALSE,

--- the attribute to be used as the Tabby user email address
email_attribute STRING NOT NULL DEFAULT 'email',
--- the attribute to be used as the Tabby user name
name_attribute STRING NOT NULL DEFAULT 'name',

created_at TIMESTAMP NOT NULL DEFAULT(DATETIME('now')),
updated_at TIMESTAMP NOT NULL DEFAULT(DATETIME('now')),

--- name is unique to distinguish different LDAP configurations
CONSTRAINT idx_unique_name UNIQUE(name)
);
Binary file modified ee/tabby-db/schema.sqlite
Binary file not shown.
21 changes: 21 additions & 0 deletions ee/tabby-db/schema/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,24 @@ CREATE TABLE read_notifications(
FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY(notification_id) REFERENCES notifications(id) ON DELETE CASCADE
);
CREATE TABLE ldap_credential(
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name VARCHAR(255) NOT NULL,
host STRING NOT NULL,
port INTEGER NOT NULL DEFAULT 389,
bind_dn STRING NOT NULL,
bind_password STRING NOT NULL,
base_dn STRING NOT NULL,
user_filter STRING NOT NULL,
-- enum of none, starttls, ldaps
encryption STRING NOT NULL DEFAULT 'none',
skip_tls_verify BOOLEAN NOT NULL DEFAULT FALSE,
--- the attribute to be used as the Tabby user email address
email_attribute STRING NOT NULL DEFAULT 'email',
--- the attribute to be used as the Tabby user name
name_attribute STRING NOT NULL DEFAULT 'name',
created_at TIMESTAMP NOT NULL DEFAULT(DATETIME('now')),
updated_at TIMESTAMP NOT NULL DEFAULT(DATETIME('now')),
--- name is unique to distinguish different LDAP configurations
CONSTRAINT idx_unique_name UNIQUE(name)
);
Loading
Loading