aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-11-13 11:50:28 +1300
committerAldo Cortesi <aldo@nullcube.com>2016-11-13 11:50:28 +1300
commitfe01b1435a2acc9896b24a814e535558884a6143 (patch)
treeb1795dffd08ecfc06ccbada26f6326732085ae6e
parent3b00bc339d1c65703431e92cfeb2b7436790d04e (diff)
downloadmitmproxy-fe01b1435a2acc9896b24a814e535558884a6143.tar.gz
mitmproxy-fe01b1435a2acc9896b24a814e535558884a6143.tar.bz2
mitmproxy-fe01b1435a2acc9896b24a814e535558884a6143.zip
upstream_proxy_auth -> upstream_auth
Also clarify what this does in commandline help.
-rw-r--r--mitmproxy/addons/__init__.py4
-rw-r--r--mitmproxy/addons/upstream_auth.py (renamed from mitmproxy/addons/upstream_proxy_auth.py)2
-rw-r--r--mitmproxy/tools/cmdline.py4
-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")