Merge lp:~benji/launchpad/bug-597324 into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Robert Collins on 2010-07-20 |
| Approved revision: | no longer in the source branch. |
| Merge reported by: | Benji York |
| Merged at revision: | not available |
| Proposed branch: | lp:~benji/launchpad/bug-597324 |
| Merge into: | lp:launchpad |
| Diff against target: |
229 lines (+144/-7) 3 files modified
lib/canonical/launchpad/webapp/login.py (+28/-5) lib/canonical/launchpad/webapp/tests/test_login.py (+111/-1) lib/lp/testopenid/browser/server.py (+5/-1) |
| To merge this branch: | bzr merge lp:~benji/launchpad/bug-597324 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Robert Collins (community) | 2010-07-19 | Approve on 2010-07-21 | |
|
Review via email:
|
|||
Description of the Change
Fix bug #597324 as well as two other bugs found while investigating (one in the development OpenID provider, the other in Launchpad).
| Benji York (benji) wrote : | # |
| Robert Collins (lifeless) wrote : | # |
test_redirect_logic looks like it has 3 or 4 separate tests in it - please split that out for readability.
Your fakes could do with a docstring each to describe their intent, and lastly your static methods are a little weird; if they are not stateful, please consider functions; if they are tightly coupled, but are called from instances, please use normal methods.
With these changes it can land without another review.
Thanks,
Rob
| Benji York (benji) wrote : | # |
On Tue, Jul 20, 2010 at 5:33 AM, Robert Collins
<email address hidden> wrote:
> Review: Needs Fixing code
> test_redirect_logic looks like it has 3 or 4 separate tests in it -
> please split that out for readability.
Done. They somehow seem less readable though. And the constants that
they use now have greater scope than before. Perhaps these should be
in their own TestCase instead. Yeah, that's what I'll do.
> Your fakes could do with a docstring each to describe their intent,
Added.
> and lastly your static methods are a little weird; if they are not
> stateful, please consider functions; if they are tightly coupled, but
> are called from instances, please use normal methods.
They are not stateful, but are very tightly related to the class in
question and called from instances thereof.
I prefer methods that don't use self to be static, but am glad to honor
local custom. I removed the staticmethod decorator and added self to
the parameter list.
> With these changes it can land without another review.
Land ho!
--
Benji York
| Benji York (benji) wrote : | # |
Robert, lp-land is refusing to land this branch with the message "bzr: ERROR: bzrlib.
I believe you need to give this MP an "Approve" vote.
Thanks.

It strikes me that my description above could use some fleshing out. Here goes.
The bug was triggered when the OpenID provider chooses to present the user with a form with a single Continue button to click on instead of redirecting the user directly to Launchpad (because the redirect would have contained a Location header that is too long for some browsers).
Launchpad wasn't expecting this behavior and couldn't handle it. The solution was to gather the data needed to complete the OpenID handshaking from POST requests as well as GET requests (the data ends up in different data structures in the two scenarios).
There was also a bug in the development OpenID provider such that it did not set the content-type correctly when generating the aforementioned continue- button- containing- form, so the user only saw raw HTML.