From 0af9c974aad0d46b9500ef6179b9449d5157b0f7 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 2 Apr 2021 11:09:55 +0200 Subject: [PATCH] python3Packages.privacyIDEA: 3.5.1 -> 3.5.2 ChangeLog: https://github.com/privacyidea/privacyidea/blob/v3.5.2/Changelog#L1 --- .../python-modules/privacyidea/default.nix | 11 ++++++-- .../privacyidea/fix-tests.patch | 28 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/python-modules/privacyidea/fix-tests.patch diff --git a/pkgs/development/python-modules/privacyidea/default.nix b/pkgs/development/python-modules/privacyidea/default.nix index 37f0a135993f..c28a00901682 100644 --- a/pkgs/development/python-modules/privacyidea/default.nix +++ b/pkgs/development/python-modules/privacyidea/default.nix @@ -11,16 +11,22 @@ buildPythonPackage rec { pname = "privacyIDEA"; - version = "3.5.1"; + version = "3.5.2"; src = fetchFromGitHub { owner = pname; repo = pname; rev = "v${version}"; - sha256 = "sha256-XJnrrpU0x2Axu7W4G3oDTjSJuqEyh3C/0Aga5D0gw9k="; + sha256 = "sha256-k2om2LjkFRCT53ECPAJEztCiMdz4fF5eoipVUvSoyGo="; fetchSubmodules = true; }; + patches = [ + # Subset of https://github.com/privacyidea/privacyidea/commit/359db6dd10212b8a210e0a83536e92e9e796a1f8, + # fixes app context errors in tests. Can be removed on the next bump. + ./fix-tests.patch + ]; + propagatedBuildInputs = [ cryptography pyrad pymysql python-dateutil flask-versioned flask_script defusedxml croniter flask_migrate pyjwt configobj sqlsoup pillow @@ -36,6 +42,7 @@ buildPythonPackage rec { "AESHardwareSecurityModuleTestCase" "test_01_cert_request" "test_01_loading_scripts" + "test_02_api_push_poll" "test_02_cert_enrolled" "test_02_enroll_rights" "test_02_get_resolvers" diff --git a/pkgs/development/python-modules/privacyidea/fix-tests.patch b/pkgs/development/python-modules/privacyidea/fix-tests.patch new file mode 100644 index 000000000000..67c22d2052e1 --- /dev/null +++ b/pkgs/development/python-modules/privacyidea/fix-tests.patch @@ -0,0 +1,28 @@ +diff --git a/privacyidea/lib/resolvers/LDAPIdResolver.py b/privacyidea/lib/resolvers/LDAPIdResolver.py +index ae9d87764..cfc609931 100644 +--- a/privacyidea/lib/resolvers/LDAPIdResolver.py ++++ b/privacyidea/lib/resolvers/LDAPIdResolver.py +@@ -97,11 +97,6 @@ + SERVERPOOL_ROUNDS = 2 + # The number of seconds a non-responding server is removed from the server pool + SERVERPOOL_SKIP = 30 +-# The number of seconds that ldap3 waits if no server is left in the pool, before +-# starting the next round +-pooling_loop_timeout = get_app_config_value("PI_LDAP_POOLING_LOOP_TIMEOUT", 10) +-log.info("Setting system wide POOLING_LOOP_TIMEOUT to {0!s}.".format(pooling_loop_timeout)) +-ldap3.set_config_parameter("POOLING_LOOP_TIMEOUT", pooling_loop_timeout) + + # 1 sec == 10^9 nano secs == 10^7 * (100 nano secs) + MS_AD_MULTIPLYER = 10 ** 7 +@@ -314,6 +309,11 @@ def __init__(self): + self.serverpool_rounds = SERVERPOOL_ROUNDS + self.serverpool_skip = SERVERPOOL_SKIP + self.serverpool = None ++ # The number of seconds that ldap3 waits if no server is left in the pool, before ++ # starting the next round ++ pooling_loop_timeout = get_app_config_value("PI_LDAP_POOLING_LOOP_TIMEOUT", 10) ++ log.info("Setting system wide POOLING_LOOP_TIMEOUT to {0!s}.".format(pooling_loop_timeout)) ++ ldap3.set_config_parameter("POOLING_LOOP_TIMEOUT", pooling_loop_timeout) + + def checkPass(self, uid, password): + """