1{
2 lib,
3 buildPythonPackage,
4 click,
5 fetchFromGitHub,
6 mock,
7 pytestCheckHook,
8 pythonOlder,
9 requests,
10 tldextract,
11 urllib3,
12 validators,
13}:
14
15buildPythonPackage rec {
16 pname = "corsair-scan";
17 version = "0.2.0";
18 format = "setuptools";
19
20 disabled = pythonOlder "3.8";
21
22 src = fetchFromGitHub {
23 owner = "Santandersecurityresearch";
24 repo = "corsair_scan";
25 tag = "v${version}";
26 hash = "sha256-s94ZiTL7tBrhUaeB/O3Eh8o8zqtfdt0z8LKep1bZWiY=";
27 };
28
29 postPatch = ''
30 substituteInPlace setup.py \
31 --replace "'pytest-runner'," ""
32 '';
33
34 propagatedBuildInputs = [
35 validators
36 requests
37 urllib3
38 tldextract
39 click
40 ];
41
42 nativeCheckInputs = [
43 mock
44 pytestCheckHook
45 ];
46
47 pythonImportsCheck = [ "corsair_scan" ];
48
49 disabledTests = [
50 # Tests want to download Public Suffix List
51 "test_corsair_scan_401"
52 "test_corsair_scan_origin"
53 ];
54
55 meta = with lib; {
56 description = "Python module to check for Cross-Origin Resource Sharing (CORS) misconfigurations";
57 mainProgram = "corsair";
58 homepage = "https://github.com/Santandersecurityresearch/corsair_scan";
59 changelog = "https://github.com/Santandersecurityresearch/corsair_scan/releases/tag/v${version}";
60 license = with licenses; [ mit ];
61 maintainers = with maintainers; [ fab ];
62 };
63}