You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by "jayakasadev (via GitHub)" <gi...@apache.org> on 2026/06/24 21:30:18 UTC

[PR] refactor(server-ng): move password crypto into server_common [iggy]

jayakasadev opened a new pull request, #3562:
URL: https://github.com/apache/iggy/pull/3562

   ### What
   Moves the password crypto helpers (`hash_password`, `verify_password`, `generate_secret`) out of `core/server` into the shared `server_common` crate, and repoints `server-ng` at the new home.
   
   ### Why
   `core/server-ng` imported `server::streaming::utils::crypto`, a compile-time dependency on the legacy binary it is meant to replace. The module is three free functions over `argon2` + `rand` with no `server`-internal state, so it relocates cleanly. One of the remaining `use server::*` clusters tracked in #3315.
   
   ### Changes
   - `crypto.rs` moved verbatim to `server_common` (rename, zero body changes — argon2 cost params and secret charset unchanged).
   - `server_common`: `pub mod crypto;`; `argon2` + `rand` added (they were `crypto`'s only consumer in `server`, so they move with it — `cargo machete` confirms `server` no longer needs them).
   - `server`: keeps a back-compat re-export at `streaming::utils::crypto`, so its in-crate call sites (`http_server`, `shard/execution`, `shard/system/users`, `user.rs`) are untouched.
   - `server-ng`: `auth.rs` and `users.rs` now `use server_common::crypto`.
   
   ### Verification
   - `cargo fmt --all`, `cargo sort --no-format --workspace` — clean
   - `cargo clippy --all-features --all-targets -- -D warnings` on `server`, `server_common`, `server-ng` — clean
   - `cargo machete` — no unused deps
   - `cargo check` — `server`, `server_common`, `server-ng` build
   - `cargo test -p server_common` — 62 passed
   - `rg '^use server::streaming::utils::crypto' core/server-ng/` — no matches
   
   No behavior change: existing password hashes still verify; legacy `server` builds via the re-export.
   
   Refs #3315.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor(server-ng): move password crypto into server_common [iggy]

Posted by "jayakasadev (via GitHub)" <gi...@apache.org>.
jayakasadev closed pull request #3562: refactor(server-ng): move password crypto into server_common
URL: https://github.com/apache/iggy/pull/3562


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: move password crypto into server_common [iggy]

Posted by "jayakasadev (via GitHub)" <gi...@apache.org>.
jayakasadev commented on PR #3562:
URL: https://github.com/apache/iggy/pull/3562#issuecomment-4836620238

   /ready


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor(server-ng): move password crypto into server_common [iggy]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #3562:
URL: https://github.com/apache/iggy/pull/3562#issuecomment-4793849986

   ## [Codecov](https://app.codecov.io/gh/apache/iggy/pull/3562?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 73.66%. Comparing base ([`9ba4dbf`](https://app.codecov.io/gh/apache/iggy/commit/9ba4dbf1208ad0819473ab1f925f259cf5f9b2f3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`eb32f00`](https://app.codecov.io/gh/apache/iggy/commit/eb32f0081d76259ce338679313e8d928910db7ac?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3562      +/-   ##
   ============================================
   - Coverage     74.43%   73.66%   -0.78%     
     Complexity      937      937              
   ============================================
     Files          1243     1180      -63     
     Lines        125987   121300    -4687     
     Branches     101854   101768      -86     
   ============================================
   - Hits          93782    89352    -4430     
   + Misses        29195    28936     -259     
   - Partials       3010     3012       +2     
   ```
   
   | [Components](https://app.codecov.io/gh/apache/iggy/pull/3562/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [Rust Core](https://app.codecov.io/gh/apache/iggy/pull/3562/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `75.19% <ø> (ø)` | |
   | [Java SDK](https://app.codecov.io/gh/apache/iggy/pull/3562/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `62.44% <ø> (ø)` | |
   | [C# SDK](https://app.codecov.io/gh/apache/iggy/pull/3562/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `72.12% <ø> (ø)` | |
   | [Python SDK](https://app.codecov.io/gh/apache/iggy/pull/3562/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `88.88% <ø> (ø)` | |
   | [PHP SDK](https://app.codecov.io/gh/apache/iggy/pull/3562/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `84.29% <ø> (ø)` | |
   | [Node SDK](https://app.codecov.io/gh/apache/iggy/pull/3562/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `87.27% <ø> (-3.99%)` | :arrow_down: |
   | [Go SDK](https://app.codecov.io/gh/apache/iggy/pull/3562/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.14% <ø> (ø)` | |
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/iggy/pull/3562?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [core/server-ng/src/auth.rs](https://app.codecov.io/gh/apache/iggy/pull/3562?src=pr&el=tree&filepath=core%2Fserver-ng%2Fsrc%2Fauth.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zZXJ2ZXItbmcvc3JjL2F1dGgucnM=) | `0.00% <ø> (ø)` | |
   | [core/server-ng/src/users.rs](https://app.codecov.io/gh/apache/iggy/pull/3562?src=pr&el=tree&filepath=core%2Fserver-ng%2Fsrc%2Fusers.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zZXJ2ZXItbmcvc3JjL3VzZXJzLnJz) | `0.00% <ø> (ø)` | |
   
   ... and [82 files with indirect coverage changes](https://app.codecov.io/gh/apache/iggy/pull/3562/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor(server-ng): move password crypto into server_common [iggy]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #3562:
URL: https://github.com/apache/iggy/pull/3562#issuecomment-4793839691

   <!-- iggy-pr-triage-welcome -->
   Thanks for the PR. It is labeled `S-waiting-on-review` and queued for review.
   
   Slash commands (own line, regular comment) move it around the queue:
   
   - `/ready` - back to `S-waiting-on-review` after addressing feedback
   - `/author` - flip to `S-waiting-on-author` while you finish changes
   - `/request-review @user-or-team` - request a reviewer
   
   See [CONTRIBUTING.md](https://github.com/apache/iggy/blob/master/CONTRIBUTING.md#pr-triage-commands) for details.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: move password crypto into server_common [iggy]

Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio commented on code in PR #3562:
URL: https://github.com/apache/iggy/pull/3562#discussion_r3509429297


##########
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};

Review Comment:
   since crypto now comes from `server_common`, the `argon2` and `rand` dependencies declared in `core/server-ng/Cargo.toml` are fully dead - nothing in `core/server-ng/src` uses either crate directly (crypto was always consumed via this import, previously through the legacy `server` path). both also sit in the `cargo-machete` ignored list in that manifest, so machete will never flag them. worth dropping the two deps plus their two machete-ignore entries to finish the cleanup this PR starts.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: move password crypto into server_common [iggy]

Posted by "jayakasadev (via GitHub)" <gi...@apache.org>.
jayakasadev commented on PR #3562:
URL: https://github.com/apache/iggy/pull/3562#issuecomment-4836623874

   /request-review @hubcio 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org