diff --git a/mitmproxy/addons/__init__.py b/mitmproxy/addons/__init__.py index 1bf89bbba..165106403 100644 --- a/mitmproxy/addons/__init__.py +++ b/mitmproxy/addons/__init__.py @@ -3,7 +3,7 @@ from mitmproxy.addons import anticomp from mitmproxy.addons import check_alpn from mitmproxy.addons import check_ca from mitmproxy.addons import clientplayback -from mitmproxy.addons import core +from mitmproxy.addons import core_option_validation from mitmproxy.addons import disable_h2c_upgrade from mitmproxy.addons import onboarding from mitmproxy.addons import proxyauth @@ -20,7 +20,7 @@ from mitmproxy.addons import upstream_auth def default_addons(): return [ - core.Core(), + core_option_validation.CoreOptionValidation(), anticache.AntiCache(), anticomp.AntiComp(), check_alpn.CheckALPN(), diff --git a/mitmproxy/addons/core.py b/mitmproxy/addons/core_option_validation.py similarity index 98% rename from mitmproxy/addons/core.py rename to mitmproxy/addons/core_option_validation.py index 4c6a55168..fd5f27880 100644 --- a/mitmproxy/addons/core.py +++ b/mitmproxy/addons/core_option_validation.py @@ -8,7 +8,7 @@ from mitmproxy.net import server_spec from mitmproxy.utils import human -class Core: +class CoreOptionValidation: def configure(self, opts, updated): if opts.add_upstream_certs_to_client_chain and not opts.upstream_cert: raise exceptions.OptionsError( diff --git a/test/mitmproxy/addons/test_core.py b/test/mitmproxy/addons/test_core_option_validation.py similarity index 86% rename from test/mitmproxy/addons/test_core.py rename to test/mitmproxy/addons/test_core_option_validation.py index db739b5de..0bb2bb0d7 100644 --- a/test/mitmproxy/addons/test_core.py +++ b/test/mitmproxy/addons/test_core_option_validation.py @@ -1,12 +1,12 @@ from mitmproxy import exceptions -from mitmproxy.addons import core +from mitmproxy.addons import core_option_validation from mitmproxy.test import taddons import pytest from unittest import mock def test_simple(): - sa = core.Core() + sa = core_option_validation.CoreOptionValidation() with taddons.context() as tctx: with pytest.raises(exceptions.OptionsError): tctx.configure(sa, body_size_limit = "invalid") @@ -28,7 +28,7 @@ def test_simple(): @mock.patch("mitmproxy.platform.original_addr", None) def test_no_transparent(): - sa = core.Core() + sa = core_option_validation.CoreOptionValidation() with taddons.context() as tctx: with pytest.raises(Exception, match="Transparent mode not supported"): tctx.configure(sa, mode = "transparent") @@ -36,7 +36,7 @@ def test_no_transparent(): @mock.patch("mitmproxy.platform.original_addr") def test_modes(m): - sa = core.Core() + sa = core_option_validation.CoreOptionValidation() with taddons.context() as tctx: tctx.configure(sa, mode = "reverse:http://localhost") with pytest.raises(Exception, match="Invalid server specification"):