2022-03-30 09:31:56 +00:00
|
|
|
{ lib
|
2022-10-30 15:09:59 +00:00
|
|
|
, stdenv
|
2022-03-30 09:31:56 +00:00
|
|
|
, buildPythonPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
2022-05-18 14:49:53 +00:00
|
|
|
, argon2-cffi
|
2020-04-24 23:36:52 +00:00
|
|
|
, bcrypt
|
2022-05-18 14:49:53 +00:00
|
|
|
, cryptography
|
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "passlib";
|
2020-11-19 00:13:47 +00:00
|
|
|
version = "1.7.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-11-19 00:13:47 +00:00
|
|
|
sha256 = "defd50f72b65c5402ab2c573830a6978e5f202ad0d984793c8dde2c4152ebe04";
|
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 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
2022-06-16 17:23:12 +00:00
|
|
|
] ++ passthru.optional-dependencies.argon2
|
2022-10-30 15:09:59 +00:00
|
|
|
++ passthru.optional-dependencies.bcrypt
|
|
|
|
++ passthru.optional-dependencies.totp;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
disabledTests = [
|
|
|
|
# timming sensitive
|
|
|
|
"test_dummy_verify"
|
2022-10-30 15:09:59 +00:00
|
|
|
]
|
|
|
|
# These tests fail because they don't expect support for algorithms provided through libxcrypt
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
"test_82_crypt_support"
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A 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
|
|
|
};
|
|
|
|
}
|