From c18d193adc1fbcdb8bb1d221e5f1c51e79cdc4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 30 Dec 2022 05:01:53 +0100 Subject: [PATCH 1/2] trufflehog: 2.2.1 -> 3.21.0 --- pkgs/tools/security/trufflehog/default.nix | 59 +++++++++------------- 1 file changed, 24 insertions(+), 35 deletions(-) diff --git a/pkgs/tools/security/trufflehog/default.nix b/pkgs/tools/security/trufflehog/default.nix index 27574241576a..9e2b2e44f33a 100644 --- a/pkgs/tools/security/trufflehog/default.nix +++ b/pkgs/tools/security/trufflehog/default.nix @@ -1,43 +1,32 @@ { lib -, python3Packages +, fetchFromGitHub +, buildGoModule }: -let - truffleHogRegexes = python3Packages.buildPythonPackage rec { - pname = "truffleHogRegexes"; - version = "0.0.7"; - src = python3Packages.fetchPypi { - inherit pname version; - sha256 = "b81dfc60c86c1e353f436a0e201fd88edb72d5a574615a7858485c59edf32405"; - }; +buildGoModule rec { + pname = "trufflehog"; + version = "3.21.0"; + + src = fetchFromGitHub { + owner = "trufflesecurity"; + repo = "trufflehog"; + rev = "v${version}"; + sha256 = "sha256-rse5uyQ7EUBhs0IyC92B/Z7YCeNIXTlZEqrlcjFekgA="; }; -in - python3Packages.buildPythonApplication rec { - pname = "truffleHog"; - version = "2.2.1"; - src = python3Packages.fetchPypi { - inherit pname version; - hash = "sha256-fw0JyM2iqQrkL4FAXllEozJdkKWELS3eAURx5NZcceQ="; - }; + vendorSha256 = "sha256-KyyJ7hUWF29L8oB9GkJ918/BQoLMsz+tStT2T9Azunk="; - # Relax overly restricted version constraint - postPatch = '' - substituteInPlace setup.py --replace "GitPython ==" "GitPython >= " - ''; + # Test cases run git clone and require network access + doCheck = false; - propagatedBuildInputs = [ - python3Packages.gitpython - truffleHogRegexes - ]; + postInstall = '' + rm $out/bin/{generate,snifftest} + ''; - # Test cases run git clone and require network access - doCheck = false; - - meta = with lib; { - homepage = "https://github.com/dxa4481/truffleHog"; - description = "Searches through git repositories for high entropy strings and secrets, digging deep into commit history"; - license = with licenses; [ gpl2 ]; - maintainers = with maintainers; [ bhipple ]; - }; - } + meta = with lib; { + description = "Find credentials all over the place"; + homepage = "https://github.com/trufflesecurity/trufflehog"; + license = with licenses; [ agpl3 ]; + maintainers = with maintainers; [ ]; + }; +} From de21dd1cd0f494813490849c91b7ab18b5c6fde2 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 4 Jan 2023 09:31:13 +0100 Subject: [PATCH 2/2] trufflehog: add changelog to meta --- pkgs/tools/security/trufflehog/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/trufflehog/default.nix b/pkgs/tools/security/trufflehog/default.nix index 9e2b2e44f33a..76ccda498b47 100644 --- a/pkgs/tools/security/trufflehog/default.nix +++ b/pkgs/tools/security/trufflehog/default.nix @@ -10,11 +10,11 @@ buildGoModule rec { src = fetchFromGitHub { owner = "trufflesecurity"; repo = "trufflehog"; - rev = "v${version}"; - sha256 = "sha256-rse5uyQ7EUBhs0IyC92B/Z7YCeNIXTlZEqrlcjFekgA="; + rev = "refs/tags/v${version}"; + hash = "sha256-rse5uyQ7EUBhs0IyC92B/Z7YCeNIXTlZEqrlcjFekgA="; }; - vendorSha256 = "sha256-KyyJ7hUWF29L8oB9GkJ918/BQoLMsz+tStT2T9Azunk="; + vendorHash = "sha256-KyyJ7hUWF29L8oB9GkJ918/BQoLMsz+tStT2T9Azunk="; # Test cases run git clone and require network access doCheck = false; @@ -26,6 +26,7 @@ buildGoModule rec { meta = with lib; { description = "Find credentials all over the place"; homepage = "https://github.com/trufflesecurity/trufflehog"; + changelog = "https://github.com/trufflesecurity/trufflehog/releases/tag/v${version}"; license = with licenses; [ agpl3 ]; maintainers = with maintainers; [ ]; };