MCPcopy
hub / github.com/scrapy/scrapy / login

Method login

scrapy/extensions/telnet.py:89–101  ·  view source on GitHub ↗
(self_, credentials, mind, *interfaces)

Source from the content-addressed store, hash-verified

87 """An implementation of IPortal"""
88
89 def login(self_, credentials, mind, *interfaces): # type: ignore[no-untyped-def] # pylint: disable=no-self-argument
90 if not (
91 credentials.username == self.username.encode("utf8")
92 and credentials.checkPassword(self.password.encode("utf8"))
93 ):
94 return fail(ValueError("Invalid credentials"))
95
96 from twisted.conch import manhole
97
98 protocol = telnet.TelnetBootstrapProtocol(
99 insults.ServerProtocol, manhole.Manhole, self._get_telnet_vars()
100 )
101 return succeed((interfaces[0], protocol, lambda: None))
102
103 return telnet.TelnetTransport(telnet.AuthenticatingTelnetProtocol, Portal())
104

Callers 6

ftp_store_fileFunction · 0.80
_stat_fileMethod · 0.80
test_bad_credentialsMethod · 0.80
test_good_credentialsMethod · 0.80

Calls 1

_get_telnet_varsMethod · 0.80

Tested by 4

test_bad_credentialsMethod · 0.64
test_good_credentialsMethod · 0.64