mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
fixed lint
This commit is contained in:
parent
f67d9adc31
commit
154e8ac0fc
2
setup.py
2
setup.py
@ -71,7 +71,7 @@ setup(
|
|||||||
"hyperframe>=5.0, <6",
|
"hyperframe>=5.0, <6",
|
||||||
"jsbeautifier>=1.6.3, <1.7",
|
"jsbeautifier>=1.6.3, <1.7",
|
||||||
"kaitaistruct>=0.7, <0.8",
|
"kaitaistruct>=0.7, <0.8",
|
||||||
"ldap3>=2.2.0, <2.2.3",
|
"ldap3>=2.2.0, <=2.2.3",
|
||||||
"passlib>=1.6.5, <1.8",
|
"passlib>=1.6.5, <1.8",
|
||||||
"pyasn1>=0.1.9, <0.3",
|
"pyasn1>=0.1.9, <0.3",
|
||||||
"pyOpenSSL>=16.0, <17.1",
|
"pyOpenSSL>=16.0, <17.1",
|
||||||
|
@ -2,7 +2,6 @@ import binascii
|
|||||||
import ldap3
|
import ldap3
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from _pytest.monkeypatch import MonkeyPatch
|
|
||||||
|
|
||||||
from mitmproxy import exceptions
|
from mitmproxy import exceptions
|
||||||
from mitmproxy.addons import proxyauth
|
from mitmproxy.addons import proxyauth
|
||||||
@ -46,7 +45,6 @@ def test_configure():
|
|||||||
ctx.configure(up, proxyauth="ldap:fake_server:fake_dn:fake_group")
|
ctx.configure(up, proxyauth="ldap:fake_server:fake_dn:fake_group")
|
||||||
assert up.ldapserver
|
assert up.ldapserver
|
||||||
|
|
||||||
|
|
||||||
ctx.configure(up, proxyauth="ldap:fake_server:uid=?,dc=example,dc=com:person")
|
ctx.configure(up, proxyauth="ldap:fake_server:uid=?,dc=example,dc=com:person")
|
||||||
assert up.ldapserver
|
assert up.ldapserver
|
||||||
ctx.configure(up, proxyauth="ldaps:fake_server.com:uid=?,dc=example,dc=com:person")
|
ctx.configure(up, proxyauth="ldaps:fake_server.com:uid=?,dc=example,dc=com:person")
|
||||||
@ -126,7 +124,6 @@ def test_check(monkeypatch):
|
|||||||
)
|
)
|
||||||
assert not up.check(f)
|
assert not up.check(f)
|
||||||
|
|
||||||
|
|
||||||
ctx.configure(
|
ctx.configure(
|
||||||
up,
|
up,
|
||||||
proxyauth="ldap:fake-server:cn=?,ou=test,o=lab:test"
|
proxyauth="ldap:fake-server:cn=?,ou=test,o=lab:test"
|
||||||
@ -134,8 +131,10 @@ def test_check(monkeypatch):
|
|||||||
conn = ldap3.Connection("fake-server", user="cn=user0,ou=test,o=lab", password="password", client_strategy=ldap3.MOCK_SYNC)
|
conn = ldap3.Connection("fake-server", user="cn=user0,ou=test,o=lab", password="password", client_strategy=ldap3.MOCK_SYNC)
|
||||||
conn.bind()
|
conn.bind()
|
||||||
conn.strategy.add_entry('cn=user0,ou=test,o=lab', {'userPassword': 'test0', 'sn': 'user0_sn', 'revision': 0, 'objectClass': 'test'})
|
conn.strategy.add_entry('cn=user0,ou=test,o=lab', {'userPassword': 'test0', 'sn': 'user0_sn', 'revision': 0, 'objectClass': 'test'})
|
||||||
|
|
||||||
def conn_mp(ldap, user, password, **kwargs):
|
def conn_mp(ldap, user, password, **kwargs):
|
||||||
return conn
|
return conn
|
||||||
|
|
||||||
monkeypatch.setattr(ldap3, "Connection", conn_mp)
|
monkeypatch.setattr(ldap3, "Connection", conn_mp)
|
||||||
f.request.headers["Proxy-Authorization"] = proxyauth.mkauth(
|
f.request.headers["Proxy-Authorization"] = proxyauth.mkauth(
|
||||||
"user0", "test0"
|
"user0", "test0"
|
||||||
|
Loading…
Reference in New Issue
Block a user