[PR #1701] [MERGED] Make dependency on argon2 optional #2284

Closed
opened 2026-02-27 12:10:17 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/modoboa/modoboa/pull/1701
Author: @jeromelebleu
Created: 3/19/2019
Status: Merged
Merged: 5/17/2019
Merged by: @tonioo

Base: masterHead: argon2-optional


📝 Commits (1)

  • aa5d45d Make dependency to argon2 optional

📊 Changes

5 files changed (+68 additions, -46 deletions)

View changed files

📝 modoboa/core/password_hashers/advanced.py (+42 -32)
📝 modoboa/core/tests/test_authentication.py (+24 -13)
📝 requirements.txt (+0 -1)
📝 setup.py (+1 -0)
📝 test-requirements.txt (+1 -0)

📄 Description

Description of the issue this PR addresses

Thanks to #1690, Argon2 is now supported as password hasher. However, it is not optional and Argon2 requires a third-party library - that's why Django do not use it as default (see the related documentation). This PR try to make this password hasher optional.

Current behavior before PR

  • argon2 is in the requirements
  • argon2 is imported in modoboa/core/password_hashers/advanced.py
  • ARGON2IDHasher is defined and inherits from PasswordHasher
  • tests depend on argon2

Desired behavior after PR is merged

  • argon2 is not in requirements but in extras
  • argon2 is imported in modoboa/core/password_hashers/advanced.py with a try...except catch
  • ARGON2IDHasher is defined but only inherits from PasswordHasher if argon2 is installed
  • tests related to argon2 are skipped if it is not installed

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/modoboa/modoboa/pull/1701 **Author:** [@jeromelebleu](https://github.com/jeromelebleu) **Created:** 3/19/2019 **Status:** ✅ Merged **Merged:** 5/17/2019 **Merged by:** [@tonioo](https://github.com/tonioo) **Base:** `master` ← **Head:** `argon2-optional` --- ### 📝 Commits (1) - [`aa5d45d`](https://github.com/modoboa/modoboa/commit/aa5d45d64d10c2743912f505e15382b9f858ceb8) Make dependency to argon2 optional ### 📊 Changes **5 files changed** (+68 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `modoboa/core/password_hashers/advanced.py` (+42 -32) 📝 `modoboa/core/tests/test_authentication.py` (+24 -13) 📝 `requirements.txt` (+0 -1) 📝 `setup.py` (+1 -0) 📝 `test-requirements.txt` (+1 -0) </details> ### 📄 Description ## Description of the issue this PR addresses Thanks to #1690, Argon2 is now supported as password hasher. However, it is not optional and Argon2 requires a third-party library - that's why Django do not use it as default (see the [related documentation](https://docs.djangoproject.com/en/2.1/topics/auth/passwords/#using-argon2-with-django)). This PR try to make this password hasher optional. ## Current behavior before PR * argon2 is in the requirements * argon2 is imported in modoboa/core/password_hashers/advanced.py * ARGON2IDHasher is defined and inherits from PasswordHasher * tests depend on argon2 ## Desired behavior after PR is merged * argon2 is not in requirements but in extras * argon2 is imported in modoboa/core/password_hashers/advanced.py with a `try...except` catch * ARGON2IDHasher is defined but only inherits from PasswordHasher if argon2 is installed * tests related to argon2 are skipped if it is not installed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 12:10:17 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#2284
No description provided.