1{
2 lib,
3 asn1crypto,
4 azure-identity,
5 azure-keyvault-keys,
6 boto3,
7 botocore,
8 buildPythonPackage,
9 cryptography,
10 ed25519,
11 fetchFromGitHub,
12 google-cloud-kms,
13 hatchling,
14 pynacl,
15 pyspx,
16 pytestCheckHook,
17 pythonOlder,
18}:
19
20buildPythonPackage rec {
21 pname = "securesystemslib";
22 version = "1.3.1";
23 pyproject = true;
24
25 disabled = pythonOlder "3.8";
26
27 src = fetchFromGitHub {
28 owner = "secure-systems-lab";
29 repo = "securesystemslib";
30 tag = "v${version}";
31 hash = "sha256-ERFRLNHD3OhbMEGBEnDLkRYGv4f+bYg9MStS5IarcPA=";
32 };
33
34 build-system = [ hatchling ];
35
36 optional-dependencies = {
37 PySPX = [ pyspx ];
38 awskms = [
39 boto3
40 botocore
41 cryptography
42 ];
43 azurekms = [
44 azure-identity
45 azure-keyvault-keys
46 cryptography
47 ];
48 crypto = [ cryptography ];
49 gcpkms = [
50 cryptography
51 google-cloud-kms
52 ];
53 hsm = [
54 asn1crypto
55 cryptography
56 # pykcs11
57 ];
58 pynacl = [ pynacl ];
59 # Circular dependency
60 # sigstore = [
61 # sigstore
62 # ];
63 };
64
65 nativeCheckInputs = [
66 ed25519
67 pytestCheckHook
68 ]
69 ++ lib.flatten (builtins.attrValues optional-dependencies);
70
71 pythonImportsCheck = [ "securesystemslib" ];
72
73 disabledTestPaths = [
74 # pykcs11 is not available
75 "tests/test_hsm_signer.py"
76 # Ignore vendorized tests
77 "securesystemslib/_vendor/"
78 ];
79
80 meta = with lib; {
81 description = "Cryptographic and general-purpose routines";
82 homepage = "https://github.com/secure-systems-lab/securesystemslib";
83 changelog = "https://github.com/secure-systems-lab/securesystemslib/blob/${src.tag}/CHANGELOG.md";
84 license = licenses.mit;
85 maintainers = with maintainers; [ fab ];
86 };
87}