Use a patch file to patch openid

This will let us know if the target file is not what we expect.

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
Aurélien Bompard 2020-09-18 10:18:21 +02:00
parent 8771ee37c6
commit 8402baa4d9
No known key found for this signature in database
GPG key ID: 31584CFEB9BF64AD
3 changed files with 36 additions and 1836 deletions

View file

@ -7,5 +7,5 @@ SITE_PACKAGES=`python3 -Ic "from distutils.sysconfig import get_python_lib; prin
set -x
cp -afv ipsilon ${ROOT}${SITE_PACKAGES}/
cp -afv openid ${ROOT}${SITE_PACKAGES}/
cat openid-server.patch | patch -p0 --fuzz 0 -d ${ROOT}${SITE_PACKAGES}/
python3 -m compileall ${ROOT}${SITE_PACKAGES}/{ipsilon,openid}

35
openid-server.patch Normal file
View file

@ -0,0 +1,35 @@
--- openid/server/server.py 2017-02-22 16:32:16.000000000 +0100
+++ openid/server/server.py 2020-09-10 10:40:54.454950391 +0200
@@ -1047,9 +1047,22 @@
@change: 2.1.0 added the ENCODE_HTML_FORM response.
"""
if self.request.mode in BROWSER_REQUEST_MODES:
- if self.fields.getOpenIDNamespace() == OPENID2_NS and \
+ do_post_trusts = ['http://taigastg.cloud.fedoraproject.org/',
+ 'http://taiga.cloud.fedoraproject.org/',
+ 'http://taiga.fedorainfracloud.org/',
+ 'http://taigastg.fedorainfracloud.org/',
+ 'https://taigastg.cloud.fedoraproject.org/',
+ 'https://taiga.cloud.fedoraproject.org/',
+ 'https://taiga.fedorainfracloud.org/',
+ 'https://taigastg.fedorainfracloud.org/']
+ if self.request.trust_root in do_post_trusts:
+ return ENCODE_HTML_FORM
+ elif self.fields.isOpenID1() and \
len(self.encodeToURL()) > OPENID1_URL_LIMIT:
return ENCODE_HTML_FORM
+ #elif self.fields.getOpenIDNamespace() == OPENID2_NS and \
+ # len(self.encodeToURL()) > OPENID1_URL_LIMIT:
+ # return ENCODE_HTML_FORM
else:
return ENCODE_URL
else:
@@ -1695,7 +1708,7 @@
displayed to the user.
"""
if self.hasReturnTo():
- if self.openid_message.getOpenIDNamespace() == OPENID2_NS and \
+ if self.openid_message.isOpenID1() and \
len(self.encodeToURL()) > OPENID1_URL_LIMIT:
return ENCODE_HTML_FORM
else:

File diff suppressed because it is too large Load diff