2023-03-26 17:40:32 +00:00
|
|
|
[project]
|
|
|
|
name = "mitmproxy"
|
|
|
|
description = "An interactive, SSL/TLS-capable intercepting proxy for HTTP/1, HTTP/2, and WebSockets."
|
|
|
|
readme = "README.md"
|
|
|
|
requires-python = ">=3.10"
|
|
|
|
license = {file="LICENSE"}
|
|
|
|
authors = [{name = "Aldo Cortesi", email = "aldo@corte.si"}]
|
|
|
|
maintainers = [{name = "Maximilian Hils", email = "mitmproxy@maximilianhils.com"}]
|
|
|
|
dynamic = ["version"]
|
|
|
|
|
|
|
|
classifiers = [
|
|
|
|
"License :: OSI Approved :: MIT License",
|
|
|
|
"Development Status :: 5 - Production/Stable",
|
|
|
|
"Environment :: Console :: Curses",
|
|
|
|
"Operating System :: MacOS",
|
|
|
|
"Operating System :: POSIX",
|
|
|
|
"Operating System :: Microsoft :: Windows",
|
|
|
|
"Programming Language :: Python :: 3 :: Only",
|
|
|
|
"Programming Language :: Python :: 3.10",
|
|
|
|
"Programming Language :: Python :: 3.11",
|
2023-10-31 17:57:21 +00:00
|
|
|
"Programming Language :: Python :: 3.12",
|
2024-08-13 18:05:16 +00:00
|
|
|
"Programming Language :: Python :: 3.13",
|
2023-03-26 17:40:32 +00:00
|
|
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
|
|
"Topic :: Security",
|
|
|
|
"Topic :: Internet :: WWW/HTTP",
|
|
|
|
"Topic :: Internet :: Proxy Servers",
|
|
|
|
"Topic :: System :: Networking :: Monitoring",
|
|
|
|
"Topic :: Software Development :: Testing",
|
|
|
|
"Typing :: Typed",
|
|
|
|
]
|
|
|
|
|
|
|
|
# https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/#install-requires
|
|
|
|
# It is not considered best practice to use install_requires to pin dependencies to specific versions.
|
|
|
|
dependencies = [
|
2024-07-29 12:01:48 +00:00
|
|
|
"aioquic>=1.1.0,<=1.2.0",
|
2024-05-22 00:09:16 +00:00
|
|
|
"asgiref>=3.2.10,<=3.8.1",
|
|
|
|
"Brotli>=1.0,<=1.1.0",
|
|
|
|
"certifi>=2019.9.11", # no upper bound here to get latest CA bundle
|
2024-07-29 12:16:48 +00:00
|
|
|
"cryptography>=42.0,<43.1", # relaxed upper bound here to get security fixes
|
2024-05-22 00:09:16 +00:00
|
|
|
"flask>=3.0,<=3.0.3",
|
|
|
|
"h11>=0.11,<=0.14.0",
|
|
|
|
"h2>=4.1,<=4.1.0",
|
|
|
|
"hyperframe>=6.0,<=6.0.1",
|
|
|
|
"kaitaistruct>=0.10,<=0.10",
|
|
|
|
"ldap3>=2.8,<=2.9.1",
|
2024-09-01 20:22:51 +00:00
|
|
|
"mitmproxy_rs>=0.7.2,<0.8", # relaxed upper bound here: we control this
|
2024-05-22 00:09:16 +00:00
|
|
|
"msgpack>=1.0.0,<=1.0.8",
|
|
|
|
"passlib>=1.6.5,<=1.7.4",
|
2024-08-02 07:47:54 +00:00
|
|
|
"protobuf>=5.27.2,<=5.27.3",
|
2024-05-22 00:09:16 +00:00
|
|
|
"pydivert>=2.0.3,<=2.1.0; sys_platform == 'win32'",
|
2024-07-29 12:01:33 +00:00
|
|
|
"pyOpenSSL>=22.1,<=24.2.1",
|
2024-05-22 00:09:16 +00:00
|
|
|
"pyparsing>=2.4.2,<=3.1.2",
|
2024-07-02 05:20:05 +00:00
|
|
|
"pyperclip<=1.9.0,>=1.9.0",
|
2024-05-22 00:09:16 +00:00
|
|
|
"ruamel.yaml>=0.16,<=0.18.6",
|
|
|
|
"sortedcontainers>=2.3,<=2.4.0",
|
2024-07-02 05:20:28 +00:00
|
|
|
"tornado<=6.4.1,>=6.4.1",
|
2024-05-22 00:09:16 +00:00
|
|
|
"typing-extensions>=4.3,<=4.11.0; python_version<'3.11'",
|
2024-07-29 12:08:55 +00:00
|
|
|
"urwid>=2.6.14,<=2.6.15",
|
2024-05-22 00:09:16 +00:00
|
|
|
"wsproto>=1.0,<=1.2.0",
|
|
|
|
"publicsuffix2>=2.20190812,<=2.20191221",
|
2024-07-29 12:01:35 +00:00
|
|
|
"zstandard>=0.15,<=0.23.0",
|
2023-03-26 17:40:32 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
[project.optional-dependencies]
|
|
|
|
dev = [
|
2024-05-22 00:09:16 +00:00
|
|
|
"click>=7.0,<=8.1.7",
|
2024-07-29 11:58:21 +00:00
|
|
|
"hypothesis>=6.104.2,<=6.108.5",
|
2024-07-29 12:08:44 +00:00
|
|
|
"pdoc>=14.5.1,<=14.6.0",
|
2024-08-13 18:05:16 +00:00
|
|
|
"pyinstaller==6.10.0",
|
|
|
|
"pyinstaller-hooks-contrib==2024.8",
|
2024-07-29 11:58:21 +00:00
|
|
|
"pytest-asyncio>=0.23.6,<=0.23.8",
|
2024-05-22 00:09:16 +00:00
|
|
|
"pytest-cov>=5.0.0,<=5.0.0",
|
|
|
|
"pytest-timeout>=2.3.1,<=2.3.1",
|
|
|
|
"pytest-xdist>=3.5.0,<=3.6.1",
|
2024-07-29 11:58:21 +00:00
|
|
|
"pytest>=8.2.2,<=8.3.2",
|
2024-06-02 12:43:46 +00:00
|
|
|
"requests>=2.9.1,<=2.32.3",
|
2024-07-29 12:07:37 +00:00
|
|
|
"tox>=4.15.1,<=4.16.0",
|
2024-05-22 00:09:16 +00:00
|
|
|
"wheel>=0.36.2,<=0.43",
|
|
|
|
"build>=0.10.0,<=1.2.1",
|
2024-08-02 07:47:10 +00:00
|
|
|
"mypy>=1.10.1,<=1.11.1",
|
2024-07-29 12:26:42 +00:00
|
|
|
"ruff>=0.5.0,<=0.5.5",
|
2024-05-22 00:09:16 +00:00
|
|
|
"types-certifi>=2021.10.8.3,<=2021.10.8.3",
|
|
|
|
"types-Flask>=1.1.6,<=1.1.6",
|
|
|
|
"types-Werkzeug>=1.0.9,<=1.0.9",
|
2024-07-29 12:08:20 +00:00
|
|
|
"types-requests>=2.32.0.20240622,<=2.32.0.20240712",
|
2024-05-22 00:09:16 +00:00
|
|
|
"types-cryptography>=3.3.23.2,<=3.3.23.2",
|
2024-07-29 12:08:20 +00:00
|
|
|
"types-pyOpenSSL>=23.3.0.0,<=24.1.0.20240722",
|
2023-03-26 17:40:32 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
[project.urls]
|
|
|
|
Homepage = "https://mitmproxy.org"
|
|
|
|
Source = "https://github.com/mitmproxy/mitmproxy/"
|
|
|
|
Documentation = "https://docs.mitmproxy.org/stable/"
|
|
|
|
Issues = "https://github.com/mitmproxy/mitmproxy/issues"
|
|
|
|
|
|
|
|
[project.scripts]
|
|
|
|
mitmproxy = "mitmproxy.tools.main:mitmproxy"
|
|
|
|
mitmdump = "mitmproxy.tools.main:mitmdump"
|
|
|
|
mitmweb = "mitmproxy.tools.main:mitmweb"
|
|
|
|
|
|
|
|
[project.entry-points.pyinstaller40]
|
|
|
|
hook-dirs = "mitmproxy.utils.pyinstaller:hook_dirs"
|
|
|
|
|
|
|
|
[build-system]
|
|
|
|
requires = ["setuptools"]
|
|
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
|
|
|
|
[tool.setuptools.dynamic]
|
|
|
|
version = {attr = "mitmproxy.version.VERSION"}
|
|
|
|
|
|
|
|
[tool.setuptools.packages.find]
|
|
|
|
include = ["mitmproxy*"]
|
|
|
|
|
|
|
|
[tool.coverage.run]
|
|
|
|
branch = false
|
|
|
|
omit = [
|
|
|
|
"*contrib*",
|
|
|
|
"*tnetstring*",
|
|
|
|
"*platform*",
|
|
|
|
"*main.py",
|
|
|
|
]
|
|
|
|
|
|
|
|
[tool.coverage.report]
|
|
|
|
show_missing = true
|
|
|
|
exclude_lines = [
|
|
|
|
"pragma: no cover",
|
|
|
|
"raise NotImplementedError",
|
|
|
|
"raise AssertionError",
|
|
|
|
"if typing.TYPE_CHECKING:",
|
|
|
|
"if TYPE_CHECKING:",
|
|
|
|
"@overload",
|
|
|
|
"@abstractmethod",
|
|
|
|
"assert_never",
|
|
|
|
"\\.\\.\\.",
|
|
|
|
]
|
|
|
|
|
|
|
|
[tool.pytest.ini_options]
|
|
|
|
asyncio_mode = "auto"
|
|
|
|
testpaths = "test"
|
|
|
|
addopts = "--capture=no --color=yes"
|
|
|
|
filterwarnings = [
|
|
|
|
"ignore::DeprecationWarning:tornado.*:",
|
2024-01-04 09:53:13 +00:00
|
|
|
"ignore:datetime.datetime.utcnow:DeprecationWarning:aioquic.*:",
|
2023-12-12 18:15:19 +00:00
|
|
|
"error::RuntimeWarning",
|
|
|
|
"error::pytest.PytestUnraisableExceptionWarning",
|
2024-01-04 09:53:13 +00:00
|
|
|
# The following warning should only appear on Python 3.11 and below where eager_task_factory is not present
|
|
|
|
"default:coroutine 'ConnectionHandler.hook_task' was never awaited:RuntimeWarning",
|
2023-03-26 17:40:32 +00:00
|
|
|
]
|
|
|
|
|
2024-04-21 21:44:09 +00:00
|
|
|
[tool.pytest.individual_coverage]
|
|
|
|
exclude = [
|
|
|
|
"mitmproxy/addons/__init__.py",
|
|
|
|
"mitmproxy/addons/onboarding.py",
|
|
|
|
"mitmproxy/addons/onboardingapp/__init__.py",
|
|
|
|
"mitmproxy/contentviews/__init__.py",
|
|
|
|
"mitmproxy/contentviews/base.py",
|
|
|
|
"mitmproxy/contentviews/grpc.py",
|
|
|
|
"mitmproxy/contentviews/image/__init__.py",
|
|
|
|
"mitmproxy/contrib/*",
|
|
|
|
"mitmproxy/ctx.py",
|
|
|
|
"mitmproxy/exceptions.py",
|
|
|
|
"mitmproxy/flow.py",
|
|
|
|
"mitmproxy/io/__init__.py",
|
|
|
|
"mitmproxy/io/io.py",
|
|
|
|
"mitmproxy/io/tnetstring.py",
|
|
|
|
"mitmproxy/log.py",
|
|
|
|
"mitmproxy/master.py",
|
|
|
|
"mitmproxy/net/check.py",
|
|
|
|
"mitmproxy/net/http/cookies.py",
|
|
|
|
"mitmproxy/net/http/http1/__init__.py",
|
|
|
|
"mitmproxy/net/http/multipart.py",
|
|
|
|
"mitmproxy/net/tls.py",
|
|
|
|
"mitmproxy/platform/__init__.py",
|
|
|
|
"mitmproxy/platform/linux.py",
|
|
|
|
"mitmproxy/platform/openbsd.py",
|
|
|
|
"mitmproxy/platform/osx.py",
|
|
|
|
"mitmproxy/platform/pf.py",
|
|
|
|
"mitmproxy/platform/windows.py",
|
|
|
|
"mitmproxy/proxy/__init__.py",
|
|
|
|
"mitmproxy/proxy/layers/__init__.py",
|
|
|
|
"mitmproxy/proxy/layers/http/__init__.py",
|
|
|
|
"mitmproxy/proxy/layers/http/_base.py",
|
|
|
|
"mitmproxy/proxy/layers/http/_events.py",
|
|
|
|
"mitmproxy/proxy/layers/http/_hooks.py",
|
|
|
|
"mitmproxy/proxy/layers/http/_http1.py",
|
|
|
|
"mitmproxy/proxy/layers/http/_http2.py",
|
|
|
|
"mitmproxy/proxy/layers/http/_http3.py",
|
|
|
|
"mitmproxy/proxy/layers/http/_http_h2.py",
|
|
|
|
"mitmproxy/proxy/layers/http/_http_h3.py",
|
|
|
|
"mitmproxy/proxy/layers/http/_upstream_proxy.py",
|
|
|
|
"mitmproxy/proxy/layers/tls.py",
|
|
|
|
"mitmproxy/proxy/server.py",
|
|
|
|
"mitmproxy/script/__init__.py",
|
|
|
|
"mitmproxy/test/taddons.py",
|
|
|
|
"mitmproxy/test/tflow.py",
|
|
|
|
"mitmproxy/test/tutils.py",
|
|
|
|
"mitmproxy/tools/console/__init__.py",
|
|
|
|
"mitmproxy/tools/console/commander/commander.py",
|
|
|
|
"mitmproxy/tools/console/commandexecutor.py",
|
|
|
|
"mitmproxy/tools/console/commands.py",
|
|
|
|
"mitmproxy/tools/console/common.py",
|
|
|
|
"mitmproxy/tools/console/consoleaddons.py",
|
|
|
|
"mitmproxy/tools/console/eventlog.py",
|
|
|
|
"mitmproxy/tools/console/flowdetailview.py",
|
|
|
|
"mitmproxy/tools/console/flowlist.py",
|
|
|
|
"mitmproxy/tools/console/flowview.py",
|
|
|
|
"mitmproxy/tools/console/grideditor/__init__.py",
|
|
|
|
"mitmproxy/tools/console/grideditor/base.py",
|
|
|
|
"mitmproxy/tools/console/grideditor/col_bytes.py",
|
|
|
|
"mitmproxy/tools/console/grideditor/col_subgrid.py",
|
|
|
|
"mitmproxy/tools/console/grideditor/col_text.py",
|
|
|
|
"mitmproxy/tools/console/grideditor/col_viewany.py",
|
|
|
|
"mitmproxy/tools/console/grideditor/editors.py",
|
|
|
|
"mitmproxy/tools/console/help.py",
|
|
|
|
"mitmproxy/tools/console/keybindings.py",
|
|
|
|
"mitmproxy/tools/console/keymap.py",
|
|
|
|
"mitmproxy/tools/console/layoutwidget.py",
|
|
|
|
"mitmproxy/tools/console/master.py",
|
|
|
|
"mitmproxy/tools/console/options.py",
|
|
|
|
"mitmproxy/tools/console/overlay.py",
|
|
|
|
"mitmproxy/tools/console/quickhelp.py",
|
|
|
|
"mitmproxy/tools/console/searchable.py",
|
|
|
|
"mitmproxy/tools/console/signals.py",
|
|
|
|
"mitmproxy/tools/console/statusbar.py",
|
|
|
|
"mitmproxy/tools/console/tabs.py",
|
|
|
|
"mitmproxy/tools/console/window.py",
|
|
|
|
"mitmproxy/tools/main.py",
|
|
|
|
"mitmproxy/tools/web/__init__.py",
|
|
|
|
"mitmproxy/tools/web/app.py",
|
|
|
|
"mitmproxy/tools/web/master.py",
|
|
|
|
"mitmproxy/tools/web/webaddons.py",
|
|
|
|
"mitmproxy/utils/bits.py",
|
|
|
|
"mitmproxy/utils/pyinstaller/*",
|
|
|
|
"mitmproxy/utils/vt_codes.py",
|
|
|
|
]
|
|
|
|
|
2023-03-26 17:40:32 +00:00
|
|
|
[tool.mypy]
|
|
|
|
check_untyped_defs = true
|
|
|
|
ignore_missing_imports = true
|
|
|
|
files = [
|
|
|
|
"mitmproxy",
|
|
|
|
"examples/addons",
|
|
|
|
"release/*.py",
|
|
|
|
]
|
|
|
|
exclude = [
|
|
|
|
"^docs/",
|
|
|
|
"^release/build/",
|
|
|
|
"^examples/contrib/",
|
|
|
|
]
|
|
|
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
module = "mitmproxy.contrib.*"
|
|
|
|
ignore_errors = true
|
|
|
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
module = "tornado.*"
|
|
|
|
ignore_errors = true
|
|
|
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
module = "test.*"
|
|
|
|
ignore_errors = true
|
|
|
|
|
2023-10-31 15:03:53 +00:00
|
|
|
[tool.ruff]
|
|
|
|
extend-exclude = ["mitmproxy/contrib/"]
|
2024-04-21 21:44:09 +00:00
|
|
|
|
|
|
|
[tool.ruff.lint]
|
|
|
|
select = ["E", "F", "I"]
|
2023-10-31 15:03:53 +00:00
|
|
|
ignore = ["F541", "E501"]
|
|
|
|
|
|
|
|
|
2024-04-21 21:44:09 +00:00
|
|
|
[tool.ruff.lint.isort]
|
2023-10-31 15:03:53 +00:00
|
|
|
# these rules are a bit weird, but they mimic our existing reorder_python_imports style.
|
|
|
|
# if we break compatibility here, consider removing all customization + enforce absolute imports.
|
|
|
|
force-single-line = true
|
|
|
|
order-by-type = false
|
|
|
|
section-order = ["future", "standard-library", "third-party", "local-folder","first-party"]
|
|
|
|
no-lines-before = ["first-party"]
|
|
|
|
known-first-party = ["test", "mitmproxy"]
|
2023-06-25 23:26:21 +00:00
|
|
|
|
2023-03-26 17:40:32 +00:00
|
|
|
[tool.tox]
|
|
|
|
legacy_tox_ini = """
|
|
|
|
[tox]
|
2023-10-31 15:03:53 +00:00
|
|
|
envlist = py, lint, mypy
|
2023-03-26 17:40:32 +00:00
|
|
|
skipsdist = True
|
|
|
|
toxworkdir={env:TOX_WORK_DIR:.tox}
|
|
|
|
|
|
|
|
[testenv]
|
|
|
|
deps =
|
|
|
|
-e .[dev]
|
|
|
|
setenv = HOME = {envtmpdir}
|
|
|
|
commands =
|
|
|
|
mitmdump --version
|
2024-04-21 21:44:09 +00:00
|
|
|
pytest --timeout 60 -vv \
|
|
|
|
--cov-report xml \
|
2023-03-26 17:40:32 +00:00
|
|
|
--continue-on-collection-errors \
|
|
|
|
--cov=mitmproxy --cov=release \
|
|
|
|
{posargs}
|
|
|
|
|
2024-04-21 21:44:09 +00:00
|
|
|
[testenv:old-dependencies]
|
|
|
|
uv_resolution = lowest-direct
|
|
|
|
|
2023-10-31 15:03:53 +00:00
|
|
|
[testenv:lint]
|
2023-03-26 17:40:32 +00:00
|
|
|
commands =
|
2024-07-02 10:07:47 +00:00
|
|
|
ruff check .
|
2023-03-26 17:40:32 +00:00
|
|
|
|
|
|
|
[testenv:filename_matching]
|
|
|
|
deps =
|
|
|
|
commands =
|
|
|
|
python ./test/filename_matching.py
|
|
|
|
|
|
|
|
[testenv:mypy]
|
|
|
|
commands =
|
|
|
|
mypy {posargs}
|
|
|
|
|
|
|
|
[testenv:individual_coverage]
|
|
|
|
commands =
|
|
|
|
python ./test/individual_coverage.py {posargs}
|
|
|
|
|
|
|
|
[testenv:wheeltest]
|
|
|
|
recreate = True
|
|
|
|
deps =
|
|
|
|
commands =
|
|
|
|
pip install {posargs}
|
|
|
|
mitmproxy --version
|
|
|
|
mitmdump --version
|
|
|
|
mitmweb --version
|
|
|
|
"""
|