diff --git a/pkgs/development/python-modules/faraday-plugins/default.nix b/pkgs/development/python-modules/faraday-plugins/default.nix new file mode 100644 index 000000000000..3b6b42a7678e --- /dev/null +++ b/pkgs/development/python-modules/faraday-plugins/default.nix @@ -0,0 +1,64 @@ +{ lib +, beautifulsoup4 +, buildPythonPackage +, click +, colorama +, fetchFromGitHub +, html2text +, lxml +, pytestCheckHook +, python-dateutil +, pytz +, requests +, simplejson +, tabulate +}: + +buildPythonPackage rec { + pname = "faraday-plugins"; + version = "1.5.3"; + + src = fetchFromGitHub { + owner = "infobyte"; + repo = "faraday_plugins"; + rev = "v${version}"; + sha256 = "0nyywpsyw7akwdah75s9mz5nz11y1hbynp08pvqifwdw49crih02"; + }; + + propagatedBuildInputs = [ + beautifulsoup4 + click + colorama + html2text + lxml + python-dateutil + pytz + requests + simplejson + tabulate + ]; + + checkInputs = [ + pytestCheckHook + ]; + + disabledTestPaths = [ + # faraday itself is currently not available + "tests/test_report_collection.py" + ]; + + disabledTests = [ + # Fail because of missing faraday + "test_detect_report" + "test_process_report_summary" + ]; + + pythonImportsCheck = [ "faraday_plugins" ]; + + meta = with lib; { + description = "Security tools report parsers for Faraday"; + homepage = "https://github.com/infobyte/faraday_plugins"; + license = with licenses; [ gpl3Only ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/python-status/default.nix b/pkgs/development/python-modules/python-status/default.nix new file mode 100644 index 000000000000..2633d93c312f --- /dev/null +++ b/pkgs/development/python-modules/python-status/default.nix @@ -0,0 +1,26 @@ +{ lib +, buildPythonPackage +, fetchPypi +}: + +buildPythonPackage rec { + pname = "python-status"; + version = "1.0.1"; + + src = fetchPypi { + inherit pname version; + sha256 = "0lryrvmi04g7d38ilm4wfw717m0ddhylrzb5cm59lrp3ai3q572f"; + }; + + # Project doesn't ship tests yet + doCheck = false; + + pythonImportsCheck = [ "status" ]; + + meta = with lib; { + description = "HTTP Status for Humans"; + homepage = "https://github.com/avinassh/status/"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/simple-rest-client/default.nix b/pkgs/development/python-modules/simple-rest-client/default.nix new file mode 100644 index 000000000000..b9b1cbe7b058 --- /dev/null +++ b/pkgs/development/python-modules/simple-rest-client/default.nix @@ -0,0 +1,55 @@ +{ lib +, asynctest +, buildPythonPackage +, fetchFromGitHub +, httpx +, pytest-asyncio +, pytest-httpserver +, pytestCheckHook +, python-slugify +, python-status +, pythonOlder +}: + +buildPythonPackage rec { + pname = "simple-rest-client"; + version = "1.0.8"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "allisson"; + repo = "python-simple-rest-client"; + rev = version; + sha256 = "12qxhrjhlbyyr1pkvwfkcxbsmyns5b0mfdn42vz310za5x76ldj3"; + }; + + propagatedBuildInputs = [ + httpx + python-slugify + python-status + ]; + + checkInputs = [ + asynctest + pytest-asyncio + pytest-httpserver + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace "pytest-runner" "" + substituteInPlace pytest.ini \ + --replace " --cov=simple_rest_client --cov-report=term-missing" "" + ''; + + pythonImportsCheck = [ "simple_rest_client" ]; + + meta = with lib; { + description = "Simple REST client for Python"; + homepage = "https://github.com/allisson/python-simple-rest-client"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/tools/security/faraday-cli/default.nix b/pkgs/tools/security/faraday-cli/default.nix new file mode 100644 index 000000000000..c220fe4ded0f --- /dev/null +++ b/pkgs/tools/security/faraday-cli/default.nix @@ -0,0 +1,46 @@ +{ lib +, fetchFromGitHub +, python3 +}: + +python3.pkgs.buildPythonApplication rec { + pname = "faraday-cli"; + version = "2.0.2"; + + disabled = python3.pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "infobyte"; + repo = pname; + rev = "v${version}"; + sha256 = "1jq8sim0b6k830lv1qzbrd1mx0nc2x1jq24fbama76gzqlb2axi7"; + }; + + propagatedBuildInputs = with python3.pkgs; [ + click + colorama + faraday-plugins + jsonschema + pyyaml + simple-rest-client + tabulate + validators + spinners + termcolor + cmd2 + log-symbols + arrow + ]; + + # Tests requires credentials + doCheck = false; + + pythonImportsCheck = [ "faraday_cli" ]; + + meta = with lib; { + description = "Command Line Interface for Faraday"; + homepage = "https://github.com/infobyte/faraday-cli"; + license = with licenses; [ gpl3Only ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d183e2db92ff..e28be4fca2ee 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5014,6 +5014,8 @@ with pkgs; fabric-installer = callPackage ../tools/games/minecraft/fabric-installer { }; + faraday-cli = callPackage ../tools/security/faraday-cli { }; + fastlane = callPackage ../tools/admin/fastlane { }; fatresize = callPackage ../tools/filesystems/fatresize {}; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cf0b715148e3..2529e2815009 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2506,6 +2506,8 @@ in { falcon = callPackage ../development/python-modules/falcon { }; + faraday-plugins = callPackage ../development/python-modules/faraday-plugins { }; + fastapi = callPackage ../development/python-modules/fastapi { }; fastavro = callPackage ../development/python-modules/fastavro { }; @@ -7140,6 +7142,8 @@ in { pytest-shutil = callPackage ../development/python-modules/pytest-shutil { }; + python-status = callPackage ../development/python-modules/python-status { }; + python-string-utils = callPackage ../development/python-modules/python-string-utils { }; pytest-socket = callPackage ../development/python-modules/pytest-socket { }; @@ -8270,6 +8274,8 @@ in { simplekml = callPackage ../development/python-modules/simplekml { }; + simple-rest-client = callPackage ../development/python-modules/simple-rest-client { }; + simple-salesforce = callPackage ../development/python-modules/simple-salesforce { }; simple-websocket-server = callPackage ../development/python-modules/simple-websocket-server { };