Skip to content

Extract test Argon2 parameters into reusable helper function#241

Closed
Copilot wants to merge 2 commits into
faster-password-testsfrom
copilot/sub-pr-239-again
Closed

Extract test Argon2 parameters into reusable helper function#241
Copilot wants to merge 2 commits into
faster-password-testsfrom
copilot/sub-pr-239-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 26, 2025

Addresses review feedback on #239 to reduce duplication of test Argon2 parameters across test files.

Changes

  • Added test_argon2_params() helper in test_utils.rs returning weak params (128 KiB, 1 iteration, 1 parallelism)
  • Replaced 11 inline parameter definitions (9 in auth.rs, 2 in lib.rs) with calls to the helper

Usage

// Before
let password_hash = password::hash_string_with_params(
    "testpassword",
    Some(password::Argon2Params {
        memory_kib: 128,
        iterations: 1,
        parallelism: 1,
    }),
).unwrap();

// After
let password_hash = password::hash_string_with_params(
    "testpassword",
    Some(test_argon2_params()),
).unwrap();

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: fergusfinn <6034059+fergusfinn@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix configurable Argon2 parameters for faster tests Extract test Argon2 parameters into reusable helper function Nov 26, 2025
Copilot AI requested a review from fergusfinn November 26, 2025 10:39
@fergusfinn fergusfinn closed this Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants