Add crate lk-search

- New crate for ldapsearch
- Update config dir path
This commit is contained in:
Candifloss 2026-09-24 10:32:48 +05:30
parent 21f16b7dcc
commit 2e6288e835
6 changed files with 23 additions and 8 deletions

View File

@ -1,9 +1,9 @@
[workspace]
resolver = "3"
members = [
"crates/config","crates/ldap","crates/password",
"tools/lk-pswdreset"
]
"crates/config","crates/ldap","crates/password",
"tools/lk-pswdreset", "tools/lk-search"
]
[workspace.package]
edition = "2024"

View File

@ -1,6 +1,6 @@
//! LDAP connection configuration.
//!
//! Loads `/etc/ldap-kit/connection.toml`, applies default values,
//! Loads `/usr/local/etc/ldap-kit/connection.toml`, applies default values,
//! validates required fields, and applies write credential fallbacks.
use anyhow::{Result, bail};

View File

@ -1,13 +1,13 @@
//! Configuration file locations and default values.
/// Configuration directory.
pub const CONFIG_DIR: &str = "/etc/ldap-kit";
pub const CONFIG_DIR: &str = "/usr/local/etc/ldap-kit";
/// Shared LDAP connection configuration.
pub const CONNECTION_CONFIG: &str = "/etc/ldap-kit/connection.toml";
pub const CONNECTION_CONFIG: &str = "/usr/local/etc/ldap-kit/connection.toml";
/// Password reset configuration.
pub const PSWDRESET_CONFIG: &str = "/etc/ldap-kit/pswdreset.toml";
pub const PSWDRESET_CONFIG: &str = "/usr/local/etc/ldap-kit/pswdreset.toml";
/// Default LDAP server URL.
pub const DEFAULT_LDAP_URL: &str = "ldap://localhost:389";

View File

@ -1,6 +1,6 @@
//! Password reset configuration.
//!
//! Loads `/etc/ldap-kit/pswdreset.toml` and applies default values.
//! Loads `/usr/local/etc/ldap-kit/pswdreset.toml` and applies default values.
use anyhow::Result;
use serde::Deserialize;

View File

@ -0,0 +1,12 @@
[package]
name = "lk-search"
version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
[dependencies]
anyhow.workspace = true
clap.workspace = true
ldap3.workspace = true
config = { path = "../../crates/config" }

View File

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}