summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2020-08-27 23:26:05 +0100
committerJon <jonringer@users.noreply.github.com>2020-09-02 15:07:05 -0700
commitce47cdbeafcc4407a26e6211694be0d720b7eb1c (patch)
tree32774d0f95fc9eac2839714ebdfbe91a90c439eb /pkgs
parent4f612035e311c19c4f69f719d48ed9e7ebad7d06 (diff)
downloadnixpkgs-ce47cdbeafcc4407a26e6211694be0d720b7eb1c.tar
nixpkgs-ce47cdbeafcc4407a26e6211694be0d720b7eb1c.tar.gz
nixpkgs-ce47cdbeafcc4407a26e6211694be0d720b7eb1c.tar.bz2
nixpkgs-ce47cdbeafcc4407a26e6211694be0d720b7eb1c.tar.lz
nixpkgs-ce47cdbeafcc4407a26e6211694be0d720b7eb1c.tar.xz
nixpkgs-ce47cdbeafcc4407a26e6211694be0d720b7eb1c.tar.zst
nixpkgs-ce47cdbeafcc4407a26e6211694be0d720b7eb1c.zip
pythonPackages.asgi-csrf: init at 0.7
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/asgi-csrf/default.nix31
-rw-r--r--pkgs/top-level/python-packages.nix2
2 files changed, 33 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/asgi-csrf/default.nix b/pkgs/development/python-modules/asgi-csrf/default.nix
new file mode 100644
index 00000000000..12c94aee157
--- /dev/null
+++ b/pkgs/development/python-modules/asgi-csrf/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, buildPythonPackage, isPy27, fetchFromGitHub, itsdangerous, python-multipart
+, pytest, starlette, httpx, pytest-asyncio }:
+
+buildPythonPackage rec {
+  version = "0.7";
+  pname = "asgi-csrf";
+  disabled = isPy27;
+
+  # PyPI tarball doesn't include tests directory
+  src = fetchFromGitHub {
+    owner = "simonw";
+    repo = pname;
+    rev = version;
+    sha256 = "1vf4lh007790836cp3hd6wf8wsgj045dcg0w1cm335p08zz6j4k7";
+  };
+
+  propagatedBuildInputs = [ itsdangerous python-multipart ];
+
+  checkInputs = [ pytest starlette httpx pytest-asyncio ];
+  checkPhase = ''
+    pytest test_asgi_csrf.py
+  '';
+  pythonImportsCheck = [ "asgi_csrf" ];
+
+  meta = with stdenv.lib; {
+    description = "ASGI middleware for protecting against CSRF attacks";
+    license = licenses.asl20;
+    homepage = "https://github.com/simonw/asgi-csrf";
+    maintainers = [ maintainers.ris ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 27cb1517baa..399d49978b2 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -377,6 +377,8 @@ in {
   else
     callPackage ../development/python-modules/ase { };
 
+  asgi-csrf = callPackage ../development/python-modules/asgi-csrf { };
+
   asgiref = callPackage ../development/python-modules/asgiref { };
 
   asn1ate = callPackage ../development/python-modules/asn1ate { };