Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions twisted/cred/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def registerChecker(self, checker, *credentialInterfaces):
self.checkers[credentialInterface] = checker


def login(self, credentials, mind, *interfaces):
def login(self, credentials, mind, *interfaces, **transport):
"""
@param credentials: an implementor of
L{twisted.cred.credentials.ICredentials}
Expand Down Expand Up @@ -116,7 +116,7 @@ def login(self, credentials, mind, *interfaces):
"""
for i in self.checkers:
if i.providedBy(credentials):
return maybeDeferred(self.checkers[i].requestAvatarId, credentials
return maybeDeferred(self.checkers[i].requestAvatarId, credentials, transport.get('transport'),
).addCallback(self.realm.requestAvatar, mind, *interfaces
)
ifac = providedBy(credentials)
Expand Down
4 changes: 2 additions & 2 deletions twisted/mail/imap4.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ def __cbAuthChunk(self, result, chal, tag):
if chal.moreChallenges():
self._setupChallenge(chal, tag)
else:
self.portal.login(chal, None, IAccount).addCallbacks(
self.portal.login(chal, None, IAccount, transport=self.transport).addCallbacks(
self.__cbAuthResp,
self.__ebAuthResp,
(tag,), None, (tag,), None
Expand Down Expand Up @@ -1077,7 +1077,7 @@ def authenticateLogin(self, user, passwd):
if self.portal:
return self.portal.login(
credentials.UsernamePassword(user, passwd),
None, IAccount
None, IAccount, transport=self.transport
)
raise UnauthorizedLogin()

Expand Down
6 changes: 4 additions & 2 deletions twisted/mail/smtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,8 @@ def validateFrom(self, helo, origin):
result = self.portal.login(
cred.credentials.Anonymous(),
None,
IMessageDeliveryFactory, IMessageDelivery)
IMessageDeliveryFactory, IMessageDelivery,
transport=self.transport)

def ebAuthentication(err):
"""
Expand Down Expand Up @@ -1799,7 +1800,8 @@ def state_AUTH(self, response):
self.mode = COMMAND
result = self.portal.login(
self.challenger, None,
IMessageDeliveryFactory, IMessageDelivery)
IMessageDeliveryFactory, IMessageDelivery,
transport=self.transport)
result.addCallback(self._cbAuthenticated)
result.addCallback(lambda ign: self.sendCode(235, 'Authentication successful.'))
result.addErrback(self._ebAuthenticated)
Expand Down