Merge lp:~wgrant/launchpad/bug-810626 into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 13441
Proposed branch: lp:~wgrant/launchpad/bug-810626
Merge into: lp:launchpad
Diff against target: 25 lines (+3/-1)
2 files modified
lib/canonical/launchpad/webapp/login.py (+1/-1)
lib/canonical/launchpad/webapp/tests/test_login.py (+2/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/bug-810626
Reviewer Review Type Date Requested Status
William Grant Approve
Review via email: mp+68043@code.launchpad.net

Commit message

Mark fullname/email OpenID SReg attribute requests as required, so SSO always sends them.

Description of the change

As reported in bug #810626, SSO is about to start allowing users to refuse to send optionally requested data. This branch fixes LP to mark fullname and email as required, so they are always sent.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/webapp/login.py'
2--- lib/canonical/launchpad/webapp/login.py 2011-06-10 18:34:34 +0000
3+++ lib/canonical/launchpad/webapp/login.py 2011-07-15 00:24:31 +0000
4@@ -207,7 +207,7 @@
5 finally:
6 timeline_action.finish()
7 self.openid_request.addExtension(
8- sreg.SRegRequest(optional=['email', 'fullname']))
9+ sreg.SRegRequest(required=['email', 'fullname']))
10
11 assert not self.openid_request.shouldSendRedirect(), (
12 "Our fixed OpenID server should not need us to redirect.")
13
14=== modified file 'lib/canonical/launchpad/webapp/tests/test_login.py'
15--- lib/canonical/launchpad/webapp/tests/test_login.py 2011-06-10 18:34:34 +0000
16+++ lib/canonical/launchpad/webapp/tests/test_login.py 2011-07-15 00:24:31 +0000
17@@ -699,6 +699,8 @@
18 self.assertIsInstance(sreg_extension, sreg.SRegRequest)
19 self.assertEquals(['email', 'fullname'],
20 sorted(sreg_extension.allRequestedFields()))
21+ self.assertEquals(sorted(sreg_extension.required),
22+ sorted(sreg_extension.allRequestedFields()))
23
24 def test_logs_to_timeline(self):
25 # Beginning an OpenID association makes an HTTP request to the