2021-04-05 15:23:46 +00:00
|
|
|
{ lib
|
2022-04-27 09:35:20 +00:00
|
|
|
, boto3
|
2021-04-05 15:23:46 +00:00
|
|
|
, botocore
|
|
|
|
, buildPythonPackage
|
|
|
|
, click
|
|
|
|
, configparser
|
2022-04-27 09:35:20 +00:00
|
|
|
, fetchFromGitHub
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchpatch
|
2021-04-05 15:23:46 +00:00
|
|
|
, fido2
|
|
|
|
, lxml
|
2022-04-27 09:35:20 +00:00
|
|
|
, poetry-core
|
2021-04-05 15:23:46 +00:00
|
|
|
, pyopenssl
|
|
|
|
, pytestCheckHook
|
2022-04-27 09:35:20 +00:00
|
|
|
, pythonOlder
|
2021-04-05 15:23:46 +00:00
|
|
|
, requests
|
|
|
|
, requests-kerberos
|
2022-04-27 09:35:20 +00:00
|
|
|
, toml
|
2021-04-05 15:23:46 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "aws-adfs";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "2.2.1";
|
2022-04-27 09:35:20 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "venth";
|
|
|
|
repo = pname;
|
2022-05-18 14:49:53 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2022-06-16 17:23:12 +00:00
|
|
|
hash = "sha256-REJYuOGq22onMj4WcfA7i4/cG99UGZA9D99ESIKY1A8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
boto3
|
2021-04-05 15:23:46 +00:00
|
|
|
botocore
|
|
|
|
click
|
|
|
|
configparser
|
|
|
|
fido2
|
|
|
|
lxml
|
|
|
|
pyopenssl
|
|
|
|
requests
|
|
|
|
requests-kerberos
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
patches = [
|
|
|
|
# Apply new fido2 api (See: venth/aws-adfs#243)
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/venth/aws-adfs/commit/09836d89256f3537270d760d8aa30ab9284725a8.diff";
|
|
|
|
hash = "sha256-pAAJvOa43BXtyWvV8hsLe2xqd5oI+vzndckRTRol61s=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'boto3 = "^1.20.50"' 'boto3 = "*"' \
|
|
|
|
--replace 'botocore = ">=1.12.6"' 'botocore = "*"'
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-04-05 15:23:46 +00:00
|
|
|
pytestCheckHook
|
2022-04-27 09:35:20 +00:00
|
|
|
toml
|
2021-04-05 15:23:46 +00:00
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d);
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"aws_adfs"
|
|
|
|
];
|
2021-02-17 17:02:09 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2022-04-27 09:35:20 +00:00
|
|
|
description = "Command line tool to ease AWS CLI authentication against ADFS";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/venth/aws-adfs";
|
|
|
|
license = licenses.psfl;
|
2022-04-27 09:35:20 +00:00
|
|
|
maintainers = with maintainers; [ bhipple ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|