Skip to content

Commit

Permalink
Format source code and cabal.
Browse files Browse the repository at this point in the history
  • Loading branch information
freizl committed Apr 6, 2017
1 parent 6147a2d commit 61bb17b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 50 deletions.
79 changes: 40 additions & 39 deletions hoauth2.cabal
Expand Up @@ -3,24 +3,25 @@ Name: hoauth2
Version: 0.5.9

Synopsis: Haskell OAuth2 authentication client

Description:
Haskell OAuth2 authentication client. Tested with the following services:
.
* Google: <https://developers.google.com/accounts/docs/OAuth2WebServer>
.
* Github: <http://developer.github.com/v3/oauth/>
.
* Facebook: <http://developers.facebook.com/docs/facebook-login/>
.
* Fitbit: <http://dev.fitbit.com/docs/oauth2/>
.
* StackExchange: <https://api.stackexchange.com/docs/authentication>
.
* DropBox: <https://www.dropbox.com/developers/reference/oauth-guide>
.
* Weibo: <http://open.weibo.com/wiki/Oauth2>
.
* Douban: <http://developers.douban.com/wiki/?title=oauth2>
Haskell OAuth2 authentication client. Tested with the following services:
.
* Google: <https://developers.google.com/accounts/docs/OAuth2WebServer>
.
* Github: <http://developer.github.com/v3/oauth/>
.
* Facebook: <http://developers.facebook.com/docs/facebook-login/>
.
* Fitbit: <http://dev.fitbit.com/docs/oauth2/>
.
* StackExchange: <https://api.stackexchange.com/docs/authentication>
.
* DropBox: <https://www.dropbox.com/developers/reference/oauth-guide>
.
* Weibo: <http://open.weibo.com/wiki/Oauth2>
.
* Douban: <http://developers.douban.com/wiki/?title=oauth2>

Homepage: https://github.com/freizl/hoauth2
License: BSD3
Expand All @@ -34,14 +35,14 @@ stability: Beta
tested-with: GHC <= 7.10.2

Extra-source-files:
README.md
example/Google/test.hs
example/Weibo/test.hs
example/Github/test.hs
example/Facebook/test.hs
example/Fitbit/test.hs
example/Douban/test.hs
example/Keys.hs.sample
README.md
example/Google/test.hs
example/Weibo/test.hs
example/Github/test.hs
example/Facebook/test.hs
example/Fitbit/test.hs
example/Douban/test.hs
example/Keys.hs.sample

Cabal-version: >=1.10

Expand All @@ -57,22 +58,22 @@ Library
hs-source-dirs: src
default-language: Haskell2010
Exposed-modules:
Network.OAuth.OAuth2.HttpClient
Network.OAuth.OAuth2.Internal
Network.OAuth.OAuth2
Network.OAuth.OAuth2.HttpClient
Network.OAuth.OAuth2.Internal
Network.OAuth.OAuth2

Build-Depends:
base >= 4 && < 5,
aeson >= 1.0 && < 1.1,
text >= 0.11 && < 1.3,
bytestring >= 0.9 && < 0.11,
http-conduit >= 2.1 && < 2.3,
http-types >= 0.9 && < 0.10,
aeson >= 0.11 && < 1.2,
unordered-containers >= 0.2.5,
uri-bytestring >= 0.2.3.1 && < 0.3,
microlens >= 0.4.0 && < 0.5,
exceptions >= 0.8.3 && < 0.9
base >= 4 && < 5,
aeson >= 1.0 && < 1.1,
text >= 0.11 && < 1.3,
bytestring >= 0.9 && < 0.11,
http-conduit >= 2.1 && < 2.3,
http-types >= 0.9 && < 0.10,
aeson >= 0.11 && < 1.2,
unordered-containers >= 0.2.5,
uri-bytestring >= 0.2.3.1 && < 0.3,
microlens >= 0.4.0 && < 0.5,
exceptions >= 0.8.3 && < 0.9

if impl(ghc >= 6.12.0)
ghc-options: -Wall -fwarn-tabs -funbox-strict-fields
Expand Down
4 changes: 2 additions & 2 deletions src/Network/OAuth/OAuth2/HttpClient.hs
Expand Up @@ -196,7 +196,7 @@ parseResponseString (Left b) = Left b
parseResponseString (Right b) = case parseQuery $ BSL.toStrict b of
[] -> Left errorMessage
a -> case fromJSON $ queryToValue a of
Error _ -> Left errorMessage
Error _ -> Left errorMessage
Success x -> Right x
where
queryToValue = Object . HM.fromList . map paramToPair
Expand All @@ -209,7 +209,7 @@ parseResponseFlexible :: FromJSON a
-> OAuth2Result a
parseResponseFlexible r = case parseResponseJSON r of
Left _ -> parseResponseString r
x -> x
x -> x

-- | Set several header values:
-- + userAgennt : `hoauth2`
Expand Down
18 changes: 9 additions & 9 deletions src/Network/OAuth/OAuth2/Internal.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections #-}

{-# OPTIONS_HADDOCK -ignore-exports #-}

Expand All @@ -10,20 +10,20 @@

module Network.OAuth.OAuth2.Internal where

import Control.Monad.Catch
import Data.Aeson
import Data.Aeson.Types
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BSL
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BSL
import Data.Maybe
import Data.Text (Text)
import Data.Text.Encoding
import Data.Text (Text)
import GHC.Generics
import URI.ByteString
import Lens.Micro
import Lens.Micro.Extras
import Network.HTTP.Conduit as C
import Control.Monad.Catch
import qualified Network.HTTP.Types as H
import qualified Network.HTTP.Types as H
import URI.ByteString

--------------------------------------------------
-- * Data Types
Expand Down

0 comments on commit 61bb17b

Please sign in to comment.