module Network.Xmpp.Sasl.Types where
import Control.Monad.Error
import Control.Monad.State.Strict
import Data.ByteString(ByteString)
import qualified Data.Text as Text
import Network.Xmpp.Types
data AuthError = AuthXmlError
| AuthNoAcceptableMechanism [Text.Text]
| AuthChallengeError
| AuthServerAuthError
| AuthStreamError StreamError
| AuthConnectionError
| AuthError
| AuthSaslFailure SaslFailure
| AuthStringPrepError
deriving Show
instance Error AuthError where
noMsg = AuthError
data SaslElement = SaslSuccess (Maybe Text.Text)
| SaslChallenge (Maybe Text.Text)
type SaslM a = ErrorT AuthError (StateT XmppConnection IO) a
type Pairs = [(ByteString, ByteString)]
type SaslHandler = (Text.Text, SaslM ())