[PR #396] [CLOSED] [WIP] Simple LDAP sync #3728

Closed
opened 2025-10-09 18:28:56 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/396
Author: @ViViDboarder
Created: 2/15/2019
Status: Closed

Base: masterHead: ldap


📝 Commits (4)

📊 Changes

6 files changed (+435 additions, -0 deletions)

View changed files

📝 Cargo.lock (+258 -0)
📝 Cargo.toml (+6 -0)
📝 src/config.rs (+32 -0)
📝 src/db/mod.rs (+8 -0)
src/ldap.rs (+121 -0)
📝 src/main.rs (+10 -0)

📄 Description

So this is definitely a work in progress as it's quite messy. This is also my first time using Rust, so this is probably not very idiomatic and contains mistakes.

This patch adds several new config values for setting up a connection to an LDAP server, then polling it periodically and generating invites for users that do not yet have accounts. In short, I roughly did what was discussed in #40 and used what @mprasil wrote in #173 to add users.

A couple of notes:

  1. There are still a bunch of print statements that I ought to clean up
  2. I'm not sure if the way that I kicked off the thread is the best way to do so. Tokio only allows one Reactor Core, so if something is added later on, this may cause an issue. It may be possible to initialize a core in the main function and then pass handles down to the other functions.
  3. There are a few error handling items within the Futures that I can't quite figure out. Not sure how best to deal with them.

Please let me know any feedback. I'm happy to iterate on this!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/396 **Author:** [@ViViDboarder](https://github.com/ViViDboarder) **Created:** 2/15/2019 **Status:** ❌ Closed **Base:** `master` ← **Head:** `ldap` --- ### 📝 Commits (4) - [`2de6ba6`](https://github.com/dani-garcia/vaultwarden/commit/2de6ba60010e9aae35d80bb8cc1a356c27e58422) Woo! Got db connections - [`ca7ff10`](https://github.com/dani-garcia/vaultwarden/commit/ca7ff1005725088b578dee8d14aed2e3b9111277) Working LDAP invites! - [`80a2e4b`](https://github.com/dani-garcia/vaultwarden/commit/80a2e4bd13f4755346808ccef1882fa8e9e61d70) Add sync interval - [`94f26c5`](https://github.com/dani-garcia/vaultwarden/commit/94f26c59c6f295a4f9354e9e2b2f39a52af6b247) Added some comments and add a few expects ### 📊 Changes **6 files changed** (+435 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+258 -0) 📝 `Cargo.toml` (+6 -0) 📝 `src/config.rs` (+32 -0) 📝 `src/db/mod.rs` (+8 -0) ➕ `src/ldap.rs` (+121 -0) 📝 `src/main.rs` (+10 -0) </details> ### 📄 Description So this is definitely a work in progress as it's quite messy. This is also my first time using Rust, so this is probably not very idiomatic and contains mistakes. This patch adds several new config values for setting up a connection to an LDAP server, then polling it periodically and generating invites for users that do not yet have accounts. In short, I roughly did what was discussed in #40 and used what @mprasil wrote in #173 to add users. A couple of notes: 1. There are still a bunch of print statements that I ought to clean up 2. I'm not sure if the way that I kicked off the thread is the best way to do so. Tokio only allows one Reactor Core, so if something is added later on, this may cause an issue. It may be possible to initialize a core in the main function and then pass handles down to the other functions. 3. There are a few error handling items within the Futures that I can't quite figure out. Not sure how best to deal with them. Please let me know any feedback. I'm happy to iterate on this! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-09 18:28:57 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#3728