network-protocol-xmpp 0.4.4 → 0.4.5
raw patch · 4 files changed
+16/−12 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Network.Protocol.XMPP: AuthenticationFailure :: Error
+ Network.Protocol.XMPP: AuthenticationFailure :: Element -> Error
Files
- lib/Network/Protocol/XMPP/Client/Authentication.hs +4/−4
- lib/Network/Protocol/XMPP/Component.hs +1/−1
- lib/Network/Protocol/XMPP/Monad.hs +5/−1
- network-protocol-xmpp.cabal +6/−6
lib/Network/Protocol/XMPP/Client/Authentication.hs view
@@ -37,7 +37,7 @@ import qualified Network.Protocol.XMPP.XML as X import Network.Protocol.XMPP.JID (JID, formatJID, jidResource) -data Result = Success | Failure+data Result = Success | Failure X.Element deriving (Show, Eq) data AuthException = XmppError M.Error | SaslError Text@@ -65,7 +65,7 @@ Just mechanism -> authSasl ctx mechanism case res of Right Success -> return ()- Right Failure -> E.throwError M.AuthenticationFailure+ Right (Failure e) -> E.throwError (M.AuthenticationFailure e) Left (XmppError err) -> E.throwError err Left (SaslError err) -> E.throwError (M.AuthenticationError err) @@ -119,7 +119,7 @@ SASL.NeedsMore -> saslError "Server didn't provide enough SASL data." -- The server has rejected this client's credentials.- n | n == "{urn:ietf:params:xml:ns:xmpp-sasl}failure" -> return Failure+ n | n == "{urn:ietf:params:xml:ns:xmpp-sasl}failure" -> return (Failure e) _ -> saslError ("Server sent unexpected element during authentication.") @@ -128,7 +128,7 @@ elemt <- getElement ctx return $ if X.elementName elemt == "{urn:ietf:params:xml:ns:xmpp-sasl}success" then Success- else Failure+ else Failure elemt putElement :: M.Session -> X.Element -> SASL.Session () putElement ctx elemt = liftIO $ do
lib/Network/Protocol/XMPP/Component.hs view
@@ -74,7 +74,7 @@ M.putElement (X.element "handshake" [] [X.NodeContent (X.ContentText digest)]) result <- M.getElement let nameHandshake = "{jabber:component:accept}handshake"- when (null (X.isNamed nameHandshake result)) (throwError M.AuthenticationFailure)+ when (null (X.isNamed nameHandshake result)) (throwError (M.AuthenticationFailure result)) buildSecret :: Text -> Text -> ByteString buildSecret sid password = encodeUtf8 (X.escape (Data.Text.append sid password))
lib/Network/Protocol/XMPP/Monad.hs view
@@ -57,7 +57,11 @@ data Error -- | The remote host refused the specified authentication credentials.- = AuthenticationFailure+ --+ -- The included XML element is the error value that the server+ -- provided. It may contain additional information about why+ -- authentication failed.+ = AuthenticationFailure X.Element -- | There was an error while authenticating with the remote host. | AuthenticationError Text
network-protocol-xmpp.cabal view
@@ -1,5 +1,5 @@ name: network-protocol-xmpp-version: 0.4.4+version: 0.4.5 license: GPL-3 license-file: license.txt author: John Millikin <jmillikin@gmail.com>, Stephan Maka <stephan@spaceboyz.net>@@ -15,13 +15,13 @@ description: source-repository head- type: bazaar- location: https://john-millikin.com/branches/network-protocol-xmpp/0.4/+ type: git+ location: https://john-millikin.com/code/haskell-xmpp/ source-repository this- type: bazaar- location: https://john-millikin.com/branches/network-protocol-xmpp/0.4/- tag: network-protocol-xmpp_0.4.4+ type: git+ location: https://john-millikin.com/code/haskell-xmpp/+ tag: network-protocol-xmpp_0.4.5 library ghc-options: -Wall -O2