diff --git a/pkgs/development/python-modules/slowapi/default.nix b/pkgs/development/python-modules/slowapi/default.nix new file mode 100644 index 000000000000..921a191d5fa1 --- /dev/null +++ b/pkgs/development/python-modules/slowapi/default.nix @@ -0,0 +1,63 @@ +{ lib +, buildPythonPackage +, fastapi +, fetchFromGitHub +, fetchpatch +, limits +, mock +, hiro +, poetry-core +, pytestCheckHook +, pythonOlder +, redis +, starlette +}: + +buildPythonPackage rec { + pname = "slowapi"; + version = "0.1.4"; + format = "pyproject"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "laurentS"; + repo = pname; + rev = "v${version}"; + sha256 = "0bnnzgv2wy145sdab54hljwv1b5029ndrr0y9rc2q0mraz8lf8lm"; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + limits + redis + ]; + + checkInputs = [ + fastapi + hiro + mock + pytestCheckHook + starlette + ]; + + patches = [ + # Switch to poetry-core, https://github.com/laurentS/slowapi/pull/54 + (fetchpatch { + name = "switch-to-poetry-core.patch"; + url = "https://github.com/laurentS/slowapi/commit/fe165f2d479f4f8e4b7dd9cd88ec0ae847b490c5.patch"; + sha256 = "16vjxdjjiyg8zjrgfyg9q2ym2lmnms2zy5d2cg3ccg51cfl715fi"; + }) + ]; + + pythonImportsCheck = [ "slowapi" ]; + + meta = with lib; { + description = "Python library for API rate limiting"; + homepage = "https://github.com/laurentS/slowapi"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/tools/security/theharvester/default.nix b/pkgs/tools/security/theharvester/default.nix index 2fae6c465d59..dc1596facdff 100644 --- a/pkgs/tools/security/theharvester/default.nix +++ b/pkgs/tools/security/theharvester/default.nix @@ -4,8 +4,8 @@ }: python3.pkgs.buildPythonApplication rec { - pname = "theHarvester"; - version = "3.2.3"; + pname = "theharvester"; + version = "4.0.0"; src = fetchFromGitHub { owner = "laramies"; @@ -16,6 +16,7 @@ python3.pkgs.buildPythonApplication rec { propagatedBuildInputs = with python3.pkgs; [ aiodns + aiofiles aiohttp aiomultiprocess aiosqlite @@ -23,8 +24,7 @@ python3.pkgs.buildPythonApplication rec { censys certifi dnspython - gevent - grequests + fastapi lxml netaddr plotly @@ -33,14 +33,23 @@ python3.pkgs.buildPythonApplication rec { requests retrying shodan - texttable + slowapi + starlette + uvicorn uvloop ]; - checkInputs = [ python3.pkgs.pytest ]; + checkInputs = with python3.pkgs; [ + pytest + pytest-asyncio + ]; - checkPhase = "runHook preCheck ; pytest tests/test_myparser.py ; runHook postCheck"; # We don't run other tests (discovery modules) because they require network access + checkPhase = '' + runHook preCheck + pytest tests/test_myparser.py + runHook postCheck + ''; meta = with lib; { description = "Gather E-mails, subdomains and names from different public sources"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c8d101cc282d..d91d9d044177 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8008,6 +8008,8 @@ in { slob = callPackage ../development/python-modules/slob { }; + slowapi = callPackage ../development/python-modules/slowapi { }; + sly = callPackage ../development/python-modules/sly { }; smart-meter-texas = callPackage ../development/python-modules/smart-meter-texas { };