1{ lib
2, boto3
3, botocore
4, buildPythonPackage
5, click
6, configparser
7, fetchFromGitHub
8, fetchpatch
9, fido2
10, lxml
11, poetry-core
12, pyopenssl
13, pytestCheckHook
14, pythonOlder
15, requests
16, requests-kerberos
17, toml
18}:
19
20buildPythonPackage rec {
21 pname = "aws-adfs";
22 version = "2.2.1";
23 format = "pyproject";
24
25 disabled = pythonOlder "3.6";
26
27 src = fetchFromGitHub {
28 owner = "venth";
29 repo = pname;
30 rev = "refs/tags/${version}";
31 hash = "sha256-REJYuOGq22onMj4WcfA7i4/cG99UGZA9D99ESIKY1A8=";
32 };
33
34 nativeBuildInputs = [
35 poetry-core
36 ];
37
38 propagatedBuildInputs = [
39 boto3
40 botocore
41 click
42 configparser
43 fido2
44 lxml
45 pyopenssl
46 requests
47 requests-kerberos
48 ];
49
50 patches = [
51 # Apply new fido2 api (See: venth/aws-adfs#243)
52 (fetchpatch {
53 url = "https://github.com/venth/aws-adfs/commit/09836d89256f3537270d760d8aa30ab9284725a8.diff";
54 hash = "sha256-pAAJvOa43BXtyWvV8hsLe2xqd5oI+vzndckRTRol61s=";
55 })
56 ];
57
58 postPatch = ''
59 substituteInPlace pyproject.toml \
60 --replace 'boto3 = "^1.20.50"' 'boto3 = "*"' \
61 --replace 'botocore = ">=1.12.6"' 'botocore = "*"'
62 '';
63
64 checkInputs = [
65 pytestCheckHook
66 toml
67 ];
68
69 preCheck = ''
70 export HOME=$(mktemp -d);
71 '';
72
73 pythonImportsCheck = [
74 "aws_adfs"
75 ];
76
77 meta = with lib; {
78 description = "Command line tool to ease AWS CLI authentication against ADFS";
79 homepage = "https://github.com/venth/aws-adfs";
80 license = licenses.psfl;
81 maintainers = with maintainers; [ bhipple ];
82 };
83}