MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / authenticate

Method authenticate

tools/python-3.11.9-amd64/Lib/imaplib.py:420–446  ·  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 =

(self, mechanism, authobject)

Source from the content-addressed store, hash-verified

418
419
420 def authenticate(self, mechanism, authobject):
421 """Authenticate command - requires response processing.
422
423 'mechanism' specifies which authentication mechanism is to
424 be used - it must appear in <instance>.capabilities in the
425 form AUTH=<mechanism>.
426
427 'authobject' must be a callable object:
428
429 data = authobject(response)
430
431 It will be called to process server continuation responses; the
432 response argument it is passed will be a bytes. It should return bytes
433 data that will be base64 encoded and sent to the server. It should
434 return None if the client abort response '*' should be sent instead.
435 """
436 mech = mechanism.upper()
437 # XXX: shouldn't this code be removed, not commented out?
438 #cap = 'AUTH=%s' % mech
439 #if not cap in self.capabilities: # Let the server decide!
440 # raise self.error("Server doesn't allow %s authentication." % mech)
441 self.literal = _Authenticator(authobject).process
442 typ, dat = self._simple_command('AUTHENTICATE', mech)
443 if typ != 'OK':
444 raise self.error(dat[-1].decode('utf-8', 'replace'))
445 self.state = 'AUTH'
446 return typ, dat
447
448
449 def capability(self):

Callers 1

login_cram_md5Method · 0.95

Calls 5

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

Tested by

no test coverage detected