1{ lib
2, stdenv
3, buildPythonPackage
4, click
5, colorama
6, cryptography
7, exrex
8, fetchFromGitHub
9, poetry-core
10, pyopenssl
11, pyperclip
12, pytest-mock
13, pytestCheckHook
14, pythonOlder
15, questionary
16, requests
17, requests-mock
18}:
19
20buildPythonPackage rec {
21 pname = "myjwt";
22 version = "1.6.1";
23 format = "pyproject";
24
25 disabled = pythonOlder "3.8";
26
27 src = fetchFromGitHub {
28 owner = "mBouamama";
29 repo = "MyJWT";
30 rev = "refs/tags/${version}";
31 hash = "sha256-qdDA8DpJ9kAPTvCkQcPBHNlUqxwsS0vAESglvUygXhg=";
32 };
33
34 postPatch = ''
35 substituteInPlace pyproject.toml \
36 --replace "1.6.0" "${version}" \
37 --replace 'cryptography = "^39.0.2"' 'cryptography = "^39.0.0"'
38 '';
39
40 nativeBuildInputs = [
41 poetry-core
42 ];
43
44 propagatedBuildInputs = [
45 click
46 colorama
47 cryptography
48 exrex
49 pyopenssl
50 pyperclip
51 questionary
52 requests
53 ];
54
55 nativeCheckInputs = [
56 pytest-mock
57 pytestCheckHook
58 requests-mock
59 ];
60
61 pythonImportsCheck = [
62 "myjwt"
63 ];
64
65 meta = with lib; {
66 description = "CLI tool for testing vulnerabilities of JSON Web Tokens (JWT)";
67 homepage = "https://github.com/mBouamama/MyJWT";
68 changelog = "https://github.com/tyki6/MyJWT/releases/tag/${version}";
69 license = with licenses; [ mit ];
70 maintainers = with maintainers; [ fab ];
71 # Build failures
72 broken = stdenv.isDarwin;
73 };
74}