2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
gibberish-detector,
|
|
|
|
mock,
|
|
|
|
pkgs,
|
|
|
|
pyahocorasick,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pyyaml,
|
|
|
|
requests,
|
|
|
|
responses,
|
|
|
|
setuptools,
|
|
|
|
unidiff,
|
2023-03-15 16:39:30 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bc-detect-secrets";
|
2024-10-09 16:51:18 +00:00
|
|
|
version = "1.5.17";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bridgecrewio";
|
|
|
|
repo = "detect-secrets";
|
|
|
|
rev = "refs/tags/${version}";
|
2024-10-09 16:51:18 +00:00
|
|
|
hash = "sha256-5a9emduaH69v59MbpWn9Yx35lgt9b1ie5nVBnl84VuU=";
|
2023-03-15 16:39:30 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
dependencies = [
|
2023-03-15 16:39:30 +00:00
|
|
|
pyyaml
|
|
|
|
requests
|
|
|
|
unidiff
|
|
|
|
];
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
optional-dependencies = {
|
2024-05-15 15:35:15 +00:00
|
|
|
word_list = [ pyahocorasick ];
|
|
|
|
gibberish = [ gibberish-detector ];
|
2023-03-15 16:39:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
mock
|
|
|
|
pkgs.gitMinimal
|
|
|
|
pytestCheckHook
|
|
|
|
responses
|
2024-10-04 16:56:33 +00:00
|
|
|
] ++ lib.flatten (builtins.attrValues optional-dependencies);
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d);
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests are failing for various reasons (missing git repo, missing test data, etc.)
|
|
|
|
"test_baseline_filters_out_known_secrets"
|
|
|
|
"test_make_decisions"
|
|
|
|
"test_saves_to_baseline"
|
|
|
|
"test_start_halfway"
|
|
|
|
"TestCreate"
|
|
|
|
"TestDiff"
|
|
|
|
"TestGetFilesToScan"
|
|
|
|
"TestLineNumberChanges"
|
|
|
|
"TestModifiesBaselineFromVersionChange"
|
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
pythonImportsCheck = [ "detect_secrets" ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Tool to detect secrets in the code";
|
|
|
|
homepage = "https://github.com/bridgecrewio/detect-secrets";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|