2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
2021-03-09 03:18:52 +00:00
|
|
|
# Mitmproxy requirements
|
2024-06-05 15:53:02 +00:00
|
|
|
aioquic,
|
|
|
|
asgiref,
|
|
|
|
blinker,
|
|
|
|
brotli,
|
|
|
|
certifi,
|
|
|
|
cryptography,
|
|
|
|
flask,
|
|
|
|
h11,
|
|
|
|
h2,
|
|
|
|
hyperframe,
|
|
|
|
kaitaistruct,
|
|
|
|
ldap3,
|
|
|
|
mitmproxy-macos,
|
|
|
|
mitmproxy-rs,
|
|
|
|
msgpack,
|
|
|
|
passlib,
|
|
|
|
protobuf,
|
|
|
|
publicsuffix2,
|
|
|
|
pyopenssl,
|
|
|
|
pyparsing,
|
|
|
|
pyperclip,
|
|
|
|
ruamel-yaml,
|
|
|
|
setuptools,
|
|
|
|
sortedcontainers,
|
|
|
|
tornado,
|
|
|
|
urwid-mitmproxy,
|
|
|
|
wsproto,
|
|
|
|
zstandard,
|
2021-03-09 03:18:52 +00:00
|
|
|
# Additional check requirements
|
2024-06-05 15:53:02 +00:00
|
|
|
hypothesis,
|
|
|
|
parver,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytest-timeout,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
|
|
|
requests,
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mitmproxy";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "10.3.1";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
src = fetchFromGitHub {
|
2022-12-17 10:02:37 +00:00
|
|
|
owner = "mitmproxy";
|
|
|
|
repo = "mitmproxy";
|
2024-06-20 14:57:18 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-rIyRY1FolbdoaI4OgFG7D2/mot8NiRHalgittPzledw=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"aioquic"
|
2024-02-29 20:09:43 +00:00
|
|
|
"cryptography"
|
2024-07-27 06:49:29 +00:00
|
|
|
"pyperclip"
|
|
|
|
"tornado"
|
2024-01-25 14:12:00 +00:00
|
|
|
];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
propagatedBuildInputs = [
|
2024-01-25 14:12:00 +00:00
|
|
|
aioquic
|
2020-11-21 19:51:51 +00:00
|
|
|
asgiref
|
2020-09-25 04:45:31 +00:00
|
|
|
blinker
|
|
|
|
brotli
|
|
|
|
certifi
|
|
|
|
cryptography
|
|
|
|
flask
|
2021-03-09 03:18:52 +00:00
|
|
|
h11
|
2020-09-25 04:45:31 +00:00
|
|
|
h2
|
|
|
|
hyperframe
|
|
|
|
kaitaistruct
|
|
|
|
ldap3
|
2023-11-16 04:20:00 +00:00
|
|
|
mitmproxy-rs
|
2020-11-21 19:51:51 +00:00
|
|
|
msgpack
|
2020-09-25 04:45:31 +00:00
|
|
|
passlib
|
|
|
|
protobuf
|
2022-12-17 10:02:37 +00:00
|
|
|
publicsuffix2
|
2024-01-02 11:29:13 +00:00
|
|
|
pyopenssl
|
2020-09-25 04:45:31 +00:00
|
|
|
pyparsing
|
|
|
|
pyperclip
|
2021-12-06 16:07:01 +00:00
|
|
|
ruamel-yaml
|
2024-01-02 11:29:13 +00:00
|
|
|
setuptools
|
2020-09-25 04:45:31 +00:00
|
|
|
sortedcontainers
|
|
|
|
tornado
|
2024-01-13 08:15:51 +00:00
|
|
|
urwid-mitmproxy
|
2020-09-25 04:45:31 +00:00
|
|
|
wsproto
|
|
|
|
zstandard
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [ mitmproxy-macos ];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-09-25 04:45:31 +00:00
|
|
|
hypothesis
|
|
|
|
parver
|
|
|
|
pytest-asyncio
|
2021-03-09 03:18:52 +00:00
|
|
|
pytest-timeout
|
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
2020-09-25 04:45:31 +00:00
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require a git repository
|
|
|
|
"test_get_version"
|
2021-09-18 10:52:07 +00:00
|
|
|
# https://github.com/mitmproxy/mitmproxy/commit/36ebf11916704b3cdaf4be840eaafa66a115ac03
|
|
|
|
# Tests require terminal
|
2024-01-25 14:12:00 +00:00
|
|
|
"test_commands_exist"
|
2022-07-18 16:21:45 +00:00
|
|
|
"test_contentview_flowview"
|
|
|
|
"test_flowview"
|
2024-04-21 15:54:59 +00:00
|
|
|
"test_get_hex_editor"
|
2024-01-25 14:12:00 +00:00
|
|
|
"test_integration"
|
2024-04-21 15:54:59 +00:00
|
|
|
"test_spawn_editor"
|
2023-01-11 07:51:40 +00:00
|
|
|
"test_statusbar"
|
2024-01-25 14:12:00 +00:00
|
|
|
# FileNotFoundError: [Errno 2] No such file or directory
|
|
|
|
# likely wireguard is also not working in the sandbox
|
|
|
|
"test_wireguard"
|
2022-12-17 10:02:37 +00:00
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
dontUsePytestXdist = true;
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "mitmproxy" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
description = "Man-in-the-middle proxy";
|
2021-03-09 03:18:52 +00:00
|
|
|
homepage = "https://mitmproxy.org/";
|
2024-01-02 11:29:13 +00:00
|
|
|
changelog = "https://github.com/mitmproxy/mitmproxy/blob/${version}/CHANGELOG.md";
|
2021-03-09 03:18:52 +00:00
|
|
|
license = licenses.mit;
|
2024-01-25 14:12:00 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
}
|