1{ lib
2, buildPythonPackage
3, isPy27
4, fetchFromGitHub
5, itsdangerous
6, python-multipart
7, pytestCheckHook
8, starlette
9, httpx
10, pytest-asyncio
11}:
12
13buildPythonPackage rec {
14 version = "0.9";
15 pname = "asgi-csrf";
16 disabled = isPy27;
17
18 # PyPI tarball doesn't include tests directory
19 src = fetchFromGitHub {
20 owner = "simonw";
21 repo = pname;
22 rev = version;
23 hash = "sha256-mmOsN2mW6eGtapq3xLqHK8hhSD0Gjzp3DsY5AGUlI8g=";
24 };
25
26 propagatedBuildInputs = [
27 itsdangerous
28 python-multipart
29 ];
30
31 nativeCheckInputs = [
32 httpx
33 pytest-asyncio
34 pytestCheckHook
35 starlette
36 ];
37
38 doCheck = false; # asgi-lifespan missing
39
40 pythonImportsCheck = [ "asgi_csrf" ];
41
42 meta = with lib; {
43 description = "ASGI middleware for protecting against CSRF attacks";
44 license = licenses.asl20;
45 homepage = "https://github.com/simonw/asgi-csrf";
46 maintainers = [ maintainers.ris ];
47 };
48}