Package pyxmpp :: Module streamsasl :: Class StreamSASLMixIn

[hide private]

# Class StreamSASLMixIn

source code

    sasl.core.PasswordManager --+
                                |
                               StreamSASLMixIn

Known Subclasses:
  - stream.Stream

SASL authentication mix-in class for XMPP stream.

Instance Methods | [hide private]

__init__(self, sasl_mechanisms=`(``)`) Initialize Stream object | source code

_handle_sasl_features(self) Process incoming <stream:features/> element. | source code

_make_stream_sasl_features(self, features) Add SASL features to the <features/> element of the stream. | source code

`bool`

_process_node_sasl(self, xmlnode) Process incoming stream element. | source code

_process_sasl_abort(self) Process incoming <sasl:abort/> element. | source code

_process_sasl_auth(self, mechanism, content) Process incoming <sasl:auth/> element. | source code

_process_sasl_challenge(self, content) Process incoming <sasl:challenge/> element. | source code

_process_sasl_failure(self, xmlnode) Process incoming <sasl:failure/> element. | source code

_process_sasl_node(self, xmlnode) Process stream element in the SASL namespace. | source code

_process_sasl_response(self, content) Process incoming <sasl:response/> element. | source code

_process_sasl_success(self, content) Process incoming <sasl:success/> element. | source code

_reset_sasl(self) Reset StreamSASLMixIn object state making it ready to handle new connections. | source code

_sasl_authenticate(self, username, authzid, mechanism=None) Start SASL authentication process. | source code

Inherited from `sasl.core.PasswordManager`: `check_authzid`, `check_password`, `choose_realm`, `generate_nonce`, `get_password`, `get_realms`, `get_serv_host`, `get_serv_name`, `get_serv_type`

Method Details | [hide private]

### __init__(self, sasl_mechanisms=`(``)`)
(Constructor)

source code

Initialize Stream object

Parameters:
  - `sasl_mechanisms` - : sequence of SASL mechanisms allowed for authentication. Currently "PLAIN", "DIGEST-MD5" and "GSSAPI" are supported.
Overrides: sasl.core.PasswordManager.__init__

### _handle_sasl_features(self)

source code

Process incoming <stream:features/> element.

[initiating entity only]

The received features node is available in `self.features`.

### _make_stream_sasl_features(self, features)

source code

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

[receving entity only]

Returns:
  update <features/> element node.

### _process_node_sasl(self, xmlnode)

source code

Process incoming stream element. Pass it to _process_sasl_node if it is in the SASL namespace.

Returns: `bool`
  `True` when the node was recognized as a SASL element.

### _process_sasl_abort(self)

source code

Process incoming <sasl:abort/> element.

[receiving entity only]

### _process_sasl_auth(self, mechanism, content)

source code

Process incoming <sasl:auth/> element.

[receiving entity only]

Parameters:
  - `mechanism` - : mechanism choosen by the peer.
  - `content` - : optional "initial response" included in the element.

### _process_sasl_challenge(self, content)

source code

Process incoming <sasl:challenge/> element.

[initiating entity only]

Parameters:
  - `content` - : the challenge data received (Base64-encoded).

### _process_sasl_failure(self, xmlnode)

source code

Process incoming <sasl:failure/> element.

[initiating entity only]

Parameters:
  - `xmlnode` - : the XML node received.

### _process_sasl_node(self, xmlnode)

source code

Process stream element in the SASL namespace.

Parameters:
  - `xmlnode` - : the XML node received

### _process_sasl_response(self, content)

source code

Process incoming <sasl:response/> element.

[receiving entity only]

Parameters:
  - `content` - : the response data received (Base64-encoded).

### _process_sasl_success(self, content)

source code

Process incoming <sasl:success/> element.

[initiating entity only]

Parameters:
  - `content` - : the "additional data with success" received (Base64-encoded).

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

source code

Start SASL authentication process.

[initiating entity only]

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