MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_socks5_auth_fail

Function test_socks5_auth_fail

test/mitmproxy/proxy/layers/test_modes.py:543–567  ·  view source on GitHub ↗
(
    client_greeting: bytes,
    server_choice: bytes,
    client_auth: bytes,
    err: bytes,
    msg: str,
    tctx: Context,
)

Source from the content-addressed store, hash-verified

541 ],
542)
543def test_socks5_auth_fail(
544 client_greeting: bytes,
545 server_choice: bytes,
546 client_auth: bytes,
547 err: bytes,
548 msg: str,
549 tctx: Context,
550):
551 ProxyAuth().load(tctx.options)
552 tctx.options.proxyauth = "user:password"
553 playbook = Playbook(modes.Socks5Proxy(tctx), logs=True) >> DataReceived(
554 tctx.client, client_greeting
555 )
556 if server_choice is None:
557 playbook << SendData(tctx.client, err)
558 else:
559 playbook << SendData(tctx.client, server_choice)
560 playbook >> DataReceived(tctx.client, client_auth)
561 playbook << modes.Socks5AuthHook(Placeholder(modes.Socks5AuthData))
562 playbook >> reply()
563 playbook << SendData(tctx.client, err)
564
565 playbook << CloseConnection(tctx.client)
566 playbook << Log(msg)
567 assert playbook
568
569
570def test_socks5_eager_err(tctx: Context):

Callers

nothing calls this directly

Calls 9

ProxyAuthClass · 0.90
PlaybookClass · 0.90
DataReceivedClass · 0.90
SendDataClass · 0.90
PlaceholderFunction · 0.90
replyClass · 0.90
CloseConnectionClass · 0.90
LogClass · 0.90
loadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…