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..c0ed1e4f287bb --- /dev/null +++ b/pkgs/development/python-modules/django-mfa3/default.nix @@ -0,0 +1,49 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + django, + setuptools, + pyotp, + fido2, + qrcode, + python, +}: + +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" ]; + + checkPhase = '' + ${python.interpreter} -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 051fead9ec4d6..d86f8de75cb91 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3444,6 +3444,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 { };