git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #127599 from Ma27/bump-privacyidea
commitbb8c2116dd2d03775c96e0695bfbace7074308b4 authorSandro <sandro.jaeckel@gmail.com> dateTue 22 Jun 2021, 18:26 (5 years ago) parentc601d565aad4e7
6 files changed+27−54
nixos/modules/services/security/privacyidea.nix+2−2 pkgs/development/python-modules/privacyidea/default.nix → pkgs/applications/misc/privacyidea/default.nix+22−22 pkgs/development/python-modules/privacyidea/fix-tests.patch−28 pkgs/top-level/all-packages.nix+2 pkgs/top-level/python-aliases.nix+1 pkgs/top-level/python-packages.nix−2
nixos/modules/services/security/privacyidea.nix+2−2
@@ -7,7 +7,7 @@ let
77
88 uwsgi = pkgs.uwsgi.override { plugins = [ "python3" ]; };
99 python = uwsgi.python3;
10− penv = python.withPackages (ps: [ ps.privacyidea ]);
10+ penv = python.withPackages (const [ pkgs.privacyidea ]);
1111 logCfg = pkgs.writeText "privacyidea-log.cfg" ''
1212 [formatters]
1313 keys=detail
@@ -194,7 +194,7 @@ in
194194
195195 (mkIf cfg.enable {
196196
197− environment.systemPackages = [ python.pkgs.privacyidea ];
197+ environment.systemPackages = [ pkgs.privacyidea ];
198198
199199 services.postgresql.enable = mkDefault true;
200200
pkgs/development/python-modules/privacyidea/default.nix → pkgs/applications/misc/privacyidea/default.nixrenamed+22−22
@@ -1,43 +1,43 @@
1−{ lib, buildPythonPackage, fetchFromGitHub, cacert, openssl, python, nixosTests
2−
3−, cryptography, pyrad, pymysql, python-dateutil, flask-versioned, flask_script
4−, defusedxml, croniter, flask_migrate, pyjwt1, configobj, sqlsoup, pillow
5−, python-gnupg, passlib, pyopenssl, beautifulsoup4, smpplib, flask-babel
6−, ldap3, huey, pyyaml, qrcode, oauth2client, requests, lxml, cbor2, psycopg2
7−, pydash, ecdsa
8−
9−, mock, pytestCheckHook, responses, testfixtures
1+{ lib, fetchFromGitHub, cacert, openssl, nixosTests
2+, python3
103}:
114
12−buildPythonPackage rec {
5+let
6+ python3' = python3.override {
7+ packageOverrides = self: super: {
8+ sqlalchemy = super.sqlalchemy.overridePythonAttrs (oldAttrs: rec {
9+ version = "1.3.24";
10+ src = oldAttrs.src.override {
11+ inherit version;
12+ sha256 = "ebbb777cbf9312359b897bf81ba00dae0f5cb69fba2a18265dcc18a6f5ef7519";
13+ };
14+ });
15+ };
16+ };
17+in
18+python3'.pkgs.buildPythonPackage rec {
1319 pname = "privacyIDEA";
14− version = "3.5.2";
20+ version = "3.6";
1521
1622 src = fetchFromGitHub {
1723 owner = pname;
1824 repo = pname;
1925 rev = "v${version}";
20− sha256 = "sha256-k2om2LjkFRCT53ECPAJEztCiMdz4fF5eoipVUvSoyGo=";
26+ sha256 = "sha256-yywkQ3TdBzRMbJGY0Seaprztgt0JrCAbgqosMQ5fcQM=";
2127 fetchSubmodules = true;
2228 };
2329
24− patches = [
25− # Subset of https://github.com/privacyidea/privacyidea/commit/359db6dd10212b8a210e0a83536e92e9e796a1f8,
26− # fixes app context errors in tests. Can be removed on the next bump.
27− ./fix-tests.patch
28− ];
29−
30− propagatedBuildInputs = [
30+ propagatedBuildInputs = with python3'.pkgs; [
3131 cryptography pyrad pymysql python-dateutil flask-versioned flask_script
3232 defusedxml croniter flask_migrate pyjwt1 configobj sqlsoup pillow
3333 python-gnupg passlib pyopenssl beautifulsoup4 smpplib flask-babel
3434 ldap3 huey pyyaml qrcode oauth2client requests lxml cbor2 psycopg2
35− pydash ecdsa
35+ pydash ecdsa google-auth importlib-metadata
3636 ];
3737
3838 passthru.tests = { inherit (nixosTests) privacyidea; };
3939
40− checkInputs = [ openssl mock pytestCheckHook responses testfixtures ];
40+ checkInputs = with python3'.pkgs; [ openssl mock pytestCheckHook responses testfixtures ];
4141 disabledTests = [
4242 "AESHardwareSecurityModuleTestCase"
4343 "test_01_cert_request"
@@ -61,7 +61,7 @@ buildPythonPackage rec {
6161 '';
6262
6363 postInstall = ''
64− rm -rf $out/${python.sitePackages}/tests
64+ rm -r $out/${python3'.sitePackages}/tests
6565 '';
6666
6767 meta = with lib; {
pkgs/development/python-modules/privacyidea/fix-tests.patchdeleted−28
@@ -1,28 +0,0 @@
1−diff --git a/privacyidea/lib/resolvers/LDAPIdResolver.py b/privacyidea/lib/resolvers/LDAPIdResolver.py
2−index ae9d87764..cfc609931 100644
3−--- a/privacyidea/lib/resolvers/LDAPIdResolver.py
4−+++ b/privacyidea/lib/resolvers/LDAPIdResolver.py
5−@@ -97,11 +97,6 @@
6− SERVERPOOL_ROUNDS = 2
7− # The number of seconds a non-responding server is removed from the server pool
8− SERVERPOOL_SKIP = 30
9−-# The number of seconds that ldap3 waits if no server is left in the pool, before
10−-# starting the next round
11−-pooling_loop_timeout = get_app_config_value("PI_LDAP_POOLING_LOOP_TIMEOUT", 10)
12−-log.info("Setting system wide POOLING_LOOP_TIMEOUT to {0!s}.".format(pooling_loop_timeout))
13−-ldap3.set_config_parameter("POOLING_LOOP_TIMEOUT", pooling_loop_timeout)
14−
15− # 1 sec == 10^9 nano secs == 10^7 * (100 nano secs)
16− MS_AD_MULTIPLYER = 10 ** 7
17−@@ -314,6 +309,11 @@ def __init__(self):
18− self.serverpool_rounds = SERVERPOOL_ROUNDS
19− self.serverpool_skip = SERVERPOOL_SKIP
20− self.serverpool = None
21−+ # The number of seconds that ldap3 waits if no server is left in the pool, before
22−+ # starting the next round
23−+ pooling_loop_timeout = get_app_config_value("PI_LDAP_POOLING_LOOP_TIMEOUT", 10)
24−+ log.info("Setting system wide POOLING_LOOP_TIMEOUT to {0!s}.".format(pooling_loop_timeout))
25−+ ldap3.set_config_parameter("POOLING_LOOP_TIMEOUT", pooling_loop_timeout)
26−
27− def checkPass(self, uid, password):
28− """
pkgs/top-level/all-packages.nix+2
@@ -13908,6 +13908,8 @@ in
1390813908
1390913909 premake = premake4;
1391013910
13911+ privacyidea = callPackage ../applications/misc/privacyidea { };
13912+
1391113913 procodile = callPackage ../tools/system/procodile { };
1391213914
1391313915 pry = callPackage ../development/tools/pry { };
pkgs/top-level/python-aliases.nix+1
@@ -43,6 +43,7 @@ mapAliases ({
4343 googleapis_common_protos = googleapis-common-protos; # added 2021-03-19
4444 HAP-python = hap-python; # added 2021-06-01
4545 MechanicalSoup = mechanicalsoup; # added 2021-06-01
46+ privacyidea = throw "renamed to pkgs.privacyidea"; # added 2021-06-20
4647 pylibgen = throw "pylibgen is unmaintained upstreamed, and removed from nixpkgs"; # added 2020-06-20
4748 pymssql = throw "pymssql has been abandoned upstream."; # added 2020-05-04
4849 pytest-pep8 = pytestpep8; # added 2021-01-04
pkgs/top-level/python-packages.nix−2
@@ -5471,8 +5471,6 @@ in {
54715471
54725472 prison = callPackage ../development/python-modules/prison { };
54735473
5474− privacyidea = callPackage ../development/python-modules/privacyidea { };
5475−
54765474 pyjwt1 = callPackage ../development/python-modules/pyjwt/1.nix { };
54775475
54785476 proboscis = callPackage ../development/python-modules/proboscis { };