diff --git a/pkgs/development/python-modules/django-mfa3/default.nix b/pkgs/development/python-modules/django-mfa3/default.nix new file mode 100644 index 0000000000000..36491d2217fe3 --- /dev/null +++ b/pkgs/development/python-modules/django-mfa3/default.nix @@ -0,0 +1,51 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + django, + setuptools, + pyotp, + fido2, + qrcode, + coverage, +}: + +buildPythonPackage rec { + pname = "django-mfa3"; + version = "0.13.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "xi"; + repo = "django-mfa3"; + rev = "refs/tags/${version}"; + hash = "sha256-O8po7VevqyHlP2isnNnLbpgfs1p4sFezxIZKMTgnwuY="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + django + pyotp + fido2 + qrcode + ]; + + # qrcode 8.0 not supported yet + # See https://github.com/xi/django-mfa3/pull/14 + pythonRelaxDeps = [ "qrcode" ]; + + nativeCheckInputs = [ coverage ]; + + checkPhase = '' + coverage run -m django test --settings tests.settings + ''; + + meta = { + description = "Multi factor authentication for Django"; + homepage = "https://github.com/xi/django-mfa3"; + changelog = "https://github.com/xi/django-mfa3/blob/${src.rev}/CHANGES.md"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.onny ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2b327c4df2cd0..52032e3ce5a1b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3446,6 +3446,8 @@ self: super: with self; { django-markdownx = callPackage ../development/python-modules/django-markdownx { }; + django-mfa3 = callPackage ../development/python-modules/django-mfa3 { }; + django-model-utils = callPackage ../development/python-modules/django-model-utils { }; django-modelcluster = callPackage ../development/python-modules/django-modelcluster { };