2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
2024-01-02 11:29:13 +00:00
|
|
|
, stdenv
|
2020-09-25 04:45:31 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
2021-03-09 03:18:52 +00:00
|
|
|
, pythonOlder
|
2024-01-25 14:12:00 +00:00
|
|
|
, pythonRelaxDepsHook
|
2021-03-09 03:18:52 +00:00
|
|
|
# Mitmproxy requirements
|
2024-01-25 14:12:00 +00:00
|
|
|
, aioquic
|
2021-03-09 03:18:52 +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
|
2024-01-02 11:29:13 +00:00
|
|
|
, mitmproxy-macos
|
2023-11-16 04:20:00 +00:00
|
|
|
, mitmproxy-rs
|
2021-03-09 03:18:52 +00:00
|
|
|
, msgpack
|
2020-09-25 04:45:31 +00:00
|
|
|
, passlib
|
|
|
|
, protobuf
|
2021-03-09 03:18:52 +00:00
|
|
|
, publicsuffix2
|
2020-09-25 04:45:31 +00:00
|
|
|
, pyopenssl
|
|
|
|
, pyparsing
|
|
|
|
, pyperclip
|
2021-12-06 16:07:01 +00:00
|
|
|
, ruamel-yaml
|
2020-09-25 04:45:31 +00:00
|
|
|
, setuptools
|
|
|
|
, sortedcontainers
|
|
|
|
, tornado
|
2024-01-13 08:15:51 +00:00
|
|
|
, urwid-mitmproxy
|
2020-09-25 04:45:31 +00:00
|
|
|
, wsproto
|
|
|
|
, zstandard
|
2021-03-09 03:18:52 +00:00
|
|
|
# Additional check requirements
|
|
|
|
, hypothesis
|
2020-09-25 04:45:31 +00:00
|
|
|
, parver
|
|
|
|
, pytest-asyncio
|
2021-03-09 03:18:52 +00:00
|
|
|
, pytest-timeout
|
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
|
|
|
, requests
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mitmproxy";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "10.2.2";
|
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";
|
2023-01-11 07:51:40 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-oxhpaFW++on3eRXm0anXZDRo6g/X5IflTcZkFF8Kcps=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"aioquic"
|
2024-02-29 20:09:43 +00:00
|
|
|
"cryptography"
|
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-01-02 11:29:13 +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-01-25 14:12:00 +00:00
|
|
|
"test_integration"
|
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
|
|
|
};
|
|
|
|
}
|