From cc36754ba8c7cc1eecddce289696bf5c440f1922 Mon Sep 17 00:00:00 2001 From: Luca Date: Sat, 14 Jan 2023 15:22:05 +0100 Subject: [PATCH] address some PR comments --- Cargo.lock | 7 +------ Cargo.toml | 4 ++-- server/Cargo.toml | 2 +- server/src/infra/ldap_handler.rs | 11 +++++++---- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ec18b7d..7163e12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2201,7 +2201,7 @@ dependencies = [ [[package]] name = "ldap3_proto" version = "0.3.0" -source = "git+https://github.com/kanidm/ldap3#b3c7653471916e803dc8f24d2163fd2710dfb161" +source = "git+https://github.com/kanidm/ldap3/?rev=b3c7653471916e803dc8f24d2163fd2710dfb161#b3c7653471916e803dc8f24d2163fd2710dfb161" dependencies = [ "bytes", "lber", @@ -5035,8 +5035,3 @@ dependencies = [ "cc", "libc", ] - -[[patch.unused]] -name = "ldap3_proto" -version = "0.2.3" -source = "git+https://github.com/nitnelave/ldap3_server/?rev=7b50b2b82c383f5f70e02e11072bb916629ed2bc#7b50b2b82c383f5f70e02e11072bb916629ed2bc" diff --git a/Cargo.toml b/Cargo.toml index f2283cd..53ed9b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,8 @@ default-members = ["server"] # Remove once https://github.com/kanidm/ldap3_proto/pull/8 is merged. [patch.crates-io.ldap3_proto] -git = 'https://github.com/nitnelave/ldap3_server/' -rev = '7b50b2b82c383f5f70e02e11072bb916629ed2bc' +git = 'https://github.com/kanidm/ldap3/' +rev = 'b3c7653471916e803dc8f24d2163fd2710dfb161' [patch.crates-io.opaque-ke] git = 'https://github.com/nitnelave/opaque-ke/' diff --git a/server/Cargo.toml b/server/Cargo.toml index 05d9f68..9c38656 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -28,7 +28,7 @@ itertools = "0.10.1" juniper = "0.15.10" juniper_actix = "0.4.0" jwt = "0.13" -ldap3_proto = { git = "https://github.com/kanidm/ldap3", package = "ldap3_proto" } +ldap3_proto = "*" log = "*" orion = "0.16" rustls = "0.20" diff --git a/server/src/infra/ldap_handler.rs b/server/src/infra/ldap_handler.rs index 6389521..5f85e8a 100644 --- a/server/src/infra/ldap_handler.rs +++ b/server/src/infra/ldap_handler.rs @@ -558,6 +558,13 @@ impl LdapHandler 1 { + return Err(LdapError { + code: LdapResultCode::OperationsError, + message: "Search request returned nothing".to_string(), + }); + } + match entry { LdapOp::SearchResultEntry(entry) => { let mut available = false; @@ -2212,10 +2219,6 @@ mod tests { user: User { user_id: UserId::new("bob"), email: "bob@bobmail.bob".to_string(), - display_name: Some("bôb böbberson".to_string()), - first_name: Some("bôb".to_string()), - last_name: Some("böbberson".to_string()), - uuid: uuid!("698e1d5f-7a40-3151-8745-b9b8a37839da"), ..Default::default() }, groups: None,