1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # propagates
7 cryptography,
8 six,
9
10 # optional
11 webob,
12
13 # tests
14 pytestCheckHook,
15}:
16
17buildPythonPackage rec {
18 pname = "python-u2flib-server";
19 version = "5.0.1";
20 format = "setuptools";
21
22 src = fetchFromGitHub {
23 owner = "Yubico";
24 repo = "python-u2flib-server";
25 rev = version;
26 hash = "sha256-ginP9u+aHcdaWpwcFYJWu0Ghf7+nDZq9i3TVAacIPhg=";
27 };
28
29 patches = [ ./cryptography-37-compat.patch ];
30
31 propagatedBuildInputs = [
32 cryptography
33 six
34 ];
35
36 optional-dependencies = {
37 u2f_server = [ webob ];
38 };
39
40 pythonImportsCheck = [
41 "u2flib_server"
42 "u2flib_server.u2f"
43 ];
44
45 nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.u2f_server;
46
47 meta = with lib; {
48 description = "Python based U2F server library";
49 homepage = "https://github.com/Yubico/python-u2flib-server";
50 changelog = "https://github.com/Yubico/python-u2flib-server/blob/${src.rev}/NEWS";
51 license = licenses.bsd2;
52 maintainers = with maintainers; [ hexa ];
53 };
54}