pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/mitmproxy mitmproxy: Update to 5.0.0



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a188e64408a7
branches:  trunk
changeset: 406283:a188e64408a7
user:      leot <leot%pkgsrc.org@localhost>
date:      Tue Dec 17 10:21:51 2019 +0000

description:
mitmproxy: Update to 5.0.0

Changes:
5.0.0
-----
** Major Changes **
  * Added new Table UI (@Jessonsotoventura)
  * Added EKU extension to certificates. This fixes support for macOS Catalina (@vin01)

** Security Fixes **
  * Fixed command injection vulnerabilities when exporting flows as curl/httpie commands (@cript0nauta)
  * Do not echo unsanitized user input in HTTP error responses (@fimad)

** Full Changelog **
  * Moved to Github CI for Continuous Integration, dropping support for old Linux and macOS releases. (#3728)
  * Vastly improved command parsing, in particular for setting flow filters (@typoon)
  * Added a new flow export for raw responses (@mckeimic)
  * URLs are now edited in an external editor (@Jessonsotoventura)
  * mitmproxy now has a command history (@typoon)
  * Added terminal like keyboard shortcuts for the command bar (ctrl+w, ctrl+a, ctrl+f, ...) (@typoon)
  * Fixed issue with improper handling of non-ascii characters in URLs (@rjt-gupta)
  * Filtering can now use unicode characters (@rjt-gupta)
  * Fixed issue with user keybindings not being able to override default keybindings
  * Improved installation instructions
  * Added support for IPV6-only environments (@sethb157)
  * Fixed bug with server replay (@rjt-gupta)
  * Fixed issue with duplicate error responses (@ccssrryy)
  * Users can now set a specific external editor using $MITMPROXY_EDITOR (@rjt-gupta)
  * Config file can now be called `config.yml` or `config.yaml` (@ylmrx)
  * Fixed crash on `view.focus.[next|prev]` (@ylmrx)
  * Updated documentation to help using mitmproxy certificate on Android (@jannst)
  * Added support to parse IPv6 entries from `pfctl` on MacOS. (@tomlabaude)
  * Fixed instructions on how to build the documentation (@jannst)
  * Added a new `--allow-hosts` option (@pierlon)
  * Added support for zstd content-encoding (@tsaaristo)
  * Fixed issue where the replay server would corrupt the Date header (@tonyb486)
  * Improve speed for WebSocket interception (@MathieuBordere)
  * Fixed issue with parsing JPEG files. (@lusceu)
  * Improve example code style (@BoboTiG)
  * Fixed issue converting void responses to HAR (@worldmind)
  * Color coded http status codes in mitmweb (@arun-94)
  * Added organization to generated certificates (@Abcdefghijklmnopqrstuvwxyzxyz)
  * Errors are now displayed on sys.stderr (@JessicaFavin)
  * Fixed issue with replay timestamps (@rjt-gupta)
  * Fixed copying in mitmweb on macOS (@XZzYassin)

diffstat:

 net/mitmproxy/Makefile                                            |   33 +-
 net/mitmproxy/PLIST                                               |   25 +-
 net/mitmproxy/distinfo                                            |   11 +-
 net/mitmproxy/patches/patch-mitmproxy_proxy_protocol_websocket.py |  168 ----------
 4 files changed, 44 insertions(+), 193 deletions(-)

diffs (truncated from 327 to 300 lines):

diff -r e1e0241c23fb -r a188e64408a7 net/mitmproxy/Makefile
--- a/net/mitmproxy/Makefile    Tue Dec 17 10:16:20 2019 +0000
+++ b/net/mitmproxy/Makefile    Tue Dec 17 10:21:51 2019 +0000
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.26 2019/07/21 12:16:28 leot Exp $
+# $NetBSD: Makefile,v 1.27 2019/12/17 10:21:51 leot Exp $
 
-DISTNAME=      mitmproxy-4.0.4
-PKGREVISION=   3
+DISTNAME=      mitmproxy-5.0.0
 CATEGORIES=    net
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=mitmproxy/}
 GITHUB_TAG=    v${PKGVERSION_NOREV}
@@ -11,39 +10,43 @@
 COMMENT=       Interactive console program for inspecting and editing traffic flows
 LICENSE=       mit
 
-DEPENDS+=      ${PYPKGPREFIX}-OpenSSL>=17.5:../../security/py-OpenSSL
+DEPENDS+=      ${PYPKGPREFIX}-OpenSSL>=19.0:../../security/py-OpenSSL
 DEPENDS+=      ${PYPKGPREFIX}-asn1>=0.3.1:../../security/py-asn1
 DEPENDS+=      ${PYPKGPREFIX}-blinker>=1.4:../../devel/py-blinker
-DEPENDS+=      ${PYPKGPREFIX}-brotlipy>=0.7.0:../../archivers/py-brotlipy
-DEPENDS+=      ${PYPKGPREFIX}-certifi>=2015.11.20.1:../../security/py-certifi
-DEPENDS+=      ${PYPKGPREFIX}-click>=6.2:../../devel/py-click
+DEPENDS+=      ${PYPKGPREFIX}-brotli>=1.0:../../archivers/py-brotli
+DEPENDS+=      ${PYPKGPREFIX}-certifi>=2019.9.11:../../security/py-certifi
+DEPENDS+=      ${PYPKGPREFIX}-click>=7.0:../../devel/py-click
 DEPENDS+=      ${PYPKGPREFIX}-cryptography>=2.1.4:../../security/py-cryptography
+DEPENDS+=      ${PYPKGPREFIX}-flask>=1.1.1:../../www/py-flask
 DEPENDS+=      ${PYPKGPREFIX}-h2>=3.0.1:../../www/py-h2
 DEPENDS+=      ${PYPKGPREFIX}-hyperframe>=5.1.0:../../www/py-hyperframe
 DEPENDS+=      ${PYPKGPREFIX}-kaitaistruct>=0.7:../../devel/py-kaitaistruct
-DEPENDS+=      ${PYPKGPREFIX}-ldap3>=2.5:../../databases/py-ldap3
+DEPENDS+=      ${PYPKGPREFIX}-ldap3>=2.6.1:../../databases/py-ldap3
 DEPENDS+=      ${PYPKGPREFIX}-passlib>=1.6.5:../../security/py-passlib
-DEPENDS+=      ${PYPKGPREFIX}-pyparsing>=2.1.3:../../devel/py-pyparsing
+DEPENDS+=      ${PYPKGPREFIX}-protobuf>=3.6.0:../../devel/py-protobuf
+DEPENDS+=      ${PYPKGPREFIX}-publicsuffix2>=2.20190812:../../www/py-publicsuffix2
+DEPENDS+=      ${PYPKGPREFIX}-pyparsing>=2.4.2:../../devel/py-pyparsing
 DEPENDS+=      ${PYPKGPREFIX}-pyperclip>=1.6.0:../../x11/py-pyperclip
-DEPENDS+=      ${PYPKGPREFIX}-ruamel-yaml>=0.13.2:../../devel/py-ruamel-yaml
-DEPENDS+=      ${PYPKGPREFIX}-sortedcontainers>=1.5.4:../../devel/py-sortedcontainers
+DEPENDS+=      ${PYPKGPREFIX}-ruamel-yaml>=0.16:../../devel/py-ruamel-yaml
+DEPENDS+=      ${PYPKGPREFIX}-sortedcontainers>=2.1.0:../../devel/py-sortedcontainers
 DEPENDS+=      ${PYPKGPREFIX}-tornado>=4.3.0:../../www/py-tornado
 DEPENDS+=      ${PYPKGPREFIX}-urwid>=2.0.1:../../devel/py-urwid
-DEPENDS+=      ${PYPKGPREFIX}-wsproto>=0.13.0:../../www/py-wsproto
+DEPENDS+=      ${PYPKGPREFIX}-wsproto>=0.14.0:../../www/py-wsproto
+DEPENDS+=      ${PYPKGPREFIX}-zstandard>=0.11.0:../../archivers/py-zstandard
 
 SUBST_CLASSES+=                        setuppyversions
 SUBST_STAGE.setuppyversions=   pre-configure
 SUBST_MESSAGE.setuppyversions= Avoid too strict version requirements
 SUBST_FILES.setuppyversions=   setup.py
 SUBST_SED.setuppyversions=     -E -e '/>=/ s/, *<[^"]+//g'
+SUBST_SED.setuppyversions+=    -E -e '/==[0-9.]+",/ s/==/>=/g'
 
 REPLACE_SH+=   mitmproxy/contrib/kaitaistruct/make.sh
 
 USE_LANGUAGES=                 # none
-PYTHON_VERSIONS_INCOMPATIBLE=  27 
 
-post-install:
-       ${FIND} ${DESTDIR} -name "*.orig" -type f -exec ${RM} {} \;
+# Only for Python 3.x
+PYTHON_VERSIONS_INCOMPATIBLE=  27
 
 .include "../../lang/python/application.mk"
 .include "../../lang/python/distutils.mk"
diff -r e1e0241c23fb -r a188e64408a7 net/mitmproxy/PLIST
--- a/net/mitmproxy/PLIST       Tue Dec 17 10:16:20 2019 +0000
+++ b/net/mitmproxy/PLIST       Tue Dec 17 10:21:51 2019 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.12 2018/08/09 11:51:41 leot Exp $
+@comment $NetBSD: PLIST,v 1.13 2019/12/17 10:21:51 leot Exp $
 bin/mitmdump
 bin/mitmproxy
 bin/mitmweb
@@ -37,6 +37,9 @@
 ${PYSITELIB}/mitmproxy/addons/clientplayback.py
 ${PYSITELIB}/mitmproxy/addons/clientplayback.pyc
 ${PYSITELIB}/mitmproxy/addons/clientplayback.pyo
+${PYSITELIB}/mitmproxy/addons/command_history.py
+${PYSITELIB}/mitmproxy/addons/command_history.pyc
+${PYSITELIB}/mitmproxy/addons/command_history.pyo
 ${PYSITELIB}/mitmproxy/addons/core.py
 ${PYSITELIB}/mitmproxy/addons/core.pyc
 ${PYSITELIB}/mitmproxy/addons/core.pyo
@@ -67,9 +70,6 @@
 ${PYSITELIB}/mitmproxy/addons/onboardingapp/__init__.py
 ${PYSITELIB}/mitmproxy/addons/onboardingapp/__init__.pyc
 ${PYSITELIB}/mitmproxy/addons/onboardingapp/__init__.pyo
-${PYSITELIB}/mitmproxy/addons/onboardingapp/app.py
-${PYSITELIB}/mitmproxy/addons/onboardingapp/app.pyc
-${PYSITELIB}/mitmproxy/addons/onboardingapp/app.pyo
 ${PYSITELIB}/mitmproxy/addons/onboardingapp/static/bootstrap.min.css
 ${PYSITELIB}/mitmproxy/addons/onboardingapp/static/fontawesome/css/font-awesome.css
 ${PYSITELIB}/mitmproxy/addons/onboardingapp/static/fontawesome/css/font-awesome.min.css
@@ -102,6 +102,9 @@
 ${PYSITELIB}/mitmproxy/addons/serverplayback.py
 ${PYSITELIB}/mitmproxy/addons/serverplayback.pyc
 ${PYSITELIB}/mitmproxy/addons/serverplayback.pyo
+${PYSITELIB}/mitmproxy/addons/session.py
+${PYSITELIB}/mitmproxy/addons/session.pyc
+${PYSITELIB}/mitmproxy/addons/session.pyo
 ${PYSITELIB}/mitmproxy/addons/setheaders.py
 ${PYSITELIB}/mitmproxy/addons/setheaders.pyc
 ${PYSITELIB}/mitmproxy/addons/setheaders.pyo
@@ -135,6 +138,9 @@
 ${PYSITELIB}/mitmproxy/command.py
 ${PYSITELIB}/mitmproxy/command.pyc
 ${PYSITELIB}/mitmproxy/command.pyo
+${PYSITELIB}/mitmproxy/command_lexer.py
+${PYSITELIB}/mitmproxy/command_lexer.pyc
+${PYSITELIB}/mitmproxy/command_lexer.pyo
 ${PYSITELIB}/mitmproxy/connections.py
 ${PYSITELIB}/mitmproxy/connections.pyc
 ${PYSITELIB}/mitmproxy/connections.pyo
@@ -288,9 +294,20 @@
 ${PYSITELIB}/mitmproxy/io/compat.py
 ${PYSITELIB}/mitmproxy/io/compat.pyc
 ${PYSITELIB}/mitmproxy/io/compat.pyo
+${PYSITELIB}/mitmproxy/io/db.py
+${PYSITELIB}/mitmproxy/io/db.pyc
+${PYSITELIB}/mitmproxy/io/db.pyo
 ${PYSITELIB}/mitmproxy/io/io.py
 ${PYSITELIB}/mitmproxy/io/io.pyc
 ${PYSITELIB}/mitmproxy/io/io.pyo
+${PYSITELIB}/mitmproxy/io/proto/http.proto
+${PYSITELIB}/mitmproxy/io/proto/http_pb2.py
+${PYSITELIB}/mitmproxy/io/proto/http_pb2.pyc
+${PYSITELIB}/mitmproxy/io/proto/http_pb2.pyo
+${PYSITELIB}/mitmproxy/io/protobuf.py
+${PYSITELIB}/mitmproxy/io/protobuf.pyc
+${PYSITELIB}/mitmproxy/io/protobuf.pyo
+${PYSITELIB}/mitmproxy/io/sql/session_create.sql
 ${PYSITELIB}/mitmproxy/io/tnetstring.py
 ${PYSITELIB}/mitmproxy/io/tnetstring.pyc
 ${PYSITELIB}/mitmproxy/io/tnetstring.pyo
diff -r e1e0241c23fb -r a188e64408a7 net/mitmproxy/distinfo
--- a/net/mitmproxy/distinfo    Tue Dec 17 10:16:20 2019 +0000
+++ b/net/mitmproxy/distinfo    Tue Dec 17 10:21:51 2019 +0000
@@ -1,7 +1,6 @@
-$NetBSD: distinfo,v 1.17 2019/07/21 12:16:28 leot Exp $
+$NetBSD: distinfo,v 1.18 2019/12/17 10:21:51 leot Exp $
 
-SHA1 (mitmproxy-4.0.4.tar.gz) = 67871cbf7751d34d254ccc733f5e2cd23fbe8faf
-RMD160 (mitmproxy-4.0.4.tar.gz) = d4935a325081544ef0cc9b5551d5eb976ce21777
-SHA512 (mitmproxy-4.0.4.tar.gz) = e08ea8b1c75a95b822c463625509037bbc8a979161cacaa1f0185f98df8d6d7e5400925365dbbe70d18751251b1005824f739a8cd035c0389f7b4aea562adfb3
-Size (mitmproxy-4.0.4.tar.gz) = 27131713 bytes
-SHA1 (patch-mitmproxy_proxy_protocol_websocket.py) = 3a3a67daa4190a150070cf44b007f8b97bee9278
+SHA1 (mitmproxy-5.0.0.tar.gz) = c0fbb073ce31c8615078a7b09e95f1f77b51f537
+RMD160 (mitmproxy-5.0.0.tar.gz) = 2ca43e7a94d7df9f641ab1f6d18d1323587c6ecd
+SHA512 (mitmproxy-5.0.0.tar.gz) = 89de1e40cf7b78e04c575f8db2583c720c47492f6330e6a24819f27b580cd1fc1feb4c1b547de1213361d53ca08b16dae24d7fa9f3faa615fb9917769c1d10cb
+Size (mitmproxy-5.0.0.tar.gz) = 27203802 bytes
diff -r e1e0241c23fb -r a188e64408a7 net/mitmproxy/patches/patch-mitmproxy_proxy_protocol_websocket.py
--- a/net/mitmproxy/patches/patch-mitmproxy_proxy_protocol_websocket.py Tue Dec 17 10:16:20 2019 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-$NetBSD: patch-mitmproxy_proxy_protocol_websocket.py,v 1.2 2019/07/21 12:16:28 leot Exp $
-
-Backport upstream commit 106948d996d74bf5ff7e3511f35eefea0a90561f
-(minus setup.py change) to fix support with py-wsproto 0.13.0.
-
---- mitmproxy/proxy/protocol/websocket.py.orig 2018-07-31 12:01:45.000000000 +0000
-+++ mitmproxy/proxy/protocol/websocket.py
-@@ -4,8 +4,9 @@ from OpenSSL import SSL
- 
- 
- import wsproto
--from wsproto import events
--from wsproto.connection import ConnectionType, WSConnection
-+from wsproto import events, WSConnection
-+from wsproto.connection import ConnectionType
-+from wsproto.events import AcceptConnection, CloseConnection, Message, Ping, Request
- from wsproto.extensions import PerMessageDeflate
- 
- from mitmproxy import exceptions
-@@ -56,47 +57,44 @@ class WebSocketLayer(base.Layer):
-         if 'Sec-WebSocket-Extensions' in handshake_flow.response.headers:
-             if PerMessageDeflate.name in handshake_flow.response.headers['Sec-WebSocket-Extensions']:
-                 extensions = [PerMessageDeflate()]
--        self.connections[self.client_conn] = WSConnection(ConnectionType.SERVER,
--                                                          extensions=extensions)
--        self.connections[self.server_conn] = WSConnection(ConnectionType.CLIENT,
--                                                          host=handshake_flow.request.host,
--                                                          resource=handshake_flow.request.path,
--                                                          extensions=extensions)
-+        self.connections[self.client_conn] = WSConnection(ConnectionType.SERVER)
-+        self.connections[self.server_conn] = WSConnection(ConnectionType.CLIENT)
-+
-         if extensions:
--            for conn in self.connections.values():
--                conn.extensions[0].finalize(conn, handshake_flow.response.headers['Sec-WebSocket-Extensions'])
-+            extensions[0].finalize(handshake_flow.response.headers['Sec-WebSocket-Extensions'])
- 
--        data = self.connections[self.server_conn].bytes_to_send()
--        self.connections[self.client_conn].receive_bytes(data)
-+        request = Request(extensions = extensions, host = handshake_flow.request.host, target = handshake_flow.request.path)
-+        data = self.connections[self.server_conn].send(request)
-+        self.connections[self.client_conn].receive_data(data)
- 
-         event = next(self.connections[self.client_conn].events())
--        assert isinstance(event, events.ConnectionRequested)
-+        assert isinstance(event, events.Request)
- 
--        self.connections[self.client_conn].accept(event)
--        self.connections[self.server_conn].receive_bytes(self.connections[self.client_conn].bytes_to_send())
--        assert isinstance(next(self.connections[self.server_conn].events()), events.ConnectionEstablished)
-+        data = self.connections[self.client_conn].send(AcceptConnection(extensions=extensions))
-+        self.connections[self.server_conn].receive_data(data)
-+        assert isinstance(next(self.connections[self.server_conn].events()), events.AcceptConnection)
- 
-     def _handle_event(self, event, source_conn, other_conn, is_server):
--        if isinstance(event, events.DataReceived):
--            return self._handle_data_received(event, source_conn, other_conn, is_server)
--        elif isinstance(event, events.PingReceived):
--            return self._handle_ping_received(event, source_conn, other_conn, is_server)
--        elif isinstance(event, events.PongReceived):
--            return self._handle_pong_received(event, source_conn, other_conn, is_server)
--        elif isinstance(event, events.ConnectionClosed):
--            return self._handle_connection_closed(event, source_conn, other_conn, is_server)
-+        if isinstance(event, events.Message):
-+            return self._handle_message(event, source_conn, other_conn, is_server)
-+        elif isinstance(event, events.Ping):
-+            return self._handle_ping(event, source_conn, other_conn, is_server)
-+        elif isinstance(event, events.Pong):
-+            return self._handle_pong(event, source_conn, other_conn, is_server)
-+        elif isinstance(event, events.CloseConnection):
-+            return self._handle_close_connection(event, source_conn, other_conn, is_server)
- 
-         # fail-safe for unhandled events
-         return True  # pragma: no cover
- 
--    def _handle_data_received(self, event, source_conn, other_conn, is_server):
-+    def _handle_message(self, event, source_conn, other_conn, is_server):
-         fb = self.server_frame_buffer if is_server else self.client_frame_buffer
-         fb.append(event.data)
- 
-         if event.message_finished:
-             original_chunk_sizes = [len(f) for f in fb]
- 
--            if isinstance(event, events.TextReceived):
-+            if isinstance(event, events.TextMessage):
-                 message_type = wsproto.frame_protocol.Opcode.TEXT
-                 payload = ''.join(fb)
-             else:
-@@ -127,19 +125,20 @@ class WebSocketLayer(base.Layer):
-                             yield (payload[i:i + chunk_size], True if i + chunk_size >= len(payload) else False)
- 
-                 for chunk, final in get_chunk(websocket_message.content):
--                    self.connections[other_conn].send_data(chunk, final)
--                    other_conn.send(self.connections[other_conn].bytes_to_send())
-+                    data = self.connections[other_conn].send(Message(data = chunk, message_finished = final))
-+                    other_conn.send(data)
- 
-         if self.flow.stream:
--            self.connections[other_conn].send_data(event.data, event.message_finished)
--            other_conn.send(self.connections[other_conn].bytes_to_send())
-+            data = self.connections[other_conn].send(Message(data = event.data, message_finished = event.message_finished))
-+            other_conn.send(data)
-         return True
- 
--    def _handle_ping_received(self, event, source_conn, other_conn, is_server):
--        # PING is automatically answered with a PONG by wsproto
--        self.connections[other_conn].ping()
--        other_conn.send(self.connections[other_conn].bytes_to_send())
--        source_conn.send(self.connections[source_conn].bytes_to_send())
-+    def _handle_ping(self, event, source_conn, other_conn, is_server):
-+        # Use event.response to create the approprate Pong response
-+        data = self.connections[other_conn].send(Ping())
-+        other_conn.send(data)
-+        data = self.connections[source_conn].send(event.response())
-+        source_conn.send(data)
-         self.log(
-             "Ping Received from {}".format("server" if is_server else "client"),
-             "info",
-@@ -147,7 +146,7 @@ class WebSocketLayer(base.Layer):
-         )
-         return True
- 
--    def _handle_pong_received(self, event, source_conn, other_conn, is_server):
-+    def _handle_pong(self, event, source_conn, other_conn, is_server):
-         self.log(
-             "Pong Received from {}".format("server" if is_server else "client"),
-             "info",
-@@ -155,14 +154,15 @@ class WebSocketLayer(base.Layer):
-         )
-         return True
- 
--    def _handle_connection_closed(self, event, source_conn, other_conn, is_server):
-+    def _handle_close_connection(self, event, source_conn, other_conn, is_server):
-         self.flow.close_sender = "server" if is_server else "client"
-         self.flow.close_code = event.code
-         self.flow.close_reason = event.reason
- 
--        self.connections[other_conn].close(event.code, event.reason)
--        other_conn.send(self.connections[other_conn].bytes_to_send())
--        source_conn.send(self.connections[source_conn].bytes_to_send())
-+        data = self.connections[other_conn].send(CloseConnection(code=event.code, reason=event.reason))



Home | Main Index | Thread Index | Old Index