Skip to content

Commit

Permalink
20240828 b64 (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
Firstyear authored Aug 28, 2024
1 parent 1e0b605 commit 3e0bd7d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ members = ["proto", "client", "cli"]


[workspace.package]
version = "0.5.1"
version = "0.5.2"
authors = ["William Brown <william@blackhats.net.au>"]
rust-version = "1.74"
edition = "2021"
Expand All @@ -22,7 +22,6 @@ ldap3_client = { path = "./client", version = "0.5.0" }
ldap3_proto = { path = "./proto", version = "0.5.0" }

base64 = "0.21"
base64urlsafedata = "0.5.0"
bytes = "^1.1.0"
clap = "^3.2"
clap_complete = "^3.2.3"
Expand All @@ -38,6 +37,7 @@ rpassword = "7.0.0"
serde = { version = "^1.0.136", features = ["derive"] }
serde_json = "^1.0.79"
serde_test = "^1.0.56"
serde_with = "3.9.0"
thiserror = "1.0"
tokio = "^1.17.0"
tokio-util = "^0.7.1"
Expand Down
6 changes: 3 additions & 3 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ path = "src/lib.rs"

[dependencies]
base64.workspace = true
base64urlsafedata.workspace = true
futures-util = { workspace = true, features = ["sink"] }
ldap3_proto = { workspace = true, features = ["serde"] }
serde= { workspace = true, features = ["derive"] }
serde = { workspace = true, features = ["derive"] }
serde_with = { workspace = true, features = ["base64"] }
openssl.workspace = true
tokio = { workspace = true, features = ["net", "time", "sync", "io-util", "macros"] }
tokio-util = { workspace = true, features = ["codec"] }
tokio-openssl.workspace = true
tracing.workspace = true
url.workspace = true
uuid= {workspace = true, features = ["serde"] }
uuid = {workspace = true, features = ["serde"] }


4 changes: 1 addition & 3 deletions client/src/addirsync.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::LdapClient;
use crate::*;
use base64urlsafedata::Base64UrlSafeData;
use ldap3_proto::control::LdapControl;

#[derive(Debug)]
Expand All @@ -11,7 +10,7 @@ pub struct LdapSyncReplEntry {

#[derive(Debug)]
pub struct LdapSyncRepl {
pub cookie: Option<Base64UrlSafeData>,
pub cookie: Option<Vec<u8>>,
pub entries: Vec<LdapSyncReplEntry>,
pub delete_uuids: Vec<Uuid>,
pub present_uuids: Vec<Uuid>,
Expand Down Expand Up @@ -69,7 +68,6 @@ impl LdapClient {
cookie,
}) = msg.ctrl.pop()
{
let cookie = cookie.map(Base64UrlSafeData::from);
break Ok(LdapSyncRepl {
cookie,
entries,
Expand Down
7 changes: 4 additions & 3 deletions client/src/syncrepl.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::LdapClient;
use crate::*;
use base64urlsafedata::Base64UrlSafeData;
use ldap3_proto::control::LdapControl;
use serde::{Deserialize, Serialize};
use serde_with::{base64, formats, serde_as};

#[derive(Debug, Deserialize, Serialize, PartialEq)]
pub enum LdapSyncStateValue {
Expand Down Expand Up @@ -30,10 +30,12 @@ pub struct LdapSyncReplEntry {
pub entry: LdapEntry,
}

#[serde_as]
#[derive(Debug, Deserialize, Serialize)]
pub enum LdapSyncRepl {
Success {
cookie: Option<Base64UrlSafeData>,
#[serde_as(as = "Option<base64::Base64<base64::UrlSafe, formats::Unpadded>>")]
cookie: Option<Vec<u8>>,
refresh_deletes: bool,
entries: Vec<LdapSyncReplEntry>,
delete_uuids: Option<Vec<Uuid>>,
Expand Down Expand Up @@ -96,7 +98,6 @@ impl LdapClient {
refresh_deletes,
}) = msg.ctrl.pop()
{
let cookie = cookie.map(Base64UrlSafeData::from);
break Ok(LdapSyncRepl::Success {
cookie,
refresh_deletes,
Expand Down

0 comments on commit 3e0bd7d

Please sign in to comment.