1{
2 lib,
3 aiohttp,
4 asn1crypto,
5 buildPythonPackage,
6 cryptography,
7 fetchFromGitHub,
8 freezegun,
9 oscrypto,
10 pytest-asyncio,
11 pytestCheckHook,
12 pythonOlder,
13 requests,
14 setuptools,
15 uritools,
16}:
17
18buildPythonPackage rec {
19 pname = "pyhanko-certvalidator";
20 version = "0.26.3";
21 pyproject = true;
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchFromGitHub {
26 owner = "MatthiasValvekens";
27 repo = "certvalidator";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-uUmsWiN182g+kxrCny7UNLDHdAdqKk64w6vnjmGBNjM=";
30 };
31
32 postPatch = ''
33 substituteInPlace pyproject.toml \
34 --replace ', "pytest-runner",' ""
35 '';
36
37 nativeBuildInputs = [ setuptools ];
38
39 propagatedBuildInputs = [
40 asn1crypto
41 cryptography
42 oscrypto
43 requests
44 uritools
45 ];
46
47 nativeCheckInputs = [
48 aiohttp
49 freezegun
50 pytest-asyncio
51 pytestCheckHook
52 ];
53
54 disabledTestPaths = [
55 # Requests
56 "tests/test_crl_client.py"
57 ];
58
59 disabledTests = [
60 # Look for nonexisting certificates
61 "test_basic_certificate_validator_tls"
62 # Failed to fetch OCSP response from http://ocsp.digicert.com
63 "test_fetch_ocsp_aiohttp"
64 "test_fetch_ocsp_requests"
65 "test_fetch_ocsp_err_requests"
66 # Unable to build a validation path for the certificate "%s" - no issuer matching "%s" was found
67 "test_revocation_mode_hard_aiohttp_autofetch"
68 # The path could not be validated because no revocation information could be found for intermediate certificate 1
69 "test_revocation_mode_hard"
70 # ValueError: Hash algorithm not known for ed448
71 "test_ed"
72 ];
73
74 pythonImportsCheck = [ "pyhanko_certvalidator" ];
75
76 meta = with lib; {
77 description = "Python library for validating X.509 certificates and paths";
78 homepage = "https://github.com/MatthiasValvekens/certvalidator";
79 changelog = "https://github.com/MatthiasValvekens/certvalidator/blob/v${version}/changelog.md";
80 license = licenses.mit;
81 maintainers = with maintainers; [ wolfangaukang ];
82 };
83}