2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
2023-05-24 13:37:59 +00:00
|
|
|
, installShellFiles
|
2023-03-04 12:14:45 +00:00
|
|
|
, python3
|
2023-07-15 17:15:38 +00:00
|
|
|
, fetchPypi
|
2023-03-04 12:14:45 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, nix-update-script
|
|
|
|
, testers
|
|
|
|
, gimme-aws-creds
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
python = python3.override {
|
2024-09-19 14:19:46 +00:00
|
|
|
self = python;
|
2023-03-04 12:14:45 +00:00
|
|
|
packageOverrides = self: super: {
|
|
|
|
fido2 = super.fido2.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.9.3";
|
2023-05-24 13:37:59 +00:00
|
|
|
format = "setuptools";
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchPypi {
|
2023-03-04 12:14:45 +00:00
|
|
|
inherit (oldAttrs) pname;
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-tF6JphCc/Lfxu1E3dqotZAjpXEgi+DolORi5RAg0Zuw=";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
python.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "gimme-aws-creds";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "2.8.2"; # N.B: if you change this, check if overrides are still up-to-date
|
2023-03-04 12:14:45 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Nike-Inc";
|
|
|
|
repo = "gimme-aws-creds";
|
|
|
|
rev = "v${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-fsFYcfbLeYV6tpOGgNrFmYjcUAmdsx5zwUbvcctwFVs=";
|
2023-03-04 12:14:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = with python.pkgs; [
|
2023-05-24 13:37:59 +00:00
|
|
|
installShellFiles
|
2023-03-04 12:14:45 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonRemoveDeps = [
|
|
|
|
"configparser"
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
|
|
|
boto3
|
|
|
|
fido2
|
|
|
|
beautifulsoup4
|
|
|
|
ctap-keyring-device
|
|
|
|
requests
|
|
|
|
okta
|
2023-05-24 13:37:59 +00:00
|
|
|
pyjwt
|
2024-02-29 20:09:43 +00:00
|
|
|
html5lib
|
|
|
|
furl
|
2023-03-04 12:14:45 +00:00
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
preCheck = ''
|
|
|
|
# Disable using platform's keyring unavailable in sandbox
|
|
|
|
export PYTHON_KEYRING_BACKEND="keyring.backends.fail.Keyring"
|
|
|
|
'';
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
checkInputs = with python.pkgs; [
|
|
|
|
pytestCheckHook
|
|
|
|
responses
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"test_build_factor_name_webauthn_registered"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"gimme_aws_creds"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm $out/bin/gimme-aws-creds.cmd
|
|
|
|
chmod +x $out/bin/gimme-aws-creds
|
2023-05-24 13:37:59 +00:00
|
|
|
installShellCompletion --bash --name gimme-aws-creds $out/bin/gimme-aws-creds-autocomplete.sh
|
|
|
|
rm $out/bin/gimme-aws-creds-autocomplete.sh
|
2023-03-04 12:14:45 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
inherit python;
|
2023-08-04 22:07:22 +00:00
|
|
|
updateScript = nix-update-script { };
|
2023-03-04 12:14:45 +00:00
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = gimme-aws-creds;
|
|
|
|
command = ''touch tmp.conf && OKTA_CONFIG="tmp.conf" gimme-aws-creds --version'';
|
|
|
|
version = "gimme-aws-creds ${version}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/Nike-Inc/gimme-aws-creds";
|
|
|
|
changelog = "https://github.com/Nike-Inc/gimme-aws-creds/releases";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "CLI that utilizes Okta IdP via SAML to acquire temporary AWS credentials";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "gimme-aws-creds";
|
2023-03-04 12:14:45 +00:00
|
|
|
license = licenses.asl20;
|
2023-05-24 13:37:59 +00:00
|
|
|
maintainers = with maintainers; [ jbgosselin ];
|
2023-03-04 12:14:45 +00:00
|
|
|
};
|
|
|
|
}
|