[perl-WWW-GoodData/el6] Fix the auth handler for clients that use stock LWP::UserAgent
Lubomir Rintel
lkundrak at fedoraproject.org
Thu Oct 11 13:13:02 UTC 2012
commit 56ad97afcbb0cbe8c9de2e3cb753d721e8d2ab62
Author: Lubomir Rintel <lubo.rintel at gooddata.com>
Date: Thu Oct 11 15:11:20 2012 +0200
Fix the auth handler for clients that use stock LWP::UserAgent
...ken-relatively-from-the-requested-address.patch | 30 ++++++++++++++++++++
perl-WWW-GoodData.spec | 7 ++++-
2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/0001-Get-token-relatively-from-the-requested-address.patch b/0001-Get-token-relatively-from-the-requested-address.patch
new file mode 100644
index 0000000..6b820f1
--- /dev/null
+++ b/0001-Get-token-relatively-from-the-requested-address.patch
@@ -0,0 +1,30 @@
+From fbdb48d696c36a505cdc0d4200d3a3819c96a7ba Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lkundrak at v3.sk>
+Date: Thu, 11 Oct 2012 15:02:35 +0200
+Subject: [PATCH] Get token relatively from the requested address
+
+If stock agent is used we don't have any API root anyway.
+---
+ lib/LWP/Authen/Gooddata.pm | 6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/lib/LWP/Authen/Gooddata.pm b/lib/LWP/Authen/Gooddata.pm
+index a267cf7..efcb7e9 100644
+--- a/lib/LWP/Authen/Gooddata.pm
++++ b/lib/LWP/Authen/Gooddata.pm
+@@ -50,8 +50,10 @@ sub authenticate
+
+ # Refresh the token cookie
+ # We should obtain the URI from WWW::GoodData somehow...
+- #die $gdc->get_uri (qw/token/);
+- $agent->get ('/gdc/account/token');
++ my $token_uri = $request->uri->clone;
++ $token_uri->path ('/gdc/account/token');
++ $token_uri->fragment (undef);
++ $agent->get ($token_uri);
+
+ $request->header (Cookie => '');
+
+--
+1.7.1
+
diff --git a/perl-WWW-GoodData.spec b/perl-WWW-GoodData.spec
index a53e946..cfa6188 100644
--- a/perl-WWW-GoodData.spec
+++ b/perl-WWW-GoodData.spec
@@ -1,11 +1,12 @@
Name: perl-WWW-GoodData
Version: 1.7
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Client library for GoodData REST-ful API
License: GPL+ or Artistic
Group: Development/Libraries
URL: http://search.cpan.org/dist/WWW-GoodData/
Source0: http://www.cpan.org/authors/id/L/LK/LKUNDRAK/WWW-GoodData-%{version}.tar.gz
+Patch0: 0001-Get-token-relatively-from-the-requested-address.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: perl(IO::Socket::SSL)
@@ -24,6 +25,7 @@ correctness of implementation.
%prep
%setup -q -n WWW-GoodData-%{version}
+%patch0 -p1
%build
@@ -58,6 +60,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Thu Oct 11 2012 Lubomir Rintel (GoodData) <lubo.rintel at gooddata.com> 1.7-2
+- Fix the auth handler for clients that use stock LWP::UserAgent
+
* Wed Aug 22 2012 Lubomir Rintel (GoodData) <lubo.rintel at gooddata.com> 1.7-1
- Rebase
More information about the scm-commits
mailing list