on master help sign in
12 files changed+463−140
since splitsnapshots
unifiedsplit
.gitignore+2−1 README.md+25−1 github-app.cabal+74 package.yaml+12−4 src/Crypto/PubKey/RSA/Read.hs+27 src/GitHub/App.hs−131 src/GitHub/App/Auth.hs+187 src/GitHub/App/Request.hs+40 src/GitHub/Data/Apps.hs+31 src/GitHub/Data/Installations.hs+34 stack.yaml+5−3 stack.yaml.lock+26
.gitignore+2−1
@@ -3,4 +3,5 @@
33cabal.project.local
44cabal.project.local~
55.ghc.environment.*
6−*.cabal
6+
7+.stack-work
README.md+25−1
@@ -1 +1,25 @@
1−# github-app
1+# Authenticate as a GitHub App
2+
3+This library provides functions that help with authenticating as a [GitHub App][ghapp].
4+
5+
6+## Use
7+
8+1. [Register][reg] your App with GitHub to obtain an App ID and a private key.
9+2. Using the data from the step above, create `AppAuth`.
10+3. For each installation of your app, get an `InstallationAuth` using `mkInstallationAuth`.
11+4. Use the `executeAppRequest` function to execute requests.
12+ Behind the scenes, this function exchanges the installation auth token for
13+ a regular access token, caches it, and renews as needed.
14+
15+See [serokell/github-ops-access][ghopsa] for a real-life example use.
16+
17+[ghapp]: https://developer.github.com/apps/
18+[reg]: https://github.com/settings/apps
19+[ghopsa]: https://github.com/serokell/github-ops-access/blob/test/webhook/Main.hs
20+
21+
22+## About Serokell
23+
24+This library is maintained and funded with ❤️ by [Serokell](https://serokell.io/).
25+The names and logo for Serokell are trademark of Serokell OÜ.
github-app.cabalnew file+74
@@ -0,0 +1,74 @@
1+cabal-version: 1.12
2+
3+-- This file has been generated from package.yaml by hpack version 0.38.1.
4+--
5+-- see: https://github.com/sol/hpack
6+
7+name: github-app
8+version: 0.0.1
9+synopsis: Authetnicate as a GitHub App
10+description: Please see the README on GitHub at <https://github.com/serokell/github-app#readme>
11+category: Network
12+homepage: https://github.com/serokell/github-app#readme
13+bug-reports: https://github.com/serokell/github-app/issues
14+author: Serokell
15+maintainer: Kirill Elagin <kirelagin@serokell.io>
16+copyright: 2018 Serokell
17+license: MPL-2.0
18+license-file: LICENSE
19+build-type: Simple
20+extra-source-files:
21+ README.md
22+ ChangeLog.md
23+
24+source-repository head
25+ type: git
26+ location: https://github.com/serokell/github-app
27+
28+library
29+ exposed-modules:
30+ Crypto.PubKey.RSA.Read
31+ GitHub.App.Auth
32+ GitHub.App.Request
33+ GitHub.Data.Apps
34+ GitHub.Data.Installations
35+ other-modules:
36+ Paths_github_app
37+ hs-source-dirs:
38+ src
39+ default-extensions:
40+ ApplicativeDo
41+ DeriveDataTypeable
42+ DeriveGeneric
43+ FlexibleContexts
44+ FlexibleInstances
45+ GeneralizedNewtypeDeriving
46+ LambdaCase
47+ MultiParamTypeClasses
48+ NamedFieldPuns
49+ OverloadedStrings
50+ RankNTypes
51+ RecordWildCards
52+ ScopedTypeVariables
53+ StandaloneDeriving
54+ TemplateHaskell
55+ TupleSections
56+ TypeApplications
57+ build-depends:
58+ aeson
59+ , base >=4.7 && <5
60+ , bytestring
61+ , cryptonite
62+ , github
63+ , http-client
64+ , http-client-tls
65+ , http-types
66+ , jwt >=0.8.0
67+ , mtl
68+ , safe-exceptions
69+ , tagged
70+ , text
71+ , time
72+ , x509
73+ , x509-store
74+ default-language: Haskell2010
package.yaml+12−4
@@ -15,6 +15,7 @@ extra-source-files:
1515
1616default-extensions:
1717 - ApplicativeDo
18+ - DeriveDataTypeable
1819 - DeriveGeneric
1920 - FlexibleContexts
2021 - FlexibleInstances
@@ -24,6 +25,7 @@ default-extensions:
2425 - NamedFieldPuns
2526 - OverloadedStrings
2627 - RankNTypes
28+ - RecordWildCards
2729 - ScopedTypeVariables
2830 - StandaloneDeriving
2931 - TemplateHaskell
@@ -38,10 +40,16 @@ library:
3840 dependencies:
3941 - aeson
4042 - bytestring
41− - crypto-pubkey-types
42− - data-default-class
43+ - cryptonite
4344 - github
44− - jwt
45− - req
45+ - http-client
46+ - http-client-tls
47+ - http-types
48+ - jwt >= 0.8.0
49+ - mtl
50+ - safe-exceptions
51+ - tagged
4652 - text
4753 - time
54+ - x509
55+ - x509-store
src/Crypto/PubKey/RSA/Read.hsnew file+27
@@ -0,0 +1,27 @@
1+{- This Source Code Form is subject to the terms of the Mozilla Public
2+ - License, v. 2.0. If a copy of the MPL was not distributed with this
3+ - file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+ -}
5+
6+module Crypto.PubKey.RSA.Read
7+ ( ReadRsaKeyError (..)
8+ , readRsaPem
9+ ) where
10+
11+import Crypto.PubKey.RSA (PrivateKey)
12+import Data.X509 (PrivKey (PrivKeyRSA))
13+import Data.ByteString (ByteString)
14+import Data.X509.Memory (readKeyFileFromMemory)
15+
16+
17+data ReadRsaKeyError
18+ = SingleKeyExpected { rrkeActualKeysCount :: Int }
19+ | NotRsaKey
20+
21+readRsaPem :: ByteString -> Either ReadRsaKeyError PrivateKey
22+readRsaPem bs =
23+ case readKeyFileFromMemory bs of
24+ [k] -> case k of
25+ PrivKeyRSA rsaKey -> Right rsaKey
26+ _ -> Left NotRsaKey
27+ l -> Left $ SingleKeyExpected (length l)
src/GitHub/App.hsdeleted−131
@@ -1,131 +0,0 @@
1−{- This Source Code Form is subject to the terms of the Mozilla Public
2− - License, v. 2.0. If a copy of the MPL was not distributed with this
3− - file, You can obtain one at http://mozilla.org/MPL/2.0/.
4− -}
5−
6−module GitHub.App
7− ( InstallationAuth
8− , mkInstallationAuth
9−
10− , authenticateInstallation
11− ) where
12−
13−import Prelude hiding (exp)
14−
15−import Control.Concurrent (MVar, newEmptyMVar, putMVar, readMVar, takeMVar)
16−import Control.Monad (void)
17−import Crypto.Types.PubKey.RSA (PrivateKey (..))
18−import Data.Aeson (FromJSON (..), withObject, (.:))
19−import Data.ByteString (ByteString)
20−import Data.Default.Class (def)
21−import Data.Semigroup ((<>))
22−import Data.Text (Text)
23−import qualified Data.Text as T
24−import Data.Text.Encoding (encodeUtf8)
25−import Data.Time (NominalDiffTime, UTCTime, addUTCTime, defaultTimeLocale, diffUTCTime,
26− getCurrentTime, iso8601DateFormat, parseTimeM)
27−import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds)
28−import GitHub.Auth (Auth (..))
29−import Network.HTTP.Req (NoReqBody (..), Option, POST (..), Url, header, https, jsonResponse, req,
30− responseBody, runReq, (/:))
31−import Web.JWT (JSON, JWTClaimsSet (..), Signer (..), encodeSigned, numericDate, stringOrURI)
32−
33−
34−-- | JWT expiration time. Maximum accepted by GitHub is 10 minutes
35−jwtExpTime :: NominalDiffTime
36−jwtExpTime = 600
37−
38−-- | Installation access token expiration time. It is fixed by GitHub and is equal to 1 hour
39−instKeyExpTime :: NominalDiffTime
40−instKeyExpTime = 3600
41−
42−-- | When to renew the installation access token
43−--
44−-- We renew the access token when it is valid for less than 'bufferTime'
45−-- just to be on the safe side.
46−bufferTime :: NominalDiffTime
47−bufferTime = instKeyExpTime * 0.25
48−
49−
50−-- | Base URL of the GitHub API
51−baseURL :: Text
52−baseURL = "api.github.com"
53−
54−
55−type InstallationId = Text
56−
57−
58−-- | GitHub installation access token
59−data InstallationToken = InstallationToken
60− { itToken :: ByteString
61− , itExpirationTime :: UTCTime
62− } deriving (Show)
63−
64−instance FromJSON InstallationToken where
65− parseJSON = withObject "installation token" $ \o -> InstallationToken
66− <$> (encodeUtf8 <$> o .: "token")
67− <*> (either fail pure =<< parseExpiresAt <$> o .: "expires_at")
68− where
69− parseExpiresAt :: String -> Either String UTCTime
70− parseExpiresAt = parseTimeM True defaultTimeLocale (iso8601DateFormat (Just "%H:%M:%SZ"))
71−
72−-- | Credentials required for an app to authenticate as an installation
73−data InstallationAuth = InstallationAuth
74− { iaAppId :: !Int -- ^ Application id
75− , iaAppPrivateKey :: !PrivateKey -- ^ Private key to sign token requests
76− , iaInstallationId :: !Text -- ^ Installation id
77− , iaToken :: !(MVar InstallationToken) -- ^ Installation Auth token
78− }
79−
80−-- | Return a valid App access token
81−--
82−-- Checks if the cached token is expired and renews it if needed.
83−authenticateInstallation :: InstallationAuth -> IO Auth
84−authenticateInstallation ia@InstallationAuth{iaToken} = do
85− InstallationToken{itToken, itExpirationTime} <- readMVar iaToken
86− currentTime <- getCurrentTime
87− if itExpirationTime `diffUTCTime` currentTime >= bufferTime
88− then return $ OAuth itToken
89− else do
90− void $ takeMVar iaToken
91− renewInstAuthToken ia
92− InstallationToken{itToken = newToken} <- readMVar iaToken
93− return $ OAuth newToken
94−
95−-- | Smart constructor for 'InstallationAuth'
96−mkInstallationAuth :: Int -> PrivateKey -> InstallationId -> IO InstallationAuth
97−mkInstallationAuth applicationId key instId = do
98− tokenVar <- newEmptyMVar
99− let instAuth = InstallationAuth applicationId key instId tokenVar
100− renewInstAuthToken instAuth
101− return instAuth
102−
103−-- | Get a new token from GitHub and cache it in 'InstallationAuth'
104−--
105−-- Assumes that the MVar in 'InstallationAuth' is empty. Otherwise will block.
106−renewInstAuthToken :: InstallationAuth -> IO ()
107−renewInstAuthToken InstallationAuth{iaAppId, iaInstallationId, iaAppPrivateKey, iaToken} = do
108− time <- getCurrentTime
109− let jwt = makeJWT time
110− t <- request (https baseURL /: "installations" /: iaInstallationId /: "access_tokens") mempty jwt
111− putMVar iaToken t
112− where
113− -- | Create a JSON Web Token for the given application id using application's private key
114− makeJWT :: UTCTime -> JSON
115− makeJWT currentTime =
116− let currDate = numericDate . utcTimeToPOSIXSeconds $ currentTime
117− expDate = numericDate . utcTimeToPOSIXSeconds $ jwtExpTime `addUTCTime` currentTime
118− issuer = stringOrURI . T.pack . show $ iaAppId
119− jwtClaimsSet = mempty {iss = issuer, iat = currDate, exp = expDate}
120− in encodeSigned (RSAPrivateKey iaAppPrivateKey) jwtClaimsSet
121−
122− -- | Make a request to GitHub to get an installation Auth token
123− request :: FromJSON m => Url scheme -> Option scheme -> JSON -> IO m
124− request url opts jwt = runReq def $ responseBody <$>
125− req POST url NoReqBody
126− jsonResponse -- specify how to interpret response
127− ( header "Authorization" ("Bearer " <> encodeUtf8 jwt)
128− <> header "Accept" "application/vnd.github.machine-man-preview+json"
129− <> header "user-agent" "Haskell/github-app (Haskell/req)"
130− <> opts
131− )
src/GitHub/App/Auth.hsnew file+187
@@ -0,0 +1,187 @@
1+{- This Source Code Form is subject to the terms of the Mozilla Public
2+ - License, v. 2.0. If a copy of the MPL was not distributed with this
3+ - file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+ -}
5+
6+{-# LANGUAGE CPP #-}
7+{-# LANGUAGE DataKinds #-}
8+
9+module GitHub.App.Auth
10+ ( AppAuth (..)
11+
12+ , InstallationAuth
13+ , mkInstallationAuth
14+
15+ , obtainAccessToken
16+ ) where
17+
18+import Prelude hiding (exp)
19+
20+import Control.Concurrent (MVar, newMVar, putMVar, readMVar, takeMVar)
21+import Control.Exception.Safe (bracketOnError, catch)
22+import Control.Monad.Except (ExceptT, MonadError (throwError), runExceptT)
23+import Control.Monad.Trans (lift)
24+import Crypto.PubKey.RSA (PrivateKey)
25+import Data.Aeson (FromJSON (..), withObject, (.:))
26+import qualified Data.ByteString.Lazy as LBS
27+import Data.Functor (($>))
28+import Data.Maybe (fromMaybe)
29+import Data.Semigroup ((<>))
30+import Data.Tagged
31+import Data.Text (Text)
32+import qualified Data.Text as T
33+import Data.Text.Encoding (encodeUtf8)
34+import Data.Time (NominalDiffTime, UTCTime, diffUTCTime, getCurrentTime)
35+import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds)
36+import GitHub.Auth (Auth (OAuth))
37+import GitHub.Data.Apps (App)
38+import GitHub.Data.Definitions (Error (HTTPError))
39+import GitHub.Data.Id (Id, untagId)
40+import GitHub.Data.Installations (Installation)
41+import GitHub.Request (StatusMap, parseResponseJSON)
42+import Network.HTTP.Client as HTTP
43+import qualified Network.HTTP.Client.Internal as HTTP
44+import qualified Network.HTTP.Types as HTTP
45+import Web.JWT (JWTClaimsSet (exp, iat, iss), Signer (RSAPrivateKey), encodeSigned, numericDate,
46+ stringOrURI)
47+
48+
49+-- | JWT expiration time. Maximum accepted by GitHub is 10 minutes
50+jwtExpTime :: NominalDiffTime
51+jwtExpTime = 300
52+
53+-- | Installation access token expiration time. It is fixed by GitHub and is equal to 1 hour
54+instKeyExpTime :: NominalDiffTime
55+instKeyExpTime = 3600
56+
57+-- | When to renew the installation access token
58+--
59+-- We renew the access token when it is valid for less than 'bufferTime'
60+-- just to be on the safe side.
61+bufferTime :: NominalDiffTime
62+bufferTime = instKeyExpTime * 0.25
63+
64+baseUrl :: Text
65+baseUrl = "https://api.github.com"
66+
67+
68+-- | Credentials of a GitHub App
69+data AppAuth = AppAuth
70+ { aaAppId :: !(Id App)
71+ , aaPrivateKey :: !PrivateKey
72+ }
73+
74+-- | Cached GitHub installation access token
75+data InstallationToken = InstallationToken
76+ { itToken :: !Auth
77+ , itExpirationTime :: !UTCTime
78+ } deriving (Show)
79+
80+instance FromJSON InstallationToken where
81+ parseJSON = withObject "Installation access token" $ \o ->
82+ InstallationToken
83+ <$> (OAuth . encodeUtf8 <$> o .: "token")
84+ <*> o .: "expires_at"
85+
86+
87+-- | Credentials required for an App to authenticate as an installation
88+data InstallationAuth = InstallationAuth
89+ { iaClaimsSet :: !JWTClaimsSet -- ^ Prefilled claims set
90+ , iaAppPrivateKey :: !PrivateKey -- ^ Private key to sign token requests
91+ , iaInstallationId :: !Text -- ^ Installation id
92+ , iaToken :: !(MVar (Maybe InstallationToken)) -- ^ Installation Auth token
93+ }
94+
95+
96+-- | Smart constructor for 'InstallationAuth'
97+mkInstallationAuth
98+ :: AppAuth
99+ -> Id Installation
100+ -> IO InstallationAuth
101+mkInstallationAuth AppAuth{aaAppId, aaPrivateKey} instId = do
102+ varToken <- newMVar Nothing
103+ let issuer = fromMaybe (error "impossible") . stringOrURI . T.pack . show . untagId $ aaAppId
104+ claimsSet = mempty { iss = Just issuer }
105+ pure $ InstallationAuth claimsSet aaPrivateKey (T.pack . show . untagId $ instId) varToken
106+
107+-- | Create a request which, when executed, will obtain a new access token
108+createAccessTokenR :: InstallationAuth -> IO HTTP.Request
109+createAccessTokenR InstallationAuth{..} = do
110+ currentTime <- utcTimeToPOSIXSeconds <$> getCurrentTime
111+ let expiryTime = currentTime + jwtExpTime
112+ claims = iaClaimsSet
113+ { iat = Just $ toJsonTime currentTime
114+ , exp = Just $ toJsonTime expiryTime
115+ }
116+ jwt = encodeSigned (RSAPrivateKey iaAppPrivateKey) mempty claims
117+
118+ req <- HTTP.parseRequest . T.unpack $ url
119+ pure req
120+ { HTTP.requestHeaders =
121+ [ ("Authorization", "Bearer " <> encodeUtf8 jwt)
122+ , ("Accept", "application/vnd.github.machine-man-preview+json")
123+ , ("User-Agent", "github-app/Haskell")
124+ ]
125+ , HTTP.checkResponse = successOrMissing Nothing
126+ , HTTP.method = "POST"
127+ }
128+ where
129+ toJsonTime = fromMaybe (error "impossible") . numericDate
130+ url = baseUrl <> "/installations/" <> iaInstallationId <> "/access_tokens"
131+
132+-- | Get a valid access token
133+--
134+-- Tries to use the cached one. If it is invalid, requests a new one
135+-- and caches it for future use.
136+obtainAccessToken
137+ :: Manager
138+ -> InstallationAuth
139+ -> IO (Either Error Auth)
140+obtainAccessToken mgr ia@InstallationAuth{..} = readMVar iaToken >>= \case
141+ Nothing -> renew
142+ Just InstallationToken{itToken, itExpirationTime} -> do
143+ currentTime <- getCurrentTime
144+ if itExpirationTime `diffUTCTime` currentTime < bufferTime
145+ then renew
146+ else pure $ Right itToken
147+ where
148+ renew :: IO (Either Error Auth)
149+ renew = bracketOnError (takeMVar iaToken) (putMVar iaToken) $ \_ -> do
150+ req <- createAccessTokenR ia
151+ result <- runExceptT $ httpLbs' req >>= parseResponseJSON
152+ case result of
153+ Right newToken -> putMVar iaToken (Just newToken) $> Right (itToken newToken)
154+ Left err -> putMVar iaToken Nothing $> Left err
155+
156+ httpLbs' :: HTTP.Request -> ExceptT Error IO (Response LBS.ByteString)
157+ httpLbs' req' = lift (httpLbs req' mgr) `catch` onHttpException
158+
159+
160+
161+---------------------------------------
162+-- Copy-pasted from the github package
163+---------------------------------------
164+
165+#if MIN_VERSION_http_client(0,5,0)
166+successOrMissing :: Maybe (StatusMap a) -> HTTP.Request -> HTTP.Response HTTP.BodyReader -> IO ()
167+successOrMissing sm _req res
168+ | check = pure ()
169+ | otherwise = do
170+ chunk <- HTTP.brReadSome (HTTP.responseBody res) 1024
171+ let res' = fmap (const ()) res
172+ HTTP.throwHttp $ HTTP.StatusCodeException res' (LBS.toStrict chunk)
173+ where
174+ HTTP.Status sci _ = HTTP.responseStatus res
175+#else
176+successOrMissing :: Maybe (StatusMap a) -> Status -> ResponseHeaders -> HTTP.CookieJar -> Maybe E.SomeException
177+successOrMissing sm s@(Status sci _) hs cookiejar
178+ | check = Nothing
179+ | otherwise = Just $ E.toException $ StatusCodeException s hs cookiejar
180+ where
181+#endif
182+ check = case sm of
183+ Nothing -> 200 <= sci && sci < 300
184+ Just sm' -> sci `elem` map fst sm'
185+
186+onHttpException :: MonadError Error m => HttpException -> m a
187+onHttpException = throwError . HTTPError
src/GitHub/App/Request.hsnew file+40
@@ -0,0 +1,40 @@
1+{- This Source Code Form is subject to the terms of the Mozilla Public
2+ - License, v. 2.0. If a copy of the MPL was not distributed with this
3+ - file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+ -}
5+
6+{-# LANGUAGE CPP #-}
7+
8+module GitHub.App.Request
9+ ( executeAppRequest
10+ , executeAppRequestWithMgr
11+ ) where
12+
13+import Data.Aeson (FromJSON)
14+import GitHub.Data (Error (..))
15+import GitHub.Data.Request (Request)
16+import GitHub.Request (executeRequestWithMgr)
17+import Network.HTTP.Client (Manager)
18+import Network.HTTP.Client.TLS (newTlsManager)
19+
20+import GitHub.App.Auth (InstallationAuth, obtainAccessToken)
21+
22+
23+executeAppRequest :: FromJSON a => InstallationAuth -> Request k a -> IO (Either Error a)
24+executeAppRequest instAuth req = do
25+ manager <- newTlsManager
26+ x <- executeAppRequestWithMgr manager instAuth req
27+#if !MIN_VERSION_http_client(0, 4, 18)
28+ closeManager manager
29+#endif
30+ pure x
31+
32+executeAppRequestWithMgr
33+ :: FromJSON a
34+ => Manager
35+ -> InstallationAuth
36+ -> Request k a
37+ -> IO (Either Error a)
38+executeAppRequestWithMgr mgr instAuth req = obtainAccessToken mgr instAuth >>= \case
39+ Right auth -> executeRequestWithMgr mgr auth req
40+ Left err -> pure $ Left err
src/GitHub/Data/Apps.hsnew file+31
@@ -0,0 +1,31 @@
1+{- This Source Code Form is subject to the terms of the Mozilla Public
2+ - License, v. 2.0. If a copy of the MPL was not distributed with this
3+ - file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+ -}
5+
6+{-# LANGUAGE CPP #-}
7+
8+module GitHub.Data.Apps where
9+
10+import GitHub.Data.Definitions (SimpleOwner)
11+import GitHub.Data.Id (Id)
12+import GitHub.Data.Name (Name)
13+import GitHub.Data.URL (URL)
14+import GitHub.Internal.Prelude
15+import Prelude ()
16+
17+
18+data App = App
19+ { appId :: !(Id App)
20+ , appOwner :: !SimpleOwner
21+ , appName :: !(Name App)
22+ , appDescription :: !(Maybe Text)
23+ , appExternalUrl :: !URL
24+ , appHtmlUrl :: !URL
25+ , appCreatedAt :: !(Maybe UTCTime)
26+ , appUpdatedAt :: !(Maybe UTCTime)
27+ }
28+ deriving (Show, Data, Typeable, Eq, Ord, Generic)
29+
30+instance NFData App where rnf = genericRnf
31+instance Binary App
src/GitHub/Data/Installations.hsnew file+34
@@ -0,0 +1,34 @@
1+{- This Source Code Form is subject to the terms of the Mozilla Public
2+ - License, v. 2.0. If a copy of the MPL was not distributed with this
3+ - file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+ -}
5+
6+{-# LANGUAGE CPP #-}
7+
8+module GitHub.Data.Installations where
9+
10+import GitHub.Data.Apps (App)
11+import GitHub.Data.Id (Id)
12+import GitHub.Data.URL (URL)
13+import GitHub.Internal.Prelude
14+import Prelude ()
15+
16+
17+data Installation = Installation
18+ { installationId :: !(Id Installation)
19+-- , installationAccount
20+ , installationAccesssTokensUrl :: !URL
21+ , installationRepositoriesUrl :: !URL
22+ , installationHtmlUrl :: !URL
23+ , installationAppId :: (Id App)
24+-- , installationTargetId
25+-- , installationTargetType
26+-- , installationPermissions
27+-- , installationEvents
28+-- , installationSingleFileName
29+-- , installationRepositorySelection
30+ }
31+ deriving (Show, Data, Typeable, Eq, Ord, Generic)
32+
33+instance NFData Installation where rnf = genericRnf
34+instance Binary Installation
stack.yaml+5−3
@@ -1,9 +1,11 @@
1−resolver: lts-11.5
1+resolver: lts-14.19
22
33packages:
44- .
55# Dependency packages to be pulled from upstream that are not in the resolver
66# using the same syntax as the packages field.
77# (e.g., acme-missiles-0.3)
8−extra-deps:
9− - jwt-0.8.0
8+extra-deps:
9+ - github-0.24
10+ - binary-instances-1
11+ # - jwt-0.8.0
stack.yaml.locknew file+26
@@ -0,0 +1,26 @@
1+# This file was autogenerated by Stack.
2+# You should not edit this file by hand.
3+# For more information, please see the documentation at:
4+# https://docs.haskellstack.org/en/stable/topics/lock_files
5+
6+packages:
7+- completed:
8+ hackage: github-0.24@sha256:4bf5a06289d36f78bf347b6a4f9906f659be7335cde78386a6c95568714a730b,6955
9+ pantry-tree:
10+ sha256: e0f84d7a3cdd76c6bd5395c8c72d24a1dda9616f857291820b08947c8290f042
11+ size: 7105
12+ original:
13+ hackage: github-0.24
14+- completed:
15+ hackage: binary-instances-1@sha256:b17565598b8df3241f9b46fa8e3a3368ecc8e3f2eb175d7c28f319042a6f5c79,2613
16+ pantry-tree:
17+ sha256: 938ffc6990cac12681c657f7afa93737eecf335e6f0212d8c0b7c1ea3e0f40f4
18+ size: 1035
19+ original:
20+ hackage: binary-instances-1
21+snapshots:
22+- completed:
23+ sha256: 9f79f6494473c9b46911364b94c4b5ef19ca8d35ebf62e46697cf651f198ee19
24+ size: 524155
25+ url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/14/19.yaml
26+ original: lts-14.19