MCPcopy Index your code
hub / github.com/RustPython/RustPython / authenticate

Method authenticate

Lib/imaplib.py:504–530  ·  view source on GitHub ↗

Authenticate command - requires response processing. 'mechanism' specifies which authentication mechanism is to be used - it must appear in .capabilities in the form AUTH= . 'authobject' must be a callable object: data = authobje

(self, mechanism, authobject)

Source from the content-addressed store, hash-verified

502
503
504 def authenticate(self, mechanism, authobject):
505 """Authenticate command - requires response processing.
506
507 'mechanism' specifies which authentication mechanism is to
508 be used - it must appear in <instance>.capabilities in the
509 form AUTH=<mechanism>.
510
511 'authobject' must be a callable object:
512
513 data = authobject(response)
514
515 It will be called to process server continuation responses; the
516 response argument it is passed will be a bytes. It should return bytes
517 data that will be base64 encoded and sent to the server. It should
518 return None if the client abort response '*' should be sent instead.
519 """
520 mech = mechanism.upper()
521 # XXX: shouldn't this code be removed, not commented out?
522 #cap = 'AUTH=%s' % mech
523 #if not cap in self.capabilities: # Let the server decide!
524 # raise self.error("Server doesn't allow %s authentication." % mech)
525 self.literal = _Authenticator(authobject).process
526 typ, dat = self._simple_command('AUTHENTICATE', mech)
527 if typ != 'OK':
528 raise self.error(dat[-1].decode('utf-8', 'replace'))
529 self.state = 'AUTH'
530 return typ, dat
531
532
533 def capability(self):

Calls 5

_simple_commandMethod · 0.95
_AuthenticatorClass · 0.85
upperMethod · 0.45
errorMethod · 0.45
decodeMethod · 0.45