From 41644fbcd5eb8f631854047ab3ad640275ecf002 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 1 May 2025 22:31:13 +0200 Subject: [PATCH 1/3] python312Packages.wapiti-arsenit: init at 28.2 --- .../python-modules/wapiti-arsenic/default.nix | 60 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 62 insertions(+) create mode 100644 pkgs/development/python-modules/wapiti-arsenic/default.nix diff --git a/pkgs/development/python-modules/wapiti-arsenic/default.nix b/pkgs/development/python-modules/wapiti-arsenic/default.nix new file mode 100644 index 000000000000..b0fb440cf612 --- /dev/null +++ b/pkgs/development/python-modules/wapiti-arsenic/default.nix @@ -0,0 +1,60 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + + # build-system + poetry-core, + + # dependencies + aiohttp, + attrs, + packaging, + structlog, +}: + +buildPythonPackage rec { + pname = "wapiti-arsenic"; + version = "28.2"; + pyproject = true; + + # Latest tag is not on GitHub + src = fetchPypi { + pname = "wapiti_arsenic"; + inherit version; + hash = "sha256-QxjM0BsiHm/LPUuGLLPG6OUcr4YXBEpfJGTwKp1zTWQ="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "poetry>=0.12" "poetry-core" \ + --replace-fail "poetry.masonry" "poetry.core.masonry" + ''; + + build-system = [ + poetry-core + ]; + + pythonRelaxDeps = [ + "structlog" + ]; + + dependencies = [ + aiohttp + attrs + packaging + structlog + ]; + + pythonImportsCheck = [ "wapiti_arsenic" ]; + + # No tests in the pypi archive + doCheck = false; + + meta = { + description = "Asynchronous WebDriver client"; + homepage = "https://github.com/wapiti-scanner/arsenic"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 464cfed57f71..00cf3394fdf2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -18778,6 +18778,8 @@ self: super: with self; { wandb = callPackage ../development/python-modules/wandb { }; + wapiti-arsenic = callPackage ../development/python-modules/wapiti-arsenic { }; + waqiasync = callPackage ../development/python-modules/waqiasync { }; warble = callPackage ../development/python-modules/warble { }; From 16cc7a3a86d15151b558b83a479669831b3fec45 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 1 May 2025 22:36:24 +0200 Subject: [PATCH 2/3] python312Packages.arsenic-swagger: init at 0.1.9 --- .../python-modules/wapiti-swagger/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/wapiti-swagger/default.nix diff --git a/pkgs/development/python-modules/wapiti-swagger/default.nix b/pkgs/development/python-modules/wapiti-swagger/default.nix new file mode 100644 index 000000000000..16e6668ebdc3 --- /dev/null +++ b/pkgs/development/python-modules/wapiti-swagger/default.nix @@ -0,0 +1,42 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + pyyaml, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "wapiti-swagger"; + version = "0.1.9"; + pyproject = true; + + src = fetchFromGitHub { + owner = "wapiti-scanner"; + repo = "wapiti_swagger"; + tag = version; + hash = "sha256-On4R5+9+6w8CdZYQ8oxAfuxWTQZotkxjrIf497lETfw="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + pyyaml + ]; + + pythonImportsCheck = [ "wapiti_swagger" ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + meta = { + description = "Library for parsing and generating request bodies from Swagger/OpenAPI specifications"; + homepage = "https://github.com/wapiti-scanner/wapiti_swagger"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 00cf3394fdf2..abbdf0421c2f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -18780,6 +18780,8 @@ self: super: with self; { wapiti-arsenic = callPackage ../development/python-modules/wapiti-arsenic { }; + wapiti-swagger = callPackage ../development/python-modules/wapiti-swagger { }; + waqiasync = callPackage ../development/python-modules/waqiasync { }; warble = callPackage ../development/python-modules/warble { }; From e1d9f8daed0f0c13b15128ba118f0c3021ab761b Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 1 May 2025 22:19:06 +0200 Subject: [PATCH 3/3] wapiti: 3.2.2 -> 3.2.4 Diff: https://github.com/wapiti-scanner/wapiti/compare/refs/tags/3.2.2...refs/tags/3.2.4 Changelog: https://github.com/wapiti-scanner/wapiti/blob/3.2.4/doc/ChangeLog_Wapiti --- pkgs/by-name/wa/wapiti/package.nix | 114 +++++++++++++++++------------ 1 file changed, 67 insertions(+), 47 deletions(-) diff --git a/pkgs/by-name/wa/wapiti/package.nix b/pkgs/by-name/wa/wapiti/package.nix index 9955e422423d..ca2abf9ab6fe 100644 --- a/pkgs/by-name/wa/wapiti/package.nix +++ b/pkgs/by-name/wa/wapiti/package.nix @@ -1,67 +1,82 @@ { lib, fetchFromGitHub, - python3, + python3Packages, + fetchpatch, + versionCheckHook, + writableTmpDirAsHomeHook, + nix-update-script, }: -python3.pkgs.buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "wapiti"; - version = "3.2.2"; + version = "3.2.4"; pyproject = true; src = fetchFromGitHub { owner = "wapiti-scanner"; repo = "wapiti"; tag = version; - hash = "sha256-sa4bXZiY5yd0wynUjdLnuuX7Ee0w4APd1G/oGy5AUDk="; + hash = "sha256-97RYJKCk3oY715mgkFNstrrhWc1Q7jZqktqt7l8uzGs="; }; + patches = [ + # Fixes: + # TypeError: AsyncClient.__init__() got an unexpected keyword argument 'proxies' + (fetchpatch { + name = "fix-wappalyzer-warnings"; + url = "https://github.com/wapiti-scanner/wapiti/commit/77fe140f8ad4d2fb266f1b49285479f6af25d6b7.patch"; + hash = "sha256-Htkpr+67V0bp4u8HbMP+yTZ4rlIWDadLZxLDSruDbZY="; + }) + ]; + pythonRelaxDeps = true; - build-system = with python3.pkgs; [ setuptools ]; + build-system = with python3Packages; [ setuptools ]; - dependencies = - with python3.pkgs; - [ - aiocache - aiohttp - aiosqlite - arsenic - beautifulsoup4 - browser-cookie3 - dnspython - h11 - httpcore - httpx - httpx-ntlm - humanize - loguru - mako - markupsafe - mitmproxy - prance - pyasn1 - six - sqlalchemy - tld - yaswfp - ] - ++ httpx.optional-dependencies.brotli - ++ httpx.optional-dependencies.socks - ++ prance.optional-dependencies.osv; + dependencies = with python3Packages; [ + aiocache + aiohttp + aiosqlite + beautifulsoup4 + browser-cookie3 + dnspython + h11 + httpcore + httpx + httpx-ntlm + humanize + loguru + mako + markupsafe + mitmproxy + msgpack + packaging + pyasn1 + sqlalchemy + tld + typing-extensions + urwid + yaswfp + wapiti-arsenic + wapiti-swagger + ]; __darwinAllowLocalNetworking = true; - nativeCheckInputs = with python3.pkgs; [ - respx - pytest-asyncio - pytest-cov-stub - pytestCheckHook - ]; - - preCheck = '' - export HOME=$(mktemp -d); - ''; + nativeCheckInputs = + with python3Packages; + [ + respx + pytest-asyncio + pytest-cov-stub + pytestCheckHook + ] + ++ [ + versionCheckHook + writableTmpDirAsHomeHook + ]; + versionCheckProgramArg = "--version"; disabledTests = [ # Tests requires network access @@ -140,7 +155,11 @@ python3.pkgs.buildPythonApplication rec { pythonImportsCheck = [ "wapitiCore" ]; - meta = with lib; { + passthru = { + updateScript = nix-update-script { }; + }; + + meta = { description = "Web application vulnerability scanner"; longDescription = '' Wapiti allows you to audit the security of your websites or web applications. @@ -152,7 +171,8 @@ python3.pkgs.buildPythonApplication rec { ''; homepage = "https://wapiti-scanner.github.io/"; changelog = "https://github.com/wapiti-scanner/wapiti/blob/${version}/doc/ChangeLog_Wapiti"; - license = licenses.gpl2Only; - maintainers = with maintainers; [ fab ]; + license = lib.licenses.gpl2Only; + maintainers = with lib.maintainers; [ fab ]; + mainProgram = "wapiti"; }; }