Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-http-client for openSUSE:Factory
checked in at 2021-03-10 08:54:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-http-client (Old)
and /work/SRC/openSUSE:Factory/.ghc-http-client.new.2378 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-http-client"
Wed Mar 10 08:54:54 2021 rev:42 rq:877632 version:0.7.6
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-http-client/ghc-http-client.changes
2021-02-16 22:48:23.590554251 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-http-client.new.2378/ghc-http-client.changes
2021-03-10 08:56:53.862866837 +0100
@@ -1,0 +2,8 @@
+Sun Feb 21 12:49:09 UTC 2021 - [email protected]
+
+- Update http-client to version 0.7.6.
+ ## 0.7.6
+
+ * Add `applyBearerAuth` function
[#457](https://github.com/snoyberg/http-client/pull/457/files)
+
+-------------------------------------------------------------------
Old:
----
http-client-0.7.5.tar.gz
New:
----
http-client-0.7.6.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-http-client.spec ++++++
--- /var/tmp/diff_new_pack.qPhB2h/_old 2021-03-10 08:56:54.950867960 +0100
+++ /var/tmp/diff_new_pack.qPhB2h/_new 2021-03-10 08:56:54.950867960 +0100
@@ -19,7 +19,7 @@
%global pkg_name http-client
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.7.5
+Version: 0.7.6
Release: 0
Summary: An HTTP client engine
License: MIT
++++++ http-client-0.7.5.tar.gz -> http-client-0.7.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.5/ChangeLog.md
new/http-client-0.7.6/ChangeLog.md
--- old/http-client-0.7.5/ChangeLog.md 2021-02-04 19:03:48.000000000 +0100
+++ new/http-client-0.7.6/ChangeLog.md 2021-02-21 07:16:45.000000000 +0100
@@ -1,5 +1,9 @@
# Changelog for http-client
+## 0.7.6
+
+* Add `applyBearerAuth` function
[#457](https://github.com/snoyberg/http-client/pull/457/files)
+
## 0.7.5
* Force closing connections in case of exceptions throwing
[#454](https://github.com/snoyberg/http-client/pull/454).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.5/Network/HTTP/Client/Request.hs
new/http-client-0.7.6/Network/HTTP/Client/Request.hs
--- old/http-client-0.7.5/Network/HTTP/Client/Request.hs 2021-02-04
19:03:48.000000000 +0100
+++ new/http-client-0.7.6/Network/HTTP/Client/Request.hs 2021-02-21
07:16:45.000000000 +0100
@@ -23,6 +23,7 @@
, addProxy
, applyBasicAuth
, applyBasicProxyAuth
+ , applyBearerAuth
, urlEncodedBody
, needsGunzip
, requestBuilder
@@ -344,6 +345,22 @@
where
authHeader = (CI.mk "Authorization", buildBasicAuth user passwd)
+-- | Build a bearer-auth header value
+buildBearerAuth ::
+ S8.ByteString -- ^ Token
+ -> S8.ByteString
+buildBearerAuth token =
+ S8.append "Bearer " token
+
+-- | Add a Bearer Auth header to the given 'Request'
+--
+-- @since 0.7.6
+applyBearerAuth :: S.ByteString -> Request -> Request
+applyBearerAuth bearerToken req =
+ req { requestHeaders = authHeader : requestHeaders req }
+ where
+ authHeader = (CI.mk "Authorization", buildBearerAuth bearerToken)
+
-- | Add a proxy to the Request so that the Request when executed will use
-- the provided proxy.
--
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.5/Network/HTTP/Client.hs
new/http-client-0.7.6/Network/HTTP/Client.hs
--- old/http-client-0.7.5/Network/HTTP/Client.hs 2021-02-04
19:03:48.000000000 +0100
+++ new/http-client-0.7.6/Network/HTTP/Client.hs 2021-02-21
07:16:45.000000000 +0100
@@ -138,6 +138,7 @@
, requestFromURI_
, defaultRequest
, applyBasicAuth
+ , applyBearerAuth
, urlEncodedBody
, getUri
, setRequestIgnoreStatus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.5/http-client.cabal
new/http-client-0.7.6/http-client.cabal
--- old/http-client-0.7.5/http-client.cabal 2021-02-04 19:12:01.000000000
+0100
+++ new/http-client-0.7.6/http-client.cabal 2021-02-21 07:16:45.000000000
+0100
@@ -1,5 +1,5 @@
name: http-client
-version: 0.7.5
+version: 0.7.6
synopsis: An HTTP client engine
description: Hackage documentation generation is not reliable. For up
to date documentation, please see:
<http://www.stackage.org/package/http-client>.
homepage: https://github.com/snoyberg/http-client
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.5/test/Network/HTTP/ClientSpec.hs
new/http-client-0.7.6/test/Network/HTTP/ClientSpec.hs
--- old/http-client-0.7.5/test/Network/HTTP/ClientSpec.hs 2021-02-04
19:03:49.000000000 +0100
+++ new/http-client-0.7.6/test/Network/HTTP/ClientSpec.hs 2021-02-21
07:16:45.000000000 +0100
@@ -33,6 +33,18 @@
man <- newManager defaultManagerSettings
res <- httpLbs req man
responseStatus res `shouldBe` status405
+ describe "bearer auth" $ do
+ it "success" $ do
+ initialReq <- parseUrlThrow "http://httpbin.org/bearer"
+ let finalReq = applyBearerAuth "token" initialReq
+ man <- newManager defaultManagerSettings
+ res <- httpLbs finalReq man
+ responseStatus res `shouldBe` status200
+ it "failure" $ do
+ req <- parseRequest "http://httpbin.org/bearer"
+ man <- newManager defaultManagerSettings
+ res <- httpLbs req man
+ responseStatus res `shouldBe` status401
describe "redirects" $ do
xit "follows redirects" $ do