diff options
-rw-r--r-- | mitmproxy/addons/__init__.py | 4 | ||||
-rw-r--r-- | mitmproxy/addons/upstream_auth.py (renamed from mitmproxy/addons/upstream_proxy_auth.py) | 2 | ||||
-rw-r--r-- | mitmproxy/tools/cmdline.py | 4 | ||||
-rw-r--r-- | test/mitmproxy/addons/test_upstream_auth.py (renamed from test/mitmproxy/addons/test_upstream_proxy_auth.py) | 6 |
4 files changed, 8 insertions, 8 deletions
diff --git a/mitmproxy/addons/__init__.py b/mitmproxy/addons/__init__.py index d25c231b..d71b8912 100644 --- a/mitmproxy/addons/__init__.py +++ b/mitmproxy/addons/__init__.py @@ -10,7 +10,7 @@ from mitmproxy.addons import serverplayback from mitmproxy.addons import stickyauth from mitmproxy.addons import stickycookie from mitmproxy.addons import streambodies -from mitmproxy.addons import upstream_proxy_auth +from mitmproxy.addons import upstream_auth def default_addons(): @@ -27,5 +27,5 @@ def default_addons(): setheaders.SetHeaders(), serverplayback.ServerPlayback(), clientplayback.ClientPlayback(), - upstream_proxy_auth.UpstreamProxyAuth(), + upstream_auth.UpstreamAuth(), ] diff --git a/mitmproxy/addons/upstream_proxy_auth.py b/mitmproxy/addons/upstream_auth.py index 8b31c10a..9beecfc0 100644 --- a/mitmproxy/addons/upstream_proxy_auth.py +++ b/mitmproxy/addons/upstream_auth.py @@ -14,7 +14,7 @@ def parse_upstream_auth(auth): return b"Basic" + b" " + base64.b64encode(strutils.always_bytes(auth)) -class UpstreamProxyAuth(): +class UpstreamAuth(): """ This addon handles authentication to systems upstream from us for the upstream proxy and reverse proxy mode. There are 3 cases: diff --git a/mitmproxy/tools/cmdline.py b/mitmproxy/tools/cmdline.py index debe6db9..8b579952 100644 --- a/mitmproxy/tools/cmdline.py +++ b/mitmproxy/tools/cmdline.py @@ -463,8 +463,8 @@ def proxy_options(parser): action="store", dest="upstream_auth", default=None, type=str, help=""" - Proxy Authentication: - username:password + Add HTTP Basic authentcation to upstream proxy and reverse proxy + requests. Format: username:password """ ) rawtcp = group.add_mutually_exclusive_group() diff --git a/test/mitmproxy/addons/test_upstream_proxy_auth.py b/test/mitmproxy/addons/test_upstream_auth.py index d5d6a3e3..985b13a7 100644 --- a/test/mitmproxy/addons/test_upstream_proxy_auth.py +++ b/test/mitmproxy/addons/test_upstream_auth.py @@ -4,11 +4,11 @@ from mitmproxy import exceptions from mitmproxy.test import taddons from mitmproxy.test import tflow from mitmproxy.test import tutils -from mitmproxy.addons import upstream_proxy_auth +from mitmproxy.addons import upstream_auth def test_configure(): - up = upstream_proxy_auth.UpstreamProxyAuth() + up = upstream_auth.UpstreamAuth() with taddons.context() as tctx: tctx.configure(up, upstream_auth="test:test") assert up.auth == b"Basic" + b" " + base64.b64encode(b"test:test") @@ -40,7 +40,7 @@ def test_configure(): def test_simple(): - up = upstream_proxy_auth.UpstreamProxyAuth() + up = upstream_auth.UpstreamAuth() with taddons.context() as tctx: tctx.configure(up, upstream_auth="foo:bar") |