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