2021-06-20 21:12:11 +00:00
|
|
|
{ lib, fetchFromGitHub, cacert, openssl, nixosTests
|
2023-02-06 19:28:26 +00:00
|
|
|
, python310, fetchpatch
|
2020-04-21 11:35:41 +00:00
|
|
|
}:
|
|
|
|
|
2021-06-20 21:12:11 +00:00
|
|
|
let
|
2023-02-06 19:28:26 +00:00
|
|
|
dropDevOutput = { outputs, ... }: {
|
|
|
|
outputs = lib.filter (x: x != "doc") outputs;
|
|
|
|
};
|
|
|
|
|
|
|
|
python3' = python310.override {
|
2021-06-20 21:12:11 +00:00
|
|
|
packageOverrides = self: super: {
|
|
|
|
sqlalchemy = super.sqlalchemy.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "1.3.24";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
2022-05-03 05:19:38 +00:00
|
|
|
hash = "sha256-67t3fL+TEjWbiXv4G6ANrg9ctp+6KhgmXcwYpvXvdRk=";
|
2021-06-20 21:12:11 +00:00
|
|
|
};
|
2022-04-01 12:32:43 +00:00
|
|
|
doCheck = false;
|
|
|
|
});
|
|
|
|
# fails with `no tests ran in 1.75s`
|
|
|
|
alembic = super.alembic.overridePythonAttrs (lib.const {
|
|
|
|
doCheck = false;
|
2021-06-20 21:12:11 +00:00
|
|
|
});
|
2021-07-22 12:09:33 +00:00
|
|
|
flask_migrate = super.flask_migrate.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "2.7.0";
|
2022-06-06 17:30:09 +00:00
|
|
|
src = self.fetchPypi {
|
2021-09-18 12:26:01 +00:00
|
|
|
pname = "Flask-Migrate";
|
2021-07-22 12:09:33 +00:00
|
|
|
inherit version;
|
|
|
|
sha256 = "ae2f05671588762dd83a21d8b18c51fe355e86783e24594995ff8d7380dffe38";
|
|
|
|
};
|
|
|
|
});
|
2023-02-06 19:28:26 +00:00
|
|
|
flask-sqlalchemy = super.flask-sqlalchemy.overridePythonAttrs (old: rec {
|
|
|
|
version = "2.5.1";
|
|
|
|
format = "setuptools";
|
|
|
|
src = self.fetchPypi {
|
|
|
|
pname = "Flask-SQLAlchemy";
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256:2bda44b43e7cacb15d4e05ff3cc1f8bc97936cc464623424102bfc2c35e95912";
|
|
|
|
};
|
|
|
|
});
|
2022-04-01 12:32:43 +00:00
|
|
|
# Taken from by https://github.com/NixOS/nixpkgs/pull/173090/commits/d2c0c7eb4cc91beb0a1adbaf13abc0a526a21708
|
|
|
|
werkzeug = super.werkzeug.overridePythonAttrs (old: rec {
|
|
|
|
version = "1.0.1";
|
|
|
|
src = old.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "6c80b1e5ad3665290ea39320b91e1be1e0d5f60652b964a3070216de83d2e47c";
|
|
|
|
};
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = old.nativeCheckInputs ++ (with self; [
|
2022-04-01 12:32:43 +00:00
|
|
|
requests
|
|
|
|
]);
|
2022-09-17 23:34:26 +00:00
|
|
|
doCheck = false;
|
2021-11-26 15:22:30 +00:00
|
|
|
});
|
2022-04-01 12:32:43 +00:00
|
|
|
# Required by flask-1.1
|
|
|
|
jinja2 = super.jinja2.overridePythonAttrs (old: rec {
|
|
|
|
version = "2.11.3";
|
|
|
|
src = old.src.override {
|
2021-12-10 02:47:28 +00:00
|
|
|
inherit version;
|
2022-04-01 12:32:43 +00:00
|
|
|
sha256 = "sha256-ptWEM94K6AA0fKsfowQ867q+i6qdKeZo8cdoy4ejM8Y=";
|
2021-12-10 02:47:28 +00:00
|
|
|
};
|
2023-02-06 19:28:26 +00:00
|
|
|
patches = [
|
|
|
|
# python 3.10 compat fixes. In later upstream releases, but these
|
|
|
|
# are not compatible with flask 1 which we need here :(
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/thmo/jinja/commit/1efb4cc918b4f3d097c376596da101de9f76585a.patch";
|
|
|
|
sha256 = "sha256-GFaSvYxgzOEFmnnDIfcf0ImScNTh1lR4lxt2Uz1DYdU=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/mkrizek/jinja/commit/bd8bad37d1c0e2d8995a44fd88e234f5340afec5.patch";
|
|
|
|
sha256 = "sha256-Uow+gaO+/dH6zavC0X/SsuMAfhTLRWpamVlL87DXDRA=";
|
|
|
|
excludes = [ "CHANGES.rst" ];
|
|
|
|
})
|
|
|
|
];
|
2022-04-01 12:32:43 +00:00
|
|
|
});
|
|
|
|
# Required by jinja2-2.11.3
|
|
|
|
markupsafe = super.markupsafe.overridePythonAttrs (old: rec {
|
|
|
|
version = "2.0.1";
|
|
|
|
src = old.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "sha256-WUxngH+xYjizDES99082wCzfItHIzake+KDtjav1Ygo=";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
itsdangerous = super.itsdangerous.overridePythonAttrs (old: rec {
|
2022-06-06 18:10:32 +00:00
|
|
|
version = "1.1.0";
|
|
|
|
src = old.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
flask = super.flask.overridePythonAttrs (old: rec {
|
|
|
|
version = "1.1.4";
|
2022-04-01 12:32:43 +00:00
|
|
|
src = old.src.override {
|
|
|
|
inherit version;
|
2022-06-06 18:10:32 +00:00
|
|
|
sha256 = "0fbeb6180d383a9186d0d6ed954e0042ad9f18e0e8de088b2b419d526927d196";
|
2022-04-01 12:32:43 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
sqlsoup = super.sqlsoup.overrideAttrs ({ meta ? {}, ... }: {
|
|
|
|
meta = meta // { broken = false; };
|
2021-12-10 02:47:28 +00:00
|
|
|
});
|
2022-06-06 18:10:32 +00:00
|
|
|
click = super.click.overridePythonAttrs (old: rec {
|
|
|
|
version = "7.1.2";
|
|
|
|
src = old.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a";
|
|
|
|
};
|
|
|
|
});
|
2022-09-17 23:34:26 +00:00
|
|
|
# Now requires `lingua` as check input that requires a newer `click`,
|
|
|
|
# however `click-7` is needed by the older flask we need here. Since it's just
|
|
|
|
# for the test-suite apparently, let's skip it for now.
|
2023-02-19 17:28:43 +00:00
|
|
|
mako = super.mako.overridePythonAttrs (lib.const {
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [];
|
2022-09-17 23:34:26 +00:00
|
|
|
doCheck = false;
|
|
|
|
});
|
2022-12-29 21:26:35 +00:00
|
|
|
# Requires pytest-httpserver as checkInput now which requires Werkzeug>=2 which is not
|
|
|
|
# supported by current privacyIDEA.
|
|
|
|
responses = super.responses.overridePythonAttrs (lib.const {
|
|
|
|
doCheck = false;
|
|
|
|
});
|
2023-02-06 19:28:26 +00:00
|
|
|
flask-babel = (super.flask-babel.override {
|
|
|
|
sphinxHook = null;
|
|
|
|
furo = null;
|
|
|
|
}).overridePythonAttrs (old: (dropDevOutput old) // rec {
|
|
|
|
pname = "Flask-Babel";
|
|
|
|
version = "2.0.0";
|
|
|
|
format = "setuptools";
|
|
|
|
src = self.fetchPypi {
|
|
|
|
inherit pname;
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256:f9faf45cdb2e1a32ea2ec14403587d4295108f35017a7821a2b1acb8cfd9257d";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
psycopg2 = (super.psycopg2.override {
|
|
|
|
sphinxHook = null;
|
|
|
|
sphinx-better-theme = null;
|
|
|
|
}).overridePythonAttrs dropDevOutput;
|
|
|
|
hypothesis = super.hypothesis.override {
|
|
|
|
enableDocumentation = false;
|
|
|
|
};
|
|
|
|
pyjwt = (super.pyjwt.override {
|
|
|
|
sphinxHook = null;
|
|
|
|
sphinx-rtd-theme = null;
|
|
|
|
}).overridePythonAttrs (old: (dropDevOutput old) // { format = "setuptools"; });
|
|
|
|
beautifulsoup4 = (super.beautifulsoup4.override {
|
|
|
|
sphinxHook = null;
|
|
|
|
}).overridePythonAttrs dropDevOutput;
|
|
|
|
pydash = (super.pydash.override {
|
|
|
|
sphinx-rtd-theme = null;
|
|
|
|
}).overridePythonAttrs (old: rec {
|
|
|
|
version = "5.1.0";
|
|
|
|
src = self.fetchPypi {
|
|
|
|
inherit (old) pname;
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-GysFCsG64EnNB/WSCxT6u+UmOPSF2a2h6xFanuv/aDU=";
|
|
|
|
};
|
|
|
|
format = "setuptools";
|
|
|
|
doCheck = false;
|
|
|
|
});
|
2021-06-20 21:12:11 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
python3'.pkgs.buildPythonPackage rec {
|
2020-04-21 11:35:41 +00:00
|
|
|
pname = "privacyIDEA";
|
2023-02-07 13:07:40 +00:00
|
|
|
version = "3.8.1";
|
2020-04-21 11:35:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-02-07 13:07:40 +00:00
|
|
|
sha256 = "sha256-SYXw8PBCb514v3rcy15W/vZS5JyMsu81D2sJmviLRtw=";
|
2021-03-19 20:11:49 +00:00
|
|
|
fetchSubmodules = true;
|
2020-04-21 11:35:41 +00:00
|
|
|
};
|
|
|
|
|
2021-06-20 21:12:11 +00:00
|
|
|
propagatedBuildInputs = with python3'.pkgs; [
|
2020-04-21 11:35:41 +00:00
|
|
|
cryptography pyrad pymysql python-dateutil flask-versioned flask_script
|
2021-12-10 02:47:28 +00:00
|
|
|
defusedxml croniter flask_migrate pyjwt configobj sqlsoup pillow
|
2020-04-21 11:35:41 +00:00
|
|
|
python-gnupg passlib pyopenssl beautifulsoup4 smpplib flask-babel
|
|
|
|
ldap3 huey pyyaml qrcode oauth2client requests lxml cbor2 psycopg2
|
2022-12-29 21:26:35 +00:00
|
|
|
pydash ecdsa google-auth importlib-metadata argon2-cffi bcrypt segno
|
2022-10-06 09:59:35 +00:00
|
|
|
];
|
|
|
|
|
2021-03-19 20:11:49 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) privacyidea; };
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = with python3'.pkgs; [ openssl mock pytestCheckHook responses testfixtures ];
|
2022-09-17 23:34:26 +00:00
|
|
|
preCheck = "export HOME=$(mktemp -d)";
|
|
|
|
postCheck = "unset HOME";
|
2021-03-19 20:11:49 +00:00
|
|
|
disabledTests = [
|
2022-09-17 23:34:26 +00:00
|
|
|
# expects `/home/` to exist, fails with `FileNotFoundError: [Errno 2] No such file or directory: '/home/'`.
|
2021-03-19 20:11:49 +00:00
|
|
|
"test_01_loading_scripts"
|
2022-09-17 23:34:26 +00:00
|
|
|
|
|
|
|
# Tries to connect to `fcm.googleapis.com`.
|
2021-04-02 09:09:55 +00:00
|
|
|
"test_02_api_push_poll"
|
2022-12-29 21:26:35 +00:00
|
|
|
"test_04_decline_auth_request"
|
2022-09-17 23:34:26 +00:00
|
|
|
|
|
|
|
# Timezone info not available in build sandbox
|
2021-03-19 20:11:49 +00:00
|
|
|
"test_14_convert_timestamp_to_utc"
|
2022-09-17 23:34:26 +00:00
|
|
|
|
|
|
|
# Fails because of different logger configurations
|
|
|
|
"test_01_create_default_app"
|
|
|
|
"test_03_logging_config_file"
|
|
|
|
"test_04_logging_config_yaml"
|
|
|
|
"test_05_logging_config_broken_yaml"
|
2021-03-19 20:11:49 +00:00
|
|
|
];
|
2020-04-21 11:35:41 +00:00
|
|
|
|
2020-05-08 12:09:10 +00:00
|
|
|
pythonImportsCheck = [ "privacyidea" ];
|
|
|
|
|
2020-04-21 11:35:41 +00:00
|
|
|
postPatch = ''
|
2022-09-17 23:34:26 +00:00
|
|
|
patchShebangs tests/testdata/scripts
|
2020-04-21 11:35:41 +00:00
|
|
|
substituteInPlace privacyidea/lib/resolvers/LDAPIdResolver.py --replace \
|
|
|
|
"/etc/privacyidea/ldap-ca.crt" \
|
|
|
|
"${cacert}/etc/ssl/certs/ca-bundle.crt"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2021-06-20 21:12:11 +00:00
|
|
|
rm -r $out/${python3'.sitePackages}/tests
|
2020-04-21 11:35:41 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Multi factor authentication system (2FA, MFA, OTP Server)";
|
|
|
|
license = licenses.agpl3Plus;
|
|
|
|
homepage = "http://www.privacyidea.org";
|
2021-03-19 20:11:49 +00:00
|
|
|
maintainers = with maintainers; [ globin ma27 ];
|
2020-04-21 11:35:41 +00:00
|
|
|
};
|
|
|
|
}
|