Commit a3731961 authored by Clint Adams's avatar Clint Adams

gitit: Upgrading from 0.12.2.1+dfsg to 0.12.3.1

parent 369ced9e
gitit (0.12.3.1+dfsg-1) unstable; urgency=medium
* New upstream version. closes: #900302.
-- Clint Adams <clint@debian.org> Mon, 31 Dec 2018 18:10:40 -0500
gitit (0.12.2.1+dfsg-6) unstable; urgency=medium
* Remove build dependency on libghc-parsec3-dev (provided by ghc-
......
......@@ -29,7 +29,7 @@ Build-Depends:
libghc-sha-dev (<< 1.7),
libghc-sha-prof,
libghc-aeson-dev (>= 0.7),
libghc-aeson-dev (<< 1.2),
libghc-aeson-dev (<< 1.5),
libghc-aeson-prof,
libghc-base64-bytestring-dev (<< 1.1),
libghc-base64-bytestring-dev (>= 0.1),
......@@ -37,25 +37,17 @@ Build-Depends:
libghc-blaze-html-dev (>= 0.4),
libghc-blaze-html-dev (<< 0.10),
libghc-blaze-html-prof,
libghc-configfile-dev (<< 1.2),
libghc-configfile-dev (>= 1),
libghc-configfile-prof,
libghc-feed-dev (<< 0.4),
libghc-feed-dev (>= 0.3.6),
libghc-feed-dev (>= 1.0),
libghc-feed-dev (<< 1.1),
libghc-feed-prof,
libghc-filestore-dev (<< 0.7),
libghc-filestore-dev (>= 0.6),
libghc-filestore-prof,
libghc-ghc-paths-dev,
libghc-ghc-paths-prof,
libghc-happstack-server-dev (<< 7.5),
libghc-happstack-server-dev (>= 7.0),
libghc-happstack-server-dev (<< 7.6),
libghc-happstack-server-prof,
libghc-highlighting-kate-dev (<< 0.7),
libghc-highlighting-kate-dev (>= 0.5.0.1),
libghc-highlighting-kate-prof,
libghc-hoauth2-dev (<< 1.6),
libghc-hoauth2-dev (>= 1.3.0),
libghc-hoauth2-dev (<< 1.9),
libghc-hoauth2-prof,
libghc-hslogger-dev (<< 1.3),
libghc-hslogger-dev (>= 1),
......@@ -63,8 +55,8 @@ Build-Depends:
libghc-http-client-tls-dev (>= 0.2.2),
libghc-http-client-tls-dev (<< 0.4),
libghc-http-client-tls-prof,
libghc-http-conduit-dev (>= 2.1.4),
libghc-http-conduit-dev (<< 2.3),
libghc-http-conduit-dev (>= 2.1.6),
libghc-http-conduit-dev (<< 2.4),
libghc-http-conduit-prof,
libghc-http-dev (<< 1:4000.4),
libghc-http-dev (>= 1:4000.0),
......@@ -81,10 +73,9 @@ Build-Depends:
libghc-old-locale-prof,
libghc-old-time-dev,
libghc-old-time-prof,
libghc-pandoc-dev (>= 1.12.4),
libghc-pandoc-dev (<< 1.20),
libghc-pandoc-dev (>= 2.2),
libghc-pandoc-prof,
libghc-pandoc-types-dev (>= 1.12.3),
libghc-pandoc-types-dev (>= 1.17.4.2),
libghc-pandoc-types-dev (<< 1.18),
libghc-pandoc-types-prof,
libghc-random-dev,
......@@ -93,9 +84,9 @@ Build-Depends:
libghc-recaptcha-prof,
libghc-safe-dev,
libghc-safe-prof,
libghc-sha-dev (<< 1.7),
libghc-sha-dev (>> 1),
libghc-sha-prof,
libghc-skylighting-dev (>= 0.7.4),
libghc-skylighting-dev (<< 0.8),
libghc-skylighting-prof,
libghc-split-dev,
libghc-split-prof,
libghc-syb-dev,
......@@ -103,13 +94,11 @@ Build-Depends:
libghc-tagsoup-dev (>= 0.13),
libghc-tagsoup-dev (<< 0.15),
libghc-tagsoup-prof,
libghc-uri-bytestring-dev (<< 0.4),
libghc-uri-bytestring-dev (>= 0.2.3.3),
libghc-uri-dev (<< 0.2),
libghc-uri-dev (>= 0.1),
libghc-uri-prof,
libghc-url-dev (<< 2.2),
libghc-uri-bytestring-dev (<= 0.4),
libghc-uri-bytestring-prof,
libghc-url-dev (>= 2.1),
libghc-url-dev (<< 2.2),
libghc-url-prof,
libghc-utf8-string-dev (<< 1.1),
libghc-utf8-string-dev (>= 0.3),
......@@ -119,8 +108,11 @@ Build-Depends:
libghc-uuid-prof,
libghc-xml-dev (>= 1.3.5),
libghc-xml-prof,
libghc-xss-sanitize-dev (<< 0.4),
libghc-xml-conduit-dev (>= 1.5),
libghc-xml-conduit-dev (<< 1.9),
libghc-xml-conduit-prof,
libghc-xss-sanitize-dev (>= 0.3),
libghc-xss-sanitize-dev (<< 0.4),
libghc-xss-sanitize-prof,
libghc-zlib-dev (<< 0.7),
libghc-zlib-dev (>= 0.5),
......@@ -140,7 +132,6 @@ Build-Depends-Indep:
libghc-filestore-doc,
libghc-ghc-paths-doc,
libghc-happstack-server-doc,
libghc-highlighting-kate-doc,
libghc-hoauth2-doc,
libghc-hslogger-doc,
libghc-hstringtemplate-doc,
......@@ -157,18 +148,19 @@ Build-Depends-Indep:
libghc-random-doc,
libghc-recaptcha-doc,
libghc-safe-doc,
libghc-sha-doc,
libghc-skylighting-doc,
libghc-split-doc,
libghc-syb-doc,
libghc-tagsoup-doc,
libghc-uri-doc,
libghc-uri-bytestring-doc,
libghc-url-doc,
libghc-utf8-string-doc,
libghc-uuid-doc,
libghc-xml-doc,
libghc-xml-conduit-doc,
libghc-xss-sanitize-doc,
libghc-zlib-doc,
Standards-Version: 4.1.4
Standards-Version: 4.3.0
Homepage: http://gitit.net
Vcs-Browser: https://salsa.debian.org/haskell-team/DHG_packages/tree/master/p/gitit
Vcs-Git: https://salsa.debian.org/haskell-team/DHG_packages.git [p/gitit]
......
......@@ -15,7 +15,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
- data/static/js/jquery-ui.draggable-1.6rc2.js
- data/static/js/jquery-ui.tabs-1.6rc2.js
data-files: data/static/css/screen.css, data/static/css/print.css,
data/static/css/ie.css, data/static/css/hk-pyg.css,
data/static/css/ie.css, data/static/css/highlighting.css,
data/static/css/reset-fonts-grids.css,
data/static/css/custom.css,
data/static/img/logo.png, data/static/img/icons/feed.png,
......@@ -23,7 +23,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
- data/static/js/dragdiff.js, data/static/js/jquery-1.2.6.min.js,
- data/static/js/uploadForm.js, data/static/js/jquery-ui-combined-1.6rc2.min.js,
- data/static/js/jquery.hotkeys-0.7.9.min.js,
+ data/static/js/dragdiff.js,
+ data/static/js/dragdiff.js,
+ data/static/js/uploadForm.js,
data/static/js/preview.js, data/static/js/search.js,
data/static/js/MathMLinHTML.js, data/static/js/footnotes.js,
......
From 3f6252d7c312f68e5023a6c575bdfb76fc6ad19d Mon Sep 17 00:00:00 2001
From: Myron Wu <myronwu@gmail.com>
Date: Wed, 15 Nov 2017 19:16:28 -0800
Subject: [PATCH] Bumping hoauth2 to 1.3.0 && < 1.6 to catch up with nix and
other curated package sets
---
gitit.cabal | 3 +-
src/Network/Gitit/Authentication/Github.hs | 39 +++++++++++++++++------------
src/Network/Gitit/Config.hs | 26 ++++++++++++-------
3 files changed, 42 insertions(+), 26 deletions(-)
Index: b/gitit.cabal
===================================================================
--- a/gitit.cabal
+++ b/gitit.cabal
@@ -159,8 +159,9 @@ Library
blaze-html >= 0.4 && < 0.10,
json >= 0.4 && < 0.10,
uri >= 0.1 && < 0.2,
+ uri-bytestring >= 0.2.3.3 && <= 0.4,
split,
- hoauth2 >= 0.4.2 && < 0.6,
+ hoauth2 >= 1.3.0 && < 1.6,
http-conduit >= 2.1.4 && < 2.3,
http-client-tls >= 0.2.2 && < 0.4,
aeson >= 0.7 && < 1.2,
Index: b/src/Network/Gitit/Authentication/Github.hs
===================================================================
--- a/src/Network/Gitit/Authentication/Github.hs
+++ b/src/Network/Gitit/Authentication/Github.hs
@@ -12,9 +12,10 @@ import Network.Gitit.Server
import Network.Gitit.State
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy as BSL
+import qualified URI.ByteString as URI
import Network.HTTP.Conduit
-import Network.HTTP.Client.TLS
import Network.OAuth.OAuth2
+import Network.OAuth.OAuth2.TokenRequest as OA
import Control.Monad (liftM, mplus, mzero)
import Data.Maybe
import Data.Aeson
@@ -35,8 +36,8 @@ loginGithubUser githubKey = do
addCookie (MaxAge $ sessionTimeout cfg) (mkCookie "sid" (show key))
let usingOrg = isJust $ org $ githubAuth cfg
let scopes = "user:email" ++ if usingOrg then ",read:org" else ""
- let url = authorizationUrl githubKey `appendQueryParam` [("state", BS.pack state), ("scope", BS.pack scopes)]
- seeOther (BS.unpack url) $ toResponse ("redirecting to github" :: String)
+ let url = appendQueryParams [("state", BS.pack state), ("scope", BS.pack scopes)] $ authorizationUrl githubKey
+ seeOther (BS.unpack (URI.serializeURIRef' url)) $ toResponse ("redirecting to github" :: String)
data GithubLoginError = GithubLoginError { ghUserMessage :: String
, ghDetails :: Maybe String
@@ -57,13 +58,13 @@ getGithubUser ghConfig githubCallbackPar
let (Just code) = rCode githubCallbackPars
ifSuccess
"No access token found yet"
- (fetchAccessToken mgr (oAuth2 ghConfig) (sToBS code))
+ (fetchAccessToken mgr (oAuth2 ghConfig) (ExchangeToken $ pack code))
(\at -> ifSuccess
"User Authentication failed"
- (userInfo mgr at)
+ (userInfo mgr (accessToken at))
(\githubUser -> ifSuccess
("No email for user " ++ unpack (gLogin githubUser) ++ " returned by Github")
- (mailInfo mgr at)
+ (mailInfo mgr (accessToken at))
(\githubUserMail -> do
let gitLogin = gLogin githubUser
user <- mkUser (unpack gitLogin)
@@ -74,7 +75,7 @@ getGithubUser ghConfig githubCallbackPar
Nothing -> return $ Right user
Just githuborg -> ifSuccess
("Membership check failed: the user " ++ unpack gitLogin ++ " is required to be a member of the organization " ++ unpack githuborg ++ ".")
- (orgInfo gitLogin githuborg mgr at)
+ (orgInfo gitLogin githuborg mgr (accessToken at))
(\_ -> return $ Right user))))
else
return $ Left $
@@ -97,17 +98,26 @@ instance FromData GithubCallbackPars whe
vState <- liftM Just (look "state") `mplus` return Nothing
return GithubCallbackPars {rCode = vCode, rState = vState}
-userInfo :: Manager -> AccessToken -> IO (OAuth2Result GithubUser)
-userInfo mgr token = authGetJSON mgr token "https://api.github.com/user"
+userInfo :: Manager -> AccessToken -> IO (OAuth2Result OA.Errors GithubUser)
+userInfo mgr token = authGetJSON mgr token $ githubUri "/user"
-mailInfo :: Manager -> AccessToken -> IO (OAuth2Result [GithubUserMail])
-mailInfo mgr token = authGetJSON mgr token "https://api.github.com/user/emails"
+mailInfo :: Manager -> AccessToken -> IO (OAuth2Result OA.Errors [GithubUserMail])
+mailInfo mgr token = authGetJSON mgr token $ githubUri "/user/emails"
-orgInfo :: Text -> Text -> Manager -> AccessToken -> IO (OAuth2Result BSL.ByteString)
+orgInfo :: Text -> Text -> Manager -> AccessToken -> IO (OAuth2Result OA.Errors BSL.ByteString)
orgInfo gitLogin githubOrg mgr token = do
- let url = "https://api.github.com/orgs/" `BS.append` encodeUtf8 githubOrg `BS.append` "/members/" `BS.append` encodeUtf8 gitLogin
+ let url = githubUri $ "/orgs/" `BS.append` encodeUtf8 githubOrg `BS.append` "/members/" `BS.append` encodeUtf8 gitLogin
authGetBS mgr token url
+type UriPath = BS.ByteString
+
+githubUri :: UriPath -> URI.URI
+githubUri p = URI.URI { URI.uriScheme = URI.Scheme "https"
+ , URI.uriAuthority = Just $ URI.Authority Nothing (URI.Host "api.github.com") Nothing
+ , URI.uriPath = p
+ , URI.uriQuery = URI.Query []
+ , URI.uriFragment = Nothing }
+
data GithubUser = GithubUser { gLogin :: Text
} deriving (Show, Eq)
@@ -125,6 +135,3 @@ instance FromJSON GithubUserMail where
<$> o .: "email"
<*> o .: "primary"
parseJSON _ = mzero
-
-sToBS :: String -> BS.ByteString
-sToBS = encodeUtf8 . pack
Index: b/src/Network/Gitit/Config.hs
===================================================================
--- a/src/Network/Gitit/Config.hs
+++ b/src/Network/Gitit/Config.hs
@@ -40,7 +40,8 @@ import Paths_gitit (getDataFileName)
import System.FilePath ((</>))
import Text.Pandoc hiding (MathML, WebTeX, MathJax)
import qualified Control.Exception as E
-import Network.OAuth.OAuth2
+import Network.OAuth.OAuth2 (OAuth2(..), oauthCallback, oauthOAuthorizeEndpoint, oauthClientId, oauthClientSecret)
+import URI.ByteString (parseURI, laxURIParserOptions)
import qualified Data.ByteString.Char8 as BS
import Network.Gitit.Compat.Except
import Control.Monad
@@ -253,21 +254,28 @@ extractGithubConfig :: (Functor m, Mona
extractGithubConfig cp = do
cfOauthClientId <- getGithubProp "oauthClientId"
cfOauthClientSecret <- getGithubProp "oauthClientSecret"
- cfOauthCallback <- getGithubProp "oauthCallback"
- cfOauthOAuthorizeEndpoint <- getGithubProp "oauthOAuthorizeEndpoint"
- cfOauthAccessTokenEndpoint <- getGithubProp "oauthAccessTokenEndpoint"
+ cfOauthCallback <- getUrlProp "oauthCallback"
+ cfOauthOAuthorizeEndpoint <- getUrlProp "oauthOAuthorizeEndpoint"
+ cfOauthAccessTokenEndpoint <- getUrlProp "oauthAccessTokenEndpoint"
cfOrg <- if hasGithubProp "github-org"
then fmap Just (getGithubProp "github-org")
else return Nothing
- let cfgOAuth2 = OAuth2 { oauthClientId = BS.pack cfOauthClientId
- , oauthClientSecret = BS.pack cfOauthClientSecret
- , oauthCallback = Just $ BS.pack cfOauthCallback
- , oauthOAuthorizeEndpoint = BS.pack cfOauthOAuthorizeEndpoint
- , oauthAccessTokenEndpoint = BS.pack cfOauthAccessTokenEndpoint
+ let cfgOAuth2 = OAuth2 { oauthClientId = pack cfOauthClientId
+ , oauthClientSecret = pack cfOauthClientSecret
+ , oauthCallback = Just cfOauthCallback
+ , oauthOAuthorizeEndpoint = cfOauthOAuthorizeEndpoint
+ , oauthAccessTokenEndpoint = cfOauthAccessTokenEndpoint
}
return $ githubConfig cfgOAuth2 $ fmap pack cfOrg
where getGithubProp = get cp "Github"
hasGithubProp = has_option cp "Github"
+ getUrlProp prop = getGithubProp prop >>= \s ->
+ case parseURI laxURIParserOptions (BS.pack s) of
+ Left e -> throwError (ParseError $ "couldn't parse url " ++ s
+ ++ " from (Github/" ++ prop ++ "): "
+ ++ (show e)
+ , "getUrlProp")
+ Right uri -> return uri
fromQuotedMultiline :: String -> String
fromQuotedMultiline = unlines . map doline . lines . dropWhile (`elem` " \t\n")
clean-cabal-file.patch
jquery.patch
git_bump_hoauth2_3f6252d7.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment