node-xmpp/node-xmpp-server — pull request #6 by chris-rock (2013-12-02 14:31:45+00:00)
Title: Feature/md5

Should fix all points from discussion #3 and #5.

It changes a lot of internals. Thanks to @DevAlien for the amazing work to implement DigestMD5

I created a common interface for mechanisms to enable one step and multi-step mechanisms. All auth stanzas are forwarded and managed within the mechanism instance. Previously we just required one instance due to the fact that PLAIN and X-OAUTH2 are stateless mechanisms, but DIGEST-MD5 is a stateful mechanism. Therefore we create a new instance of the mechanism for each auth request.

Finally the mechanism calls the `success()` or `failure()` method. The `authenticate()` method triggers a authenticate event that is common across all event. An additional change: the an `authenticate()` response is not tightly coupled to `success` or `failure()`

One thing we need to improve for production use: `DigestMD5.manageAuth` need to ensure that the previous step happened always happened before. Therefore we need to improve the state handling.