You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by hg...@apache.org on 2026/07/02 13:53:32 UTC

(iggy) branch master updated: refactor: move password crypto into server_common (#3562)

This is an automated email from the ASF dual-hosted git repository.

hubcio pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git


The following commit(s) were added to refs/heads/master by this push:
     new 60fbb3def refactor: move password crypto into server_common (#3562)
60fbb3def is described below

commit 60fbb3def7f91b152ce9ebee83d748c1f61cc4ae
Author: Jaya Kasa <ka...@gmail.com>
AuthorDate: Thu Jul 2 09:53:20 2026 -0400

    refactor: move password crypto into server_common (#3562)
---
 Cargo.lock                                                       | 4 ++--
 core/server-ng/src/auth.rs                                       | 2 +-
 core/server-ng/src/users.rs                                      | 3 +--
 core/server/Cargo.toml                                           | 2 --
 core/server/src/streaming/utils/mod.rs                           | 2 +-
 core/server_common/Cargo.toml                                    | 2 ++
 core/{server/src/streaming/utils => server_common/src}/crypto.rs | 0
 core/server_common/src/lib.rs                                    | 1 +
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index d53a78bee..cf28d8b36 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -11661,7 +11661,6 @@ version = "0.8.1-edge.1"
 dependencies = [
  "ahash 0.8.12",
  "anyhow",
- "argon2",
  "async-channel",
  "async_zip",
  "axum",
@@ -11699,7 +11698,6 @@ dependencies = [
  "opentelemetry_sdk",
  "papaya",
  "prometheus-client",
- "rand 0.10.1",
  "ringbuffer",
  "rmp-serde",
  "rolling-file",
@@ -11815,6 +11813,7 @@ name = "server_common"
 version = "0.1.0"
 dependencies = [
  "aligned-vec",
+ "argon2",
  "bytemuck",
  "bytes",
  "compio",
@@ -11827,6 +11826,7 @@ dependencies = [
  "lending-iterator",
  "moka",
  "nix",
+ "rand 0.10.1",
  "rcgen",
  "rustls",
  "serial_test",
diff --git a/core/server-ng/src/auth.rs b/core/server-ng/src/auth.rs
index b8aa393f6..c02b2ca23 100644
--- a/core/server-ng/src/auth.rs
+++ b/core/server-ng/src/auth.rs
@@ -34,7 +34,7 @@ use iggy_common::defaults::{
 use iggy_common::{IggyTimestamp, PersonalAccessToken, UserStatus};
 use message_bus::MessageBus;
 use metadata::impls::metadata::StreamsFrontend;
-use server::streaming::utils::crypto;
+use server_common::crypto;
 use std::cell::RefCell;
 use std::rc::Rc;
 use tracing::warn;
diff --git a/core/server-ng/src/users.rs b/core/server-ng/src/users.rs
index 524512cc7..b65ed357a 100644
--- a/core/server-ng/src/users.rs
+++ b/core/server-ng/src/users.rs
@@ -31,8 +31,7 @@ use iggy_binary_protocol::codec::{WireDecode, WireEncode};
 use iggy_binary_protocol::requests::users::{ChangePasswordRequest, CreateUserRequest};
 use iggy_binary_protocol::{Operation, RequestHeader};
 use iggy_common::IggyError;
-use server::streaming::utils::crypto;
-use server_common::Message;
+use server_common::{Message, crypto};
 
 /// Replace a raw wire password with its Argon2 hash before replication.
 ///
diff --git a/core/server/Cargo.toml b/core/server/Cargo.toml
index 647f06375..c48abee12 100644
--- a/core/server/Cargo.toml
+++ b/core/server/Cargo.toml
@@ -42,7 +42,6 @@ systemd = ["dep:sd-notify"]
 [dependencies]
 ahash = { workspace = true }
 anyhow = { workspace = true }
-argon2 = { workspace = true }
 async-channel = { workspace = true }
 async_zip = { workspace = true }
 axum = { workspace = true }
@@ -79,7 +78,6 @@ opentelemetry-semantic-conventions = { workspace = true }
 opentelemetry_sdk = { workspace = true }
 papaya = { workspace = true }
 prometheus-client = { workspace = true }
-rand = { workspace = true }
 ringbuffer = { workspace = true }
 rmp-serde = { workspace = true }
 rolling-file = { workspace = true }
diff --git a/core/server/src/streaming/utils/mod.rs b/core/server/src/streaming/utils/mod.rs
index 8e547aaa6..b03232126 100644
--- a/core/server/src/streaming/utils/mod.rs
+++ b/core/server/src/streaming/utils/mod.rs
@@ -16,7 +16,7 @@
 // under the License.
 
 pub mod address;
-pub mod crypto;
 pub mod file;
 pub mod ptr;
 pub use iggy_common::random_id;
+pub use server_common::crypto;
diff --git a/core/server_common/Cargo.toml b/core/server_common/Cargo.toml
index 9b658b9e0..2960cd11f 100644
--- a/core/server_common/Cargo.toml
+++ b/core/server_common/Cargo.toml
@@ -25,6 +25,7 @@ publish = false
 
 [dependencies]
 aligned-vec = { workspace = true }
+argon2 = { workspace = true }
 bytemuck = { workspace = true }
 bytes = { workspace = true }
 compio = { workspace = true }
@@ -36,6 +37,7 @@ iggy_binary_protocol = { workspace = true }
 iggy_common = { workspace = true }
 lending-iterator = { workspace = true }
 moka = { workspace = true }
+rand = { workspace = true }
 rcgen = { workspace = true }
 rustls = { workspace = true }
 smallvec = { workspace = true }
diff --git a/core/server/src/streaming/utils/crypto.rs b/core/server_common/src/crypto.rs
similarity index 100%
rename from core/server/src/streaming/utils/crypto.rs
rename to core/server_common/src/crypto.rs
diff --git a/core/server_common/src/lib.rs b/core/server_common/src/lib.rs
index fcb955b5e..5420adf15 100644
--- a/core/server_common/src/lib.rs
+++ b/core/server_common/src/lib.rs
@@ -19,6 +19,7 @@ pub mod bootstrap;
 mod buffer;
 mod certificates;
 mod consensus_message;
+pub mod crypto;
 mod deduplication;
 pub mod diagnostics;
 pub mod executor;