Merge lp:~leonardr/launchpad/no-cookie-vary-header into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Aaron Bentley on 2010-04-05 |
| Approved revision: | 10618 |
| Merge reported by: | Leonard Richardson |
| Merged at revision: | not available |
| Proposed branch: | lp:~leonardr/launchpad/no-cookie-vary-header |
| Merge into: | lp:launchpad |
| Diff against target: |
215 lines (+135/-24) (has conflicts) 5 files modified
lib/canonical/launchpad/pagetests/webservice/launchpadlib.txt (+91/-19) lib/canonical/launchpad/pagetests/webservice/xx-service.txt (+22/-0) lib/canonical/launchpad/webapp/servers.py (+20/-2) lib/canonical/launchpad/webapp/tests/test_servers.py (+1/-2) versions.cfg (+1/-1) Text conflict in lib/canonical/launchpad/pagetests/webservice/launchpadlib.txt Contents conflict in lib/lp/bugs/scripts/checkwatches/core.py Path conflict: lib/lp/bugs/scripts/checkwatches/core.py / lib/lp/bugs/scripts/checkwatches/core.py Contents conflict in lib/lp/bugs/scripts/checkwatches/tests/test_core.py Path conflict: lib/lp/bugs/scripts/checkwatches/tests/test_core.py / lib/lp/bugs/scripts/checkwatches/tests/test_core.py Contents conflict in lib/lp/registry/model/projectgroup.py Path conflict: lib/lp/registry/model/projectgroup.py / lib/lp/registry/model/projectgroup.py |
| To merge this branch: | bzr merge lp:~leonardr/launchpad/no-cookie-vary-header |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Aaron Bentley (community) | 2010-04-05 | Approve on 2010-04-06 | |
| Gary Poster (community) | Approve on 2010-04-06 | ||
|
Review via email:
|
|||
Description of the Change
This branch stops Launchpad from including 'Cookie' in its Vary header when serving web service requests. Although not technically incorrect (the Launchpad web service doesn't use cookies at all), it's not necessary to mention this header, and mentioning it triggers an httplib2 bug (http://
| Leonard Richardson (leonardr) wrote : | # |
I decided to use my new powers to write launchpadlib tests for this in Launchpad, and discovered that removing Cookie doesn't solve the problem: we also need to remove Authorization, because every OAuth nonce is different.
I gave this some thought and decided that this is fine with our existing web service, but depending on the performance improvements we make in the future, we might want to change launchpadlib to keep a different cache for every authorization token. This would degrade client-side performance but it would make it impossible for less-privileged tokens to accidentally get cached data obtained by more privileged tokens.
I don't know how much this matters, and it certainly wouldn't affect a malicious program, because a malicious program can just scour the .launchpadlib directory for a more-privileged token and use that token instead.
- 10619. By Leonard Richardson on 2010-04-05
-
Fixed spacing.
- 10620. By Leonard Richardson on 2010-04-05
-
Merged in the launchpadlib pagetest branch.
- 10621. By Leonard Richardson on 2010-04-05
-
Added test, removed Authorization from Vary so the test would work.
- 10622. By Leonard Richardson on 2010-04-06
-
Merge trunk.
- 10623. By Leonard Richardson on 2010-04-06
-
Fixed test.
| Gary Poster (gary) wrote : | # |
The launchpadlib test is awesome. Yay.
The potential security issues are concerning, but they do seem fine now.
IRC discussion:
[10:23am] gary_poster: leonardr: xx-service.txt looks like it would fail now. Your code says self.response.
[10:23am] gary_poster: 83+ >>> response = webservice.get(
[10:23am] gary_poster: 84+ ... 'http://
[10:23am] gary_poster: 85+ >>> print response.
[10:23am] gary_poster: 86+ Authorization, Accept
[10:23am] leonardr: gary: thanks, don't know how i missed that
| Aaron Bentley (abentley) wrote : | # |
I hearby reapprove this with the new authorization non-variance.
- 10624. By Leonard Richardson on 2010-04-06
-
Fixed test again.
- 10625. By Leonard Richardson on 2010-04-06
-
Fixed test failure.
- 10626. By Leonard Richardson on 2010-04-06
-
Updated versions.cfg to seek a new version of launchpadlib.
- 10627. By Leonard Richardson on 2010-04-27
-
Merge with trunk.
- 10628. By Leonard Richardson on 2010-04-27
-
Merged from trunk and resolved conflict.

I think there are supposed to be two blank lines, not one, before a new header, as on line 8 of the patch. Otherwise, good.