Merge pull request #85458 from rnhmjoj/mitmproxy

mitmproxy: 4.0.4 -> 5.1.1

authored by

Michele Guerini Rocco and committed by
GitHub
d4d6d265 257aff80

+39 -70
+26
pkgs/development/python-modules/publicsuffix2/default.nix
··· 1 + { stdenv, buildPythonPackage, fetchFromGitHub, requests }: 2 + 3 + buildPythonPackage rec { 4 + pname = "publicsuffix2"; 5 + version = "2.20191221"; 6 + 7 + # Tests are missing in the sdist 8 + # See: https://github.com/nexB/python-publicsuffix2/issues/12 9 + src = fetchFromGitHub { 10 + owner = "nexB"; 11 + repo = "python-publicsuffix2"; 12 + rev = "release-2.2019-12-21"; 13 + sha256 = "1dkvfvl0izq9hqzilnw8ipkbgjs9xyad9p21i3864hzinbh0wp9r"; 14 + }; 15 + 16 + nativeBuildInputs = [ requests ]; 17 + 18 + meta = with stdenv.lib; { 19 + description = '' 20 + Get a public suffix for a domain name using the Public Suffix 21 + List. Forked from and using the same API as the publicsuffix package. 22 + ''; 23 + homepage = "https://pypi.python.org/pypi/publicsuffix2/"; 24 + license = licenses.mpl20; 25 + }; 26 + }
+11 -39
pkgs/tools/networking/mitmproxy/default.nix
··· 4 4 5 5 buildPythonPackage rec { 6 6 pname = "mitmproxy"; 7 - version = "4.0.4"; 7 + version = "5.1.1"; 8 8 9 9 src = fetchFromGitHub { 10 10 owner = pname; 11 11 repo = pname; 12 12 rev = "v${version}"; 13 - sha256 = "14i9dkafvyl15rq2qa8xldscn5lmkk2g52kbi2hl63nzx9yibx6r"; 13 + sha256 = "1lirlckpvd3c6s6q3p32w4k4yfna5mlgr1x9g39lhzzq0sdiz3lk"; 14 14 }; 15 15 16 - patches = [ 17 - (fetchpatch { 18 - # Tests failed due to expired test certificates, 19 - # https://github.com/mitmproxy/mitmproxy/issues/3316 20 - # TODO: remove on next update 21 - name = "test-certificates.patch"; 22 - url = "https://github.com/mitmproxy/mitmproxy/commit/1b6a8d6acd3d70f9b9627ad4ae9def08103f8250.patch"; 23 - sha256 = "03y79c25yir7d8xj79czdc81y3irqq1i3ks9ca0mv1az8b7xsvfv"; 24 - }) 25 - (fetchpatch { 26 - # 0.13 <= wsproto < 0.14 patch 27 - # https://github.com/mitmproxy/mitmproxy/issues/3459 28 - # TODO: remove on next update 29 - name = "wsproto-0.13.patch"; 30 - url = "https://github.com/mitmproxy/mitmproxy/commit/70777a1b6ed64af9cafcdef223a8a260ecc96864.patch"; 31 - sha256 = "1ddxdr7js510kzyq3gyks4k5k1n8zb1i9amxw7wzmi1dcg8kqw9a"; 32 - # We strip these bounds anyway 33 - excludes = [ "setup.py" ]; 34 - }) 35 - (fetchpatch { 36 - # Fix for newer pytest disallowing calling fixtures 37 - # https://github.com/mitmproxy/mitmproxy/issues/3403 38 - # TODO: remove on next update 39 - name = "dont-call-fixtures.patch"; 40 - url = "https://github.com/mitmproxy/mitmproxy/commit/ce28721458c8cc71de86513a5110676e9763041b.patch"; 41 - sha256 = "05pljr28lx7l1xgswqr9sz8dnhvc7npzh8xg2p9hignf159kd54d"; 42 - # Irrelevant in nixpkgs 43 - excludes = [ "setup.py" "setup.cfg" "release/docker/*" ]; 44 - }) 45 - ./pytest5.patch 46 - ]; 47 - 48 16 postPatch = '' 49 17 # remove dependency constraints 50 18 sed 's/>=\([0-9]\.\?\)\+\( \?, \?<\([0-9]\.\?\)\+\)\?//' -i setup.py ··· 61 29 ''; 62 30 63 31 propagatedBuildInputs = [ 64 - blinker click certifi cryptography 65 - h2 hyperframe kaitaistruct passlib 66 - pyasn1 pyopenssl pyparsing pyperclip 67 - ruamel_yaml tornado urwid brotlipy 68 - sortedcontainers ldap3 wsproto setuptools 32 + blinker brotli certifi cffi 33 + click cryptography flask h11 34 + h2 hpack hyperframe itsdangerous 35 + jinja2 kaitaistruct ldap3 markupsafe 36 + passlib protobuf publicsuffix2 pyasn1 37 + pycparser pyopenssl pyparsing pyperclip 38 + ruamel_yaml setuptools six sortedcontainers 39 + tornado urwid werkzeug wsproto zstandard 69 40 ]; 70 41 71 42 checkInputs = [ 72 43 beautifulsoup4 flask pytest 73 44 requests glibcLocales 74 45 asynctest parver pytest-asyncio 46 + hypothesis 75 47 ]; 76 48 77 49 meta = with stdenv.lib; {
-31
pkgs/tools/networking/mitmproxy/pytest5.patch
··· 1 - diff --git a/test/mitmproxy/net/test_tls.py b/test/mitmproxy/net/test_tls.py 2 - index 489bf89f..c78472e3 100644 3 - --- a/test/mitmproxy/net/test_tls.py 4 - +++ b/test/mitmproxy/net/test_tls.py 5 - @@ -87,14 +87,16 @@ def test_get_client_hello(): 6 - rfile = io.BufferedReader(io.BytesIO( 7 - FULL_CLIENT_HELLO_NO_EXTENSIONS[:30] 8 - )) 9 - - with pytest.raises(exceptions.TlsProtocolException, message="Unexpected EOF"): 10 - + with pytest.raises(exceptions.TlsProtocolException): 11 - tls.get_client_hello(rfile) 12 - + pytest.fail("Unexpected EOF") 13 - 14 - rfile = io.BufferedReader(io.BytesIO( 15 - b"GET /" 16 - )) 17 - - with pytest.raises(exceptions.TlsProtocolException, message="Expected TLS record"): 18 - + with pytest.raises(exceptions.TlsProtocolException): 19 - tls.get_client_hello(rfile) 20 - + pytest.fail("Expected TLS record") 21 - 22 - 23 - class TestClientHello: 24 - @@ -153,5 +155,6 @@ class TestClientHello: 25 - b"\x01\x00\x00\x03" + # handshake header 26 - b"foo" 27 - )) 28 - - with pytest.raises(exceptions.TlsProtocolException, message='Cannot parse Client Hello'): 29 - + with pytest.raises(exceptions.TlsProtocolException): 30 - tls.ClientHello.from_file(rfile) 31 - + pytest.fail('Cannot parse Client Hello')
+2
pkgs/top-level/python-packages.nix
··· 5038 5038 5039 5039 publicsuffix = callPackage ../development/python-modules/publicsuffix {}; 5040 5040 5041 + publicsuffix2 = callPackage ../development/python-modules/publicsuffix2 {}; 5042 + 5041 5043 py = callPackage ../development/python-modules/py { }; 5042 5044 5043 5045 pyacoustid = callPackage ../development/python-modules/pyacoustid { };