2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
argon2-cffi,
|
|
|
|
bcrypt,
|
|
|
|
cryptography,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pytest-xdist,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "passlib";
|
2020-11-19 00:13:47 +00:00
|
|
|
version = "1.7.4";
|
2023-03-27 19:17:25 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-27 19:17:25 +00:00
|
|
|
hash = "sha256-3v1Q9ytlxUAqssVzgwppeOXyAq0NmEeTyN3ixBUuvgQ";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
passthru.optional-dependencies = {
|
2022-05-18 14:49:53 +00:00
|
|
|
argon2 = [ argon2-cffi ];
|
|
|
|
bcrypt = [ bcrypt ];
|
|
|
|
totp = [ cryptography ];
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs =
|
|
|
|
[
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-xdist
|
|
|
|
]
|
|
|
|
++ passthru.optional-dependencies.argon2
|
|
|
|
++ passthru.optional-dependencies.bcrypt
|
|
|
|
++ passthru.optional-dependencies.totp;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "passlib" ];
|
2023-03-27 19:17:25 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
disabledTests = [
|
|
|
|
# timming sensitive
|
|
|
|
"test_dummy_verify"
|
2022-12-17 10:02:37 +00:00
|
|
|
"test_encrypt_cost_timing"
|
|
|
|
# These tests fail because they don't expect support for algorithms provided through libxcrypt
|
2022-10-30 15:09:59 +00:00
|
|
|
"test_82_crypt_support"
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
# hashing algorithms we don't support anymore
|
|
|
|
"--deselect=passlib/tests/test_handlers.py::des_crypt_os_crypt_test::test_82_crypt_support"
|
|
|
|
"--deselect=passlib/tests/test_handlers.py::md5_crypt_os_crypt_test::test_82_crypt_support"
|
|
|
|
"--deselect=passlib/tests/test_handlers.py::sha256_crypt_os_crypt_test::test_82_crypt_support"
|
|
|
|
];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Password hashing library for Python";
|
2022-03-30 09:31:56 +00:00
|
|
|
homepage = "https://foss.heptapod.net/python-libs/passlib";
|
|
|
|
license = licenses.bsdOriginal;
|
2022-09-30 11:47:45 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|