packages feed

mattermost-api 50200.11.0 → 50200.12.0

raw patch · 8 files changed

+20/−7 lines, 8 filesdep ~aesonPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: aeson

API changes (from Hackage documentation)

+ Network.Mattermost: [otpToken] :: Login -> Maybe Text
+ Network.Mattermost.Lenses: otpTokenL :: Lens' Login (Maybe Text)
+ Network.Mattermost.Types: [otpToken] :: Login -> Maybe Text
- Network.Mattermost: Login :: Text -> Text -> Login
+ Network.Mattermost: Login :: Text -> Maybe Text -> Text -> Login
- Network.Mattermost.Types: Login :: Text -> Text -> Login
+ Network.Mattermost.Types: Login :: Text -> Maybe Text -> Text -> Login

Files

CHANGELOG.md view
@@ -1,4 +1,13 @@ +50200.12.0+==========++Package changes:+ * Changed Aeson dependency to 2.0 to support GHC 9.++New features:+ * 2FA support (thanks @msm-code)+ 50200.11.0 ========== 
README.md view
@@ -1,5 +1,6 @@ [![Hackage](https://img.shields.io/hackage/v/mattermost-api.svg)](https://hackage.haskell.org/package/mattermost-api) [![Build Status](https://travis-ci.org/matterhorn-chat/mattermost-api.svg?branch=master)](https://travis-ci.org/matterhorn-chat/mattermost-api)+[![Build status](https://github.com/matterhorn-chat/mattermost-api/actions/workflows/ci.yml/badge.svg)](https://github.com/matterhorn-chat/mattermost-api/actions/workflows/ci.yml) # mattermost-api  Client-side API for communicating with a Mattermost server, written in
mattermost-api.cabal view
@@ -1,5 +1,5 @@ name:                mattermost-api-version:             50200.11.0+version:             50200.12.0 synopsis:            Client API for Mattermost chat system  description:         Client API for Mattermost chat system.  Mattermost is a@@ -49,7 +49,7 @@   build-depends:       base >=4.4 && <5                      , websockets >= 0.11.0.0                      , stm-                     , aeson >= 1.0.0.0+                     , aeson >= 2.0.1.0 && < 2.1.0.0                      , connection                      , memory                      , resource-pool >= 0.2.3
src/Network/Mattermost.hs view
@@ -140,6 +140,7 @@ import           Network.HTTP.Stream ( simpleHTTP_ ) import           Data.HashMap.Strict ( HashMap ) import qualified Data.HashMap.Strict as HM+import qualified Data.Aeson.KeyMap as KM import           Data.Aeson ( Value(..)                             , ToJSON(..)                             , FromJSON@@ -1065,7 +1066,7 @@                                               (show $ rspCode rsp)         in case eitherDecode $ BL.pack $ rspBody rsp of             Right (Object o) ->-                case HM.lookup "message" o of+                case KM.lookup "message" o of                     Just (String msg) ->                         let newMsg = (T.pack $ "Error requesting " <> show path <> ": ") <> msg                         in throwIO $ MattermostServerError newMsg
src/Network/Mattermost/Proxy.hs view
@@ -36,12 +36,10 @@                         go [] [] = True                         go [] _ = False                         go _ [] = False-                        go (p:pParts) hParts =+                        go (p:pParts) (h:hTail) =                             if p == "*"                             then True-                            else case hParts of-                                [] -> False-                                (h:hTail) -> p == h && go pParts hTail+                            else p == h && go pParts hTail                     in go patParts hostnameParts             return $ not isBlacklisted 
src/Network/Mattermost/Types.hs view
@@ -120,11 +120,13 @@ data Login   = Login   { username :: Text+  , otpToken :: Maybe Text   , password :: Text   } deriving (Show)  instance A.ToJSON Login where   toJSON l = A.object ["login_id" A..= username l+                      ,"token" A..= (fromMaybe "" $ otpToken l)                       ,"password" A..= password l                       ] 
test/Main.hs view
@@ -45,6 +45,7 @@ testUserLogin = Login   { username = "test-user"   , password = "password"+  , otpToken = Nothing   }  testMinChannel :: TeamId -> MinChannel
test/Tests/Util.hs view
@@ -297,6 +297,7 @@     cfg <- gets tsConfig     let admin = Login { username = configUsername cfg                       , password = configPassword cfg+                      , otpToken = Nothing                       }     loginAccount admin