14
0

Accepting request 825834 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/825834
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-mitmproxy?expand=0&rev=2
This commit is contained in:
2020-08-12 08:31:41 +00:00
committed by Git OBS Bridge
6 changed files with 180 additions and 17 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:555bbe9612e01d41858fbbe9f5d841b65bef3ac989ec26bb5c4c3d12a19dd57c
size 27223155

3
mitmproxy-5.2.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:976974cb89affd7971cf04566c60c0ef64a0830cce8ea9ae6c2869755c310b87
size 27251381

View File

@@ -1,3 +1,57 @@
-------------------------------------------------------------------
Tue Aug 11 10:05:06 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Update to v5.2
* Add Filter message to mitmdump (@sarthak212)
* Display TCP flows at flow list (@Jessonsotoventura,
@nikitastupin, @mhils)
* Colorize JSON Contentview (@sarthak212)
* Fix console crash when entering regex escape character in
half-open string (@sarthak212)
* Integrate contentviews to TCP flow details (@nikitastupin)
* Added add-ons that enhance the performance of web application
scanners (@anneborcherding)
* Increase WebSocket message timestamp precision
(@JustAnotherArchivist)
* Fix HTTP reason value on HTTP/2 reponses (@rbdixon)
* mitmweb: support wslview to open a web browser (@G-Rath)
* Fix dev version detection with parent git repo
(@JustAnotherArchivist)
* Restructure examples and supported addons (@mhils)
* Certificate generation: mark SAN as critical if no CN is set
(@mhils)
* Simplify Replacements with new ModifyBody addon (@mplattner)
* Rename SetHeaders addon to ModifyHeaders (@mplattner)
* mitmweb: "New -> File" menu option has been renamed to
"Clear All" (@yogeshojha)
* Add new MapRemote addon to rewrite URLs of requests
(@mplattner)
* Add support for HTTP Trailers to the HTTP/2 protocol
(@sanlengjingvv and @Kriechi)
* Fix certificate runtime error during expire cleanup
(@gorogoroumaru)
* Fixed the DNS Rebind Protection for secure support of IPv6
addresses (@tunnelpr0)
* WebSockets: match the HTTP-WebSocket flow for the ~websocket
filter (@Kriechi)
* Fix deadlock caused by the "replay.client.stop" command
(@gorogoroumaru)
* Add new MapLocal addon to serve local files instead of remote
resources (@mplattner and @mhils)
* Add minimal TCP interception and modification (@nikitastupin)
* Add new CheckSSLPinning addon to check SSL-Pinning on client
(@su-vikas)
* Add a JSON dump script: write data into a file or send to an
endpoint as JSON (@emedvedev)
* Fix console output formatting (@sarthak212)
* Add example for proxy authentication using selenium
(@anneborcherding and @weichweich)
- refresh unpin.patch
- replace unmaintained asynctest by native python 3.8 unittest
calls
* replace-asynctest.patch
* gh#mitmproxy/mitmproxy#4020
-------------------------------------------------------------------
Mon Jun 15 10:39:50 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>

View File

@@ -19,18 +19,25 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-mitmproxy
Version: 5.1.1
Version: 5.2
Release: 0
Summary: An interactive, SSL/TLS-capable intercepting proxy for HTTP/1, HTTP/2, and WebSockets
Summary: An interactive, SSL/TLS-capable intercepting proxy
License: MIT
Group: Development/Languages/Python
URL: https://mitmproxy.org
Source: https://github.com/mitmproxy/mitmproxy/archive/v%{version}.tar.gz#/mitmproxy-%{version}.tar.gz
# upstream likes to pin dependencies too aggressively
Patch0: unpin.patch
# PATCH-FIX-UPSTREAM replace-asynctest.patch gh#mitmproxy/mitmproxy#4020
Patch1: replace-asynctest.patch
BuildRequires: %{python_module Brotli >= 1.0}
BuildRequires: %{python_module Flask >= 1.1.1}
BuildRequires: %{python_module Flask >= 1.0}
%if 0%{?suse_version} < 1550
# Python 3.6 only
BuildRequires: %{python_module dataclasses >= 0.7}
# Python < 3.8
BuildRequires: %{python_module asynctest >= 0.12.0}
%endif
BuildRequires: %{python_module beautifulsoup4 >= 4.4.1}
BuildRequires: %{python_module blinker >= 1.4}
BuildRequires: %{python_module certifi >= 2019.9.11}
@@ -51,6 +58,7 @@ BuildRequires: %{python_module pyparsing >= 2.4.2}
BuildRequires: %{python_module pyperclip >= 1.6.0}
BuildRequires: %{python_module pytest >= 5.1.3}
BuildRequires: %{python_module pytest-asyncio >= 0.10.0}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module requests >= 2.9.1}
BuildRequires: %{python_module ruamel.yaml >= 0.16}
BuildRequires: %{python_module setuptools}
@@ -84,6 +92,10 @@ Requires: python-tornado >= 4.3
Requires: python-urwid >= 2.1.0
Requires: python-wsproto >= 0.14
Requires: python-zstandard >= 0.11
%if 0%{?python3_version_nodots} < 37
# Python 3.6 only
Requires: python3-dataclasses >= 0.7
%endif
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: python-beautifulsoup4 >= 4.4.1
@@ -107,6 +119,12 @@ that creatively violate the standards.
%prep
%setup -q -n mitmproxy-%{version}
%patch0 -p1
%if 0%{?suse_version} >= 1550
%patch1 -p1
%endif
#remove shebang
sed -i '1 {\@^#!/usr/bin/env@ d}' mitmproxy/contrib/wbxml/*.py
rm mitmproxy/contrib/kaitaistruct/make.sh
%build
%python_build
@@ -123,7 +141,8 @@ that creatively violate the standards.
%check
# test_refresh fails on i586... wrong timestamp type, maybe?
# test_rollback and test_output[None-expected_out0-expected_err0] just randomly fail on i586
%pytest -k "not (test_refresh or test_rollback or test_output)"
# test_get_version fails to mock updated git version
%pytest -k "not (test_refresh or test_rollback or test_output or test_get_version)"
%post
%python_install_alternative mitmdump

71
replace-asynctest.patch Normal file
View File

@@ -0,0 +1,71 @@
Index: mitmproxy-5.2/test/mitmproxy/addons/test_readfile.py
===================================================================
--- mitmproxy-5.2.orig/test/mitmproxy/addons/test_readfile.py
+++ mitmproxy-5.2/test/mitmproxy/addons/test_readfile.py
@@ -1,8 +1,9 @@
import asyncio
import io
+from unittest.mock import patch
import pytest
-import asynctest
+
import mitmproxy.io
from mitmproxy import exceptions
@@ -54,17 +55,17 @@ class TestReadFile:
tf = tmpdir.join("tfile")
- with asynctest.patch('mitmproxy.master.Master.load_flow') as mck:
+ with patch('mitmproxy.master.Master.load_flow') as mck:
tf.write(data.getvalue())
tctx.configure(
rf,
rfile = str(tf),
readfile_filter = ".*"
)
- assert not mck.awaited
+ mck.assert_not_awaited()
rf.running()
await asyncio.sleep(0)
- assert mck.awaited
+ mck.assert_awaited()
tf.write(corrupt_data.getvalue())
tctx.configure(rf, rfile=str(tf))
@@ -93,16 +94,16 @@ class TestReadFile:
class TestReadFileStdin:
- @asynctest.patch('sys.stdin')
+ @patch('sys.stdin')
@pytest.mark.asyncio
async def test_stdin(self, stdin, data, corrupt_data):
rf = readfile.ReadFileStdin()
with taddons.context(rf):
- with asynctest.patch('mitmproxy.master.Master.load_flow') as mck:
+ with patch('mitmproxy.master.Master.load_flow') as mck:
stdin.buffer = data
- assert not mck.awaited
+ mck.assert_not_awaited()
await rf.load_flows(stdin.buffer)
- assert mck.awaited
+ mck.assert_awaited()
stdin.buffer = corrupt_data
with pytest.raises(exceptions.FlowReadException):
@@ -113,10 +114,10 @@ class TestReadFileStdin:
rf = readfile.ReadFileStdin()
with taddons.context(rf) as tctx:
tf = tmpdir.join("tfile")
- with asynctest.patch('mitmproxy.master.Master.load_flow') as mck:
+ with patch('mitmproxy.master.Master.load_flow') as mck:
tf.write(data.getvalue())
tctx.configure(rf, rfile=str(tf))
- assert not mck.awaited
+ mck.assert_not_awaited()
rf.running()
await asyncio.sleep(0)
- assert mck.awaited
+ mck.assert_awaited()

View File

@@ -1,8 +1,8 @@
Index: mitmproxy-5.1.1/setup.py
Index: mitmproxy-5.2/setup.py
===================================================================
--- mitmproxy-5.1.1.orig/setup.py
+++ mitmproxy-5.1.1/setup.py
@@ -62,29 +62,29 @@ setup(
--- mitmproxy-5.2.orig/setup.py
+++ mitmproxy-5.2/setup.py
@@ -62,46 +62,46 @@ setup(
# https://packaging.python.org/en/latest/requirements/#install-requires
# It is not considered best practice to use install_requires to pin dependencies to specific versions.
install_requires=[
@@ -27,7 +27,7 @@ Index: mitmproxy-5.1.1/setup.py
- "ruamel.yaml>=0.16,<0.17",
- "sortedcontainers>=2.1.0,<2.2",
- "tornado>=4.3,<7",
- "urwid>=2.1.0,<2.2",
- "urwid==2.0.1,!=2.1.0",
- "wsproto>=0.14,<0.16",
- "publicsuffix2>=2.20190812,<3",
- "zstandard>=0.11,<0.14",
@@ -54,12 +54,31 @@ Index: mitmproxy-5.1.1/setup.py
],
extras_require={
':sys_platform == "win32"': [
@@ -104,7 +104,7 @@ setup(
"tox>=3.5,<3.15",
- "pydivert>=2.0.3,<2.2",
+ "pydivert>=2.0.3",
],
'examples': [
- "beautifulsoup4>=4.4.1,<4.9"
+ "beautifulsoup4>=4.4.1"
'dev': [
"asynctest>=0.12.0",
- "Flask>=1.0,<1.2",
- "hypothesis>=5.8,<5.9",
- "parver>=0.1,<2.0",
- "pytest-asyncio>=0.10.0,<0.11",
- "pytest-cov>=2.7.1,<3",
- "pytest-timeout>=1.3.3,<2",
- "pytest-xdist>=1.29,<2",
- "pytest>=5.1.3,<6",
- "requests>=2.9.1,<3",
- "tox>=3.5,<3.15",
+ "Flask>=1.0",
+ "hypothesis>=5.8",
+ "parver>=0.1",
+ "pytest-asyncio>=0.10.0",
+ "pytest-cov>=2.7.1",
+ "pytest-timeout>=1.3.3",
+ "pytest-xdist>=1.29",
+ "pytest>=5.1.3",
+ "requests>=2.9.1",
+ "tox>=3.5",
]
}
)