2021-03-19 20:11:49 +00:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, cacert, openssl, python, nixosTests
|
2020-04-21 11:35:41 +00:00
|
|
|
|
|
|
|
, cryptography, pyrad, pymysql, python-dateutil, flask-versioned, flask_script
|
|
|
|
, defusedxml, croniter, flask_migrate, pyjwt, configobj, sqlsoup, pillow
|
|
|
|
, python-gnupg, passlib, pyopenssl, beautifulsoup4, smpplib, flask-babel
|
|
|
|
, ldap3, huey, pyyaml, qrcode, oauth2client, requests, lxml, cbor2, psycopg2
|
2021-03-19 20:11:49 +00:00
|
|
|
, pydash
|
2020-04-21 11:35:41 +00:00
|
|
|
|
2021-03-19 20:11:49 +00:00
|
|
|
, mock, pytestCheckHook, responses, testfixtures
|
2020-04-21 11:35:41 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "privacyIDEA";
|
2021-04-02 09:09:55 +00:00
|
|
|
version = "3.5.2";
|
2020-04-21 11:35:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-04-02 09:09:55 +00:00
|
|
|
sha256 = "sha256-k2om2LjkFRCT53ECPAJEztCiMdz4fF5eoipVUvSoyGo=";
|
2021-03-19 20:11:49 +00:00
|
|
|
fetchSubmodules = true;
|
2020-04-21 11:35:41 +00:00
|
|
|
};
|
|
|
|
|
2021-04-02 09:09:55 +00:00
|
|
|
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
|
|
|
|
];
|
|
|
|
|
2020-04-21 11:35:41 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
cryptography pyrad pymysql python-dateutil flask-versioned flask_script
|
|
|
|
defusedxml croniter flask_migrate pyjwt configobj sqlsoup pillow
|
|
|
|
python-gnupg passlib pyopenssl beautifulsoup4 smpplib flask-babel
|
|
|
|
ldap3 huey pyyaml qrcode oauth2client requests lxml cbor2 psycopg2
|
2021-03-19 20:11:49 +00:00
|
|
|
pydash
|
2020-04-21 11:35:41 +00:00
|
|
|
];
|
|
|
|
|
2021-03-19 20:11:49 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) privacyidea; };
|
|
|
|
|
|
|
|
checkInputs = [ openssl mock pytestCheckHook responses testfixtures ];
|
|
|
|
disabledTests = [
|
|
|
|
"AESHardwareSecurityModuleTestCase"
|
|
|
|
"test_01_cert_request"
|
|
|
|
"test_01_loading_scripts"
|
2021-04-02 09:09:55 +00:00
|
|
|
"test_02_api_push_poll"
|
2021-03-19 20:11:49 +00:00
|
|
|
"test_02_cert_enrolled"
|
|
|
|
"test_02_enroll_rights"
|
|
|
|
"test_02_get_resolvers"
|
|
|
|
"test_02_success"
|
|
|
|
"test_03_get_identifiers"
|
|
|
|
"test_04_remote_user_auth"
|
|
|
|
"test_14_convert_timestamp_to_utc"
|
|
|
|
];
|
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 = ''
|
|
|
|
substituteInPlace privacyidea/lib/resolvers/LDAPIdResolver.py --replace \
|
|
|
|
"/etc/privacyidea/ldap-ca.crt" \
|
|
|
|
"${cacert}/etc/ssl/certs/ca-bundle.crt"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm -rf $out/${python.sitePackages}/tests
|
|
|
|
'';
|
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|