From c9d22ed159aaed9cb3d25b58266e13dbeab58aad Mon Sep 17 00:00:00 2001 From: Marco Zocca Date: Mon, 30 Oct 2023 23:12:34 +0100 Subject: [PATCH] graph: move out hoauth2 in favor of ms-auth --- ms-azure-api/src/MSAzureAPI/Internal/Common.hs | 5 ++++- ms-graph-api/CHANGELOG.md | 2 ++ ms-graph-api/ms-graph-api.cabal | 4 ++-- ms-graph-api/stack.yaml | 3 +++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ms-azure-api/src/MSAzureAPI/Internal/Common.hs b/ms-azure-api/src/MSAzureAPI/Internal/Common.hs index 43fce03..3f58448 100644 --- a/ms-azure-api/src/MSAzureAPI/Internal/Common.hs +++ b/ms-azure-api/src/MSAzureAPI/Internal/Common.hs @@ -56,7 +56,7 @@ import qualified Data.ByteString.Lazy as LBS (ByteString) import qualified Data.ByteString.Lazy.Char8 as LBS8 (pack, unpack, putStrLn) -- http-client import Network.HTTP.Client (Manager) -import qualified Network.HTTP.Client as L (RequestBody(..)) +import qualified Network.HTTP.Client as L (RequestBody(..), Response(..)) -- http-client-tls import Network.HTTP.Client.TLS (newTlsManager) -- modern-uri @@ -67,10 +67,13 @@ import MSAuth (OAuth2Token(..), AccessToken(..), ExchangeToken(..), RefreshToken import Network.HTTP.Req (Req, runReq, HttpBody(..), HttpConfig(..), HttpException(..), defaultHttpConfig, req, Option, (=:), GET(..), POST(..), PUT(..), DELETE(..), Url, Scheme(..), urlQ, useHttpsURI, https, (/:), ReqBodyJson(..), NoReqBody(..), oAuth2Bearer, HttpResponse(..), jsonResponse, JsonResponse, lbsResponse, LbsResponse, bsResponse, BsResponse, responseBody, responseHeader) -- text import Data.Text (Text, pack, unpack) +-- transformers +import Control.Monad.Trans.Reader (ReaderT) -- unliftio import UnliftIO (MonadUnliftIO(..)) import UnliftIO.Exception (try) + -- | URL parameters (==:) :: Text -- ^ key -> Text -- ^ value diff --git a/ms-graph-api/CHANGELOG.md b/ms-graph-api/CHANGELOG.md index 0490f0e..d0f627f 100644 --- a/ms-graph-api/CHANGELOG.md +++ b/ms-graph-api/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to the ## Unreleased +- get rid of `hoauth` in favor of `ms-auth` + ## 0.11.0.0 .Users.Group diff --git a/ms-graph-api/ms-graph-api.cabal b/ms-graph-api/ms-graph-api.cabal index 9187d0d..0945643 100644 --- a/ms-graph-api/ms-graph-api.cabal +++ b/ms-graph-api/ms-graph-api.cabal @@ -1,5 +1,5 @@ name: ms-graph-api -version: 0.11.0.0 +version: 0.12.0.0 synopsis: Microsoft Graph API description: Bindings to the Microsoft Graph API homepage: https://github.com/unfoldml/ms-graph-api @@ -31,11 +31,11 @@ library , base >= 4.7 && < 5 , bytestring , containers - , hoauth2 == 2.6.0 , http-client >= 0.7.13.1 , http-client-tls >= 0.3 , http-types , modern-uri + , ms-auth , req , scientific , text diff --git a/ms-graph-api/stack.yaml b/ms-graph-api/stack.yaml index 737c277..6883668 100644 --- a/ms-graph-api/stack.yaml +++ b/ms-graph-api/stack.yaml @@ -31,11 +31,14 @@ resolver: # - wai packages: - . +- ../ms-auth + # Dependency packages to be pulled from upstream that are not in the resolver. # These entries can reference officially published versions as well as # forks / in-progress versions pinned to a git hash. For extra: # extra-deps: +- dotenv-micro-0.1.0.1@sha256:7cc4d8ad8452b2b8fd1e4c0b1d3ee69ceebb73c98f1697d1dd647a1e820afdf5,1520 - validation-micro-1.0.0.0 - selective-0.6