Package pyxmpp2 :: Module streamsasl :: Class StreamSASLHandler
[hide private]

Class StreamSASLHandler


SASL authentication handler XMPP streams.
Nested Classes [hide private]

Inherited from interfaces.StreamFeatureHandler: __metaclass__

Instance Methods [hide private]
 
__init__(self, settings=None)
Initialize the SASL handler
 
make_stream_features(self, stream, features)
Add SASL features to the <features/> element of the stream.
 
handle_stream_features(self, stream, features)
Process incoming <stream:features/> element.
 
process_sasl_auth(self, stream, element)
Process incoming <sasl:auth/> element.
 
_process_sasl_challenge(self, stream, element)
Process incoming <sasl:challenge/> element.
 
_process_sasl_response(self, stream, element)
Process incoming <sasl:response/> element.
 
_process_sasl_success(self, stream, element)
Process incoming <sasl:success/> element.
 
_process_sasl_failure(self, stream, element)
Process incoming <sasl:failure/> element.
 
_process_sasl_abort(self, stream, element)
Process incoming <sasl:abort/> element.
 
_sasl_authenticate(self, stream, username, authzid, mechanism=None)
Start SASL authentication process.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from interfaces.StreamFeatureHandler: __abstractmethods__

Instance Variables [hide private]
sasl.ClientAuthenticator or sasl.ServerAuthenticator authenticator
the authenticator object
list of unicode peer_sasl_mechanisms
SASL mechanisms offered by peer
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, settings=None)
(Constructor)

 
Initialize the SASL handler
Overrides: object.__init__

make_stream_features(self, stream, features)

 

Add SASL features to the <features/> element of the stream.

[receving entity only]

Parameters:
  • stream - the stream
  • features - the features element about to be sent
Returns:
update <features/> element.
Overrides: interfaces.StreamFeatureHandler.make_stream_features

handle_stream_features(self, stream, features)

 

Process incoming <stream:features/> element.

[initiating entity only]

Parameters:
  • stream - the stream
  • features - the features element just received
Returns:
Overrides: interfaces.StreamFeatureHandler.handle_stream_features

process_sasl_auth(self, stream, element)

 

Process incoming <sasl:auth/> element.

[receiving entity only]

Decorators:
  • @stream_element_handler(AUTH_TAG, "receiver")

_process_sasl_challenge(self, stream, element)

 

Process incoming <sasl:challenge/> element.

[initiating entity only]

Decorators:
  • @stream_element_handler(CHALLENGE_TAG, "initiator")

_process_sasl_response(self, stream, element)

 

Process incoming <sasl:response/> element.

[receiving entity only]

Decorators:
  • @stream_element_handler(RESPONSE_TAG, "receiver")

_process_sasl_success(self, stream, element)

 

Process incoming <sasl:success/> element.

[initiating entity only]

Decorators:
  • @stream_element_handler(SUCCESS_TAG, "initiator")

_process_sasl_failure(self, stream, element)

 

Process incoming <sasl:failure/> element.

[initiating entity only]

Decorators:
  • @stream_element_handler(FAILURE_TAG, "initiator")

_process_sasl_abort(self, stream, element)

 

Process incoming <sasl:abort/> element.

[receiving entity only]

Decorators:
  • @stream_element_handler(ABORT_TAG, "receiver")

_sasl_authenticate(self, stream, username, authzid, mechanism=None)

 

Start SASL authentication process.

[initiating entity only]

Parameters:
  • username - user name.
  • authzid - authorization ID.
  • mechanism - SASL mechanism to use.