[python-fedora] Backport fix to flask-fas-openid

Pierre-YvesChibon pingou at fedoraproject.org
Thu Oct 23 18:23:58 UTC 2014


commit 833a565b31d88d857553a7e606c98316a8e23826
Author: Pierre-Yves Chibon <pingou at pingoured.fr>
Date:   Thu Oct 23 20:22:43 2014 +0200

    Backport fix to flask-fas-openid

 108.patch          |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 python-fedora.spec |   12 ++++++++++-
 2 files changed, 65 insertions(+), 1 deletions(-)
---
diff --git a/108.patch b/108.patch
new file mode 100644
index 0000000..c9a5b4c
--- /dev/null
+++ b/108.patch
@@ -0,0 +1,54 @@
+From 32faf54e54808a8f71a976b9007da3823017fec2 Mon Sep 17 00:00:00 2001
+From: Patrick Uiterwijk <puiterwijk at redhat.com>
+Date: Wed, 22 Oct 2014 21:20:46 +0200
+Subject: [PATCH 1/2] Use the getMessage() function as intended
+
+This is the intended way to get the message, not our hacky way of getting the internal variable.
+This way, python-openid will set all the missing fields for us automagically.
+Isn't that nice of it?!
+---
+ flask_fas_openid.py | 8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/flask_fas_openid.py b/flask_fas_openid.py
+index d0b0454..332e194 100644
+--- a/flask_fas_openid.py
++++ b/flask_fas_openid.py
+@@ -249,12 +249,8 @@ def login(self, username=None, password=None, return_url=None,
+         flask.session['FLASK_FAS_OPENID_CANCEL_URL'] = cancel_url
+ 
+         if request_wants_json():
+-            output = request.message.toPostArgs()
+-            return_to_url='%s?janrain_nonce=%s' % (
+-                return_to, request.return_to_args['janrain_nonce'])
+-            output['openid.realm'] = trust_root
+-            output['openid.return_to'] = return_to_url
+-            output['server_url'] = request.endpoint.server_url
++            output = request.getMessage(trust_root,
++                                        return_to=return_to).toPostArgs()
+             return flask.jsonify(output)
+         elif request.shouldSendRedirect():
+             redirect_url = request.redirectURL(trust_root, return_to, False)
+
+From 77e7b2a9c6a8f91078f213c4ca3a55fccf38211b Mon Sep 17 00:00:00 2001
+From: Patrick Uiterwijk <puiterwijk at redhat.com>
+Date: Wed, 22 Oct 2014 21:25:50 +0200
+Subject: [PATCH 2/2] Re-add server_url
+
+We could make python-fedora use the official endpoint url variable, but backwards-compat....
+---
+ flask_fas_openid.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/flask_fas_openid.py b/flask_fas_openid.py
+index 332e194..b9f6879 100644
+--- a/flask_fas_openid.py
++++ b/flask_fas_openid.py
+@@ -251,6 +251,7 @@ def login(self, username=None, password=None, return_url=None,
+         if request_wants_json():
+             output = request.getMessage(trust_root,
+                                         return_to=return_to).toPostArgs()
++            output['server_url'] = request.endpoint.server_url
+             return flask.jsonify(output)
+         elif request.shouldSendRedirect():
+             redirect_url = request.redirectURL(trust_root, return_to, False)
diff --git a/python-fedora.spec b/python-fedora.spec
index 268ae50..f53c262 100644
--- a/python-fedora.spec
+++ b/python-fedora.spec
@@ -6,7 +6,7 @@
 
 Name:           python-fedora
 Version:        0.3.36
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Python modules for talking to Fedora Infrastructure Services
 
 Group:          Development/Languages
@@ -15,6 +15,10 @@ URL:            https://fedorahosted.org/python-fedora/
 Source0:        https://fedorahosted.org/releases/p/y/%{name}/%{name}-%{version}%{?prerel}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
+# Backport fixing flask-fas-openid
+# Merged upstream at: https://github.com/fedora-infra/python-fedora/pull/108
+Patch1:         108.patch
+
 BuildArch:      noarch
 BuildRequires:  python2-devel
 BuildRequires:  python-setuptools
@@ -137,6 +141,8 @@ Account System.
 %prep
 %setup -q -n %{name}-%{version}%{?prerel}
 
+%patch1 -p1 -b .
+
 %build
 python2 setup.py build
 python2 setup.py build_sphinx
@@ -190,6 +196,10 @@ rm -rf %{buildroot}
 %{python2_sitelib}/flask_fas_openid.py*
 
 %changelog
+* Thu Oct 23 2014 Pierre-Yves Chibon <pingou at pingoured.fr> - 0.3.36-2
+- Backport the flask-fas-openid fix merged upstream at:
+  https://github.com/fedora-infra/python-fedora/pull/108
+
 * Thu Aug  7 2014 Toshio Kuratomi <toshio at fedoraproject.org> - 0.3.36-1
 - New upstream release fixing logging in openidbaseclient
 


More information about the scm-commits mailing list