hreinhardt/amqp — pull request #18 by gseitz (2013-09-04 22:09:48+00:00)
Title: Implement connection.secure.

Hi,
I saw that `connection.secure` was also on the TODO list and wanted to take a stab.
The authentication mechanisms `PLAIN` and `AMQPLAIN` are supported out of the box via helper functions.

I also added a function for the `RABBIT-CR-DEMO` mechanism to "prove" that the challenge<->response cycle works, although this should probably be moved to an example/test package.

Not sure if `IO` is really needed in the `saslChallengeFunc` field. But I can imagine that mechanism might need to do an additional lookup depending on the challenge in a database or user repository of some sort.

I'm not particularly happy with the 2 `fromMaybe`s, but there's pretty much no other way than to abort the connection process. Probably better to throw a `ConnectionClosedException` instead of using `error`.

As before, please let me know what you think and if you need anything changed. And thank you for your patience with me, as I'm still rather at the beginning of my haskell career ;)

Cheers