3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #206598 from dennajort/gimme-aws-creds-2.4.4

This commit is contained in:
Sandro 2023-03-03 18:26:08 +01:00 committed by GitHub
commit 5a338babb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 330 additions and 0 deletions

View file

@ -3601,6 +3601,13 @@
githubId = 62989;
name = "Demyan Rogozhin";
};
dennajort = {
email = "gosselinjb@gmail.com";
matrix = "@dennajort:matrix.org";
github = "dennajort";
githubId = 1536838;
name = "Jean-Baptiste Gosselin";
};
derchris = {
email = "derchris@me.com";
github = "derchrisuk";

View file

@ -0,0 +1,71 @@
{ lib
, buildPythonPackage
, fetchPypi
, pythonRelaxDepsHook
, setuptools-scm
# install requirements
, fido2
, keyring
, cryptography
# test requirements
, pytestCheckHook
}:
let
fido2_0 = fido2.overridePythonAttrs (oldAttrs: rec {
version = "0.9.3";
src = fetchPypi {
inherit (oldAttrs) pname;
inherit version;
hash = "sha256-tF6JphCc/Lfxu1E3dqotZAjpXEgi+DolORi5RAg0Zuw=";
};
});
in
buildPythonPackage rec {
pname = "ctap-keyring-device";
version = "1.0.6";
src = fetchPypi {
inherit version pname;
sha256 = "sha256-pEJkuz0wxKt2PkowmLE2YC+HPYa2ZiENK7FAW14Ec/Y=";
};
# removing optional dependency needing pyobjc
postPatch = ''
substituteInPlace pytest.ini \
--replace "--flake8 --black --cov" ""
'';
nativeBuildInputs = [
pythonRelaxDepsHook
setuptools-scm
];
pythonRemoveDeps = [
# This is a darwin requirement missing pyobjc
"pyobjc-framework-LocalAuthentication"
];
propagatedBuildInputs = [
keyring
fido2_0
cryptography
];
pythonImportsCheck = [ "ctap_keyring_device" ];
checkInputs = [ pytestCheckHook ];
disabledTests = [
# Disabled tests that needs pyobjc or windows
"touch_id_ctap_user_verifier"
"windows_hello_ctap_user_verifier"
];
meta = with lib; {
description = "CTAP (client-to-authenticator-protocol) device backed by python's keyring library";
homepage = "https://github.com/dany74q/ctap-keyring-device";
license = licenses.mit;
maintainers = with maintainers; [ dennajort ];
};
}

View file

@ -0,0 +1,74 @@
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
# install requirements
, pycryptodome
, yarl
, flatdict
, python-jose
, aenum
, aiohttp
, pydash
, xmltodict
, pyyaml
# test requirements
, pytestCheckHook
, pytest-recording
, pytest-asyncio
, pytest-mock
, pyfakefs
}:
buildPythonPackage rec {
pname = "okta";
version = "2.8.0";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-yIVJoKX9b9Y7Ydl28twHxgPbUa58LJ12Oz3tvpU7CAc=";
};
propagatedBuildInputs = [
pycryptodome
yarl
flatdict
python-jose
aenum
aiohttp
pydash
xmltodict
pyyaml
];
checkInputs = [
pytestCheckHook
pytest-asyncio
pytest-mock
pytest-recording
pyfakefs
];
pytestFlagsArray = [ "tests/" ];
disabledTests = [
"test_client_raise_exception"
];
pythonImportsCheck = [
"okta"
"okta.cache"
"okta.client"
"okta.exceptions"
"okta.http_client"
"okta.models"
"okta.request_executor"
];
meta = with lib; {
description = "Python SDK for the Okta Management API";
homepage = "https://github.com/okta/okta-sdk-python";
license = licenses.asl20;
maintainers = with maintainers; [ dennajort ];
};
}

View file

@ -0,0 +1,64 @@
{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
# install dependencies
, pytest
, vcrpy
, attrs
# test dependencies
, pytestCheckHook
, pytest-httpbin
, pytest-mock
, requests
}:
buildPythonPackage rec {
pname = "pytest-recording";
version = "0.12.2";
src = fetchFromGitHub {
owner = "kiwicom";
repo = "pytest-recording";
rev = "v${version}";
hash = "sha256-nivwxaW8AIrBtPkzPJYfxlPxWn2NuYcaMry/IrBnnl0=";
};
buildInputs = [
pytest
];
propagatedBuildInputs = [
vcrpy
attrs
];
checkInputs = [
pytestCheckHook
pytest-httpbin
pytest-mock
requests
];
disabledTests = [
"test_block_network_with_allowed_hosts"
] ++ lib.optionals stdenv.isDarwin [
# Missing socket.AF_NETLINK
"test_other_socket"
];
pytestFlagsArray = [
"tests"
];
pythonImportsCheck = [
"pytest_recording"
];
meta = with lib; {
description = "A pytest plugin that allows you recording of network interactions via VCR.py";
homepage = "https://github.com/kiwicom/pytest-recording";
license = licenses.mit;
maintainers = with maintainers; [ dennajort ];
};
}

View file

@ -0,0 +1,106 @@
{ lib
, python3
, fetchFromGitHub
, nix-update-script
, testers
, gimme-aws-creds
}:
let
python = python3.override {
packageOverrides = self: super: {
fido2 = super.fido2.overridePythonAttrs (oldAttrs: rec {
version = "0.9.3";
src = self.fetchPypi {
inherit (oldAttrs) pname;
inherit version;
hash = "sha256-tF6JphCc/Lfxu1E3dqotZAjpXEgi+DolORi5RAg0Zuw=";
};
});
okta = super.okta.overridePythonAttrs (oldAttrs: rec {
version = "0.0.4";
src = self.fetchPypi {
inherit (oldAttrs) pname;
inherit version;
hash = "sha256-U+eSxo02hP9BQLTLHAKvOCEJA2j4EQ/eVMC9tjhEkzI=";
};
propagatedBuildInputs = [
self.six
self.python-dateutil
self.requests
];
pythonImportsCheck = [ "okta" ];
doCheck = false; # no tests were included with this version
});
};
};
in
python.pkgs.buildPythonApplication rec {
pname = "gimme-aws-creds";
version = "2.5.0"; # N.B: if you change this, check if overrides are still up-to-date
format = "setuptools";
src = fetchFromGitHub {
owner = "Nike-Inc";
repo = "gimme-aws-creds";
rev = "v${version}";
hash = "sha256-rU4guBXRRJOG3/JilvEF9DwXM5z2IUV80qj3YcV8Z/I=";
};
nativeBuildInputs = with python.pkgs; [
pythonRelaxDepsHook
];
pythonRemoveDeps = [
"configparser"
];
propagatedBuildInputs = with python.pkgs; [
boto3
fido2
beautifulsoup4
ctap-keyring-device
requests
okta
];
checkInputs = with python.pkgs; [
pytestCheckHook
nose
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
'';
passthru = {
inherit python;
updateScript = nix-update-script {
attrPath = pname;
};
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";
description = "A CLI that utilizes Okta IdP via SAML to acquire temporary AWS credentials";
license = licenses.asl20;
maintainers = with maintainers; [ dennajort ];
};
}

View file

@ -17002,6 +17002,8 @@ with pkgs;
gImageReader = callPackage ../applications/misc/gImageReader { };
gimme-aws-creds = callPackage ../tools/admin/gimme-aws-creds { };
guile_1_8 = callPackage ../development/interpreters/guile/1.8.nix { };
# Needed for autogen

View file

@ -2144,6 +2144,8 @@ self: super: with self; {
csvw = callPackage ../development/python-modules/csvw { };
ctap-keyring-device = callPackage ../development/python-modules/ctap-keyring-device { };
cu2qu = callPackage ../development/python-modules/cu2qu { };
cucumber-tag-expressions = callPackage ../development/python-modules/cucumber-tag-expressions { };
@ -6645,6 +6647,8 @@ self: super: with self; {
oemthermostat = callPackage ../development/python-modules/oemthermostat { };
okta = callPackage ../development/python-modules/okta { };
olefile = callPackage ../development/python-modules/olefile { };
oletools = callPackage ../development/python-modules/oletools { };
@ -9194,6 +9198,8 @@ self: super: with self; {
pytest-random-order = callPackage ../development/python-modules/pytest-random-order { };
pytest-recording = callPackage ../development/python-modules/pytest-recording { };
pytest-regressions = callPackage ../development/python-modules/pytest-regressions { };
pytest-relaxed = callPackage ../development/python-modules/pytest-relaxed { };