aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2018-02-24 19:16:13 +1300
committerAldo Cortesi <aldo@nullcube.com>2018-02-24 19:16:13 +1300
commit6ea81a96d49c06e2877b727ee7c2d350d3e1a167 (patch)
tree8c2c5b0a96b07daf7cf2010170da99ae7ed42ec2 /mitmproxy
parent59db25bd0ff2faaab7ba982cf51d472e108612f6 (diff)
downloadmitmproxy-6ea81a96d49c06e2877b727ee7c2d350d3e1a167.tar.gz
mitmproxy-6ea81a96d49c06e2877b727ee7c2d350d3e1a167.tar.bz2
mitmproxy-6ea81a96d49c06e2877b727ee7c2d350d3e1a167.zip
addon options: proxyauth to /addons
Diffstat (limited to 'mitmproxy')
-rw-r--r--mitmproxy/addons/proxyauth.py12
-rw-r--r--mitmproxy/options.py11
2 files changed, 12 insertions, 11 deletions
diff --git a/mitmproxy/addons/proxyauth.py b/mitmproxy/addons/proxyauth.py
index dc99d5cc..c0a3f83a 100644
--- a/mitmproxy/addons/proxyauth.py
+++ b/mitmproxy/addons/proxyauth.py
@@ -52,6 +52,18 @@ class ProxyAuth:
self.authenticated = weakref.WeakKeyDictionary() # type: MutableMapping[connections.ClientConnection, Tuple[str, str]]
"""Contains all connections that are permanently authenticated after an HTTP CONNECT"""
+ def load(self, loader):
+ loader.add_option(
+ "proxyauth", Optional[str], None,
+ """
+ Require proxy authentication. Format:
+ "username:pass",
+ "any" to accept any user/pass combination,
+ "@path" to use an Apache htpasswd file,
+ or "ldap[s]:url_server_ldap:dn_auth:password:dn_subtree" for LDAP authentication.
+ """
+ )
+
def enabled(self) -> bool:
return any([self.nonanonymous, self.htpasswd, self.singleuser, self.ldapconn, self.ldapserver])
diff --git a/mitmproxy/options.py b/mitmproxy/options.py
index 39fbff8f..7a00bb87 100644
--- a/mitmproxy/options.py
+++ b/mitmproxy/options.py
@@ -56,7 +56,6 @@ class Options(optmanager.OptManager):
# FIXME: Options that must be migrated to addons, but are complicated
# because they're used by more than one addon, or because they're
# embedded in the core code somehow.
- proxyauth = None # type: Optional[str]
showhost = None # type: bool
verbosity = None # type: str
view_filter = None # type: Optional[str]
@@ -79,16 +78,6 @@ class Options(optmanager.OptManager):
# Proxy options
self.add_option(
- "proxyauth", Optional[str], None,
- """
- Require proxy authentication. Format:
- "username:pass",
- "any" to accept any user/pass combination,
- "@path" to use an Apache htpasswd file,
- or "ldap[s]:url_server_ldap:dn_auth:password:dn_subtree" for LDAP authentication.
- """
- )
- self.add_option(
"add_upstream_certs_to_client_chain", bool, False,
"""
Add all certificates of the upstream server to the certificate chain