Merge lp:~jcsackett/launchpad/anonymous-api-access-emails-681815 into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | j.c.sackett on 2010-12-02 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 12048 |
| Proposed branch: | lp:~jcsackett/launchpad/anonymous-api-access-emails-681815 |
| Merge into: | lp:launchpad |
| Diff against target: |
1048 lines (+205/-101) 32 files modified
lib/canonical/launchpad/browser/tests/test_logintoken.py (+2/-1) lib/canonical/launchpad/doc/emailaddress.txt (+1/-0) lib/canonical/launchpad/doc/location-widget.txt (+3/-3) lib/canonical/launchpad/doc/notification-recipient-set.txt (+1/-0) lib/canonical/launchpad/doc/vocabulary-json.txt (+1/-1) lib/canonical/launchpad/security.py (+2/-5) lib/canonical/launchpad/webapp/tests/test_login.py (+3/-2) lib/canonical/launchpad/webapp/tests/test_loginsource.py (+4/-3) lib/lp/blueprints/stories/standalone/subscribing.txt (+2/-2) lib/lp/code/browser/tests/test_branch.py (+1/-1) lib/lp/code/mail/branch.py (+4/-2) lib/lp/code/mail/tests/test_branch.py (+4/-1) lib/lp/code/mail/tests/test_sourcepackagerecipebuild.py (+1/-1) lib/lp/code/model/recipebuilder.py (+6/-1) lib/lp/code/model/tests/test_recipebuilder.py (+1/-0) lib/lp/code/stories/feeds/xx-revision-atom.txt (+2/-1) lib/lp/code/tests/test_directbranchcommit.py (+4/-1) lib/lp/registry/browser/tests/person-views.txt (+4/-2) lib/lp/registry/browser/tests/test_person_webservice.py (+41/-1) lib/lp/registry/browser/tests/user-to-user-views.txt (+1/-1) lib/lp/registry/doc/message-holds.txt (+1/-1) lib/lp/registry/doc/person.txt (+3/-2) lib/lp/registry/scripts/personnotification.py (+2/-1) lib/lp/registry/stories/webservice/xx-person.txt (+81/-46) lib/lp/registry/tests/test_personset.py (+3/-3) lib/lp/registry/tests/test_product.py (+7/-6) lib/lp/registry/tests/test_project.py (+2/-1) lib/lp/services/mail/sendmail.py (+3/-1) lib/lp/services/mailman/testing/__init__.py (+2/-1) lib/lp/services/mailman/tests/test_lpmoderate.py (+4/-2) lib/lp/testing/factory.py (+7/-6) lib/lp/testing/tests/test_login.py (+2/-2) |
| To merge this branch: | bzr merge lp:~jcsackett/launchpad/anonymous-api-access-emails-681815 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Edwin Grubbs (community) | code | Approve on 2010-12-02 | |
| Benji York (community) | code* | 2010-11-30 | Approve on 2010-12-01 |
|
Review via email:
|
|||
Commit Message
[r=benji,
Description of the Change
Summary
=======
The webservice currently has a hole through which a person can anonymously collect email addresses. This is because the security check employed for it allows email addresses to be returned if they're attached to a user. To be consistent with the web interface, you shouldn't get email addresses unless you're logged in.
This branch changes the unauthenticated check so that it never allows emails to be returned.
Proposed fix
============
Change the ViewEmailAddress checkUnauthenti
Preimplementation talk
=======
Spoke with Curtis Hovey.
Implementation details
=======
As in Proposed.
Tests
=====
bin/test -t registry.
Demo & QA
=========
There are several scripts attached to the bug that should pass if this whole is patched.
Lint
====
make lint output:
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/canonical
lib/lp/
./lib/canonical
733: E302 expected 2 blank lines, found 1
1266: E302 expected 2 blank lines, found 1
1476: E302 expected 2 blank lines, found 1
./lib/lp/
14: want exceeds 78 characters.
16: want exceeds 78 characters.
20: want exceeds 78 characters.
38: want exceeds 78 characters.
41: want exceeds 78 characters.
44: want exceeds 78 characters.
61: want exceeds 78 characters.
63: want exceeds 78 characters.
67: want exceeds 78 characters.
69: want exceeds 78 characters.
72: want exceeds 78 characters.
86: want exceeds 78 characters.
87: want exceeds 78 characters.
90: want exceeds 78 characters.
93: want exceeds 78 characters.
95: want exceeds 78 characters.
161: source exceeds 78 characters.
162: source exceeds 78 characters.
163: want has trailing whitespace.
191: narrative exceeds 78 characters.
266: source exceeds 78 characters.
349: narrative has trailing whitespace.
359: narrative has trailing whitespace.
482: source exceeds 78 characters.
506: source exceeds 78 characters.
569: source exceeds 78 characters.
822: source has bad indentation.
The blank line error in security.py is because of lint's issues with comments and blanklines.
The wants over 78 lines don't appear to be something that can easily be moved about; they are arguably more readable in their current form.
| j.c.sackett (jcsackett) wrote : | # |
I've pushed up a change which makes this a better test, but it's still going to pass in either event; oddly, while in test mode, this security hole doesn't seem to exist.
I encourage any thoughts as to how to deal with this; otherwise, I think the tests show this patch hasn't broken anything, and the scripts attached to the bug can be used to QA it once it's live on qastaging.
| j.c.sackett (jcsackett) wrote : | # |
The big change is the new tests. I've attached a diff of just those.
| Edwin Grubbs (edwin-grubbs) wrote : | # |
Hi JC,
Thanks for adding tests that actually fail without your changes to checkUnauthenti
-Edwin
| j.c.sackett (jcsackett) wrote : | # |
Edwin, Benji--
I've made the changes to make lint happy.
Thanks for the review, guys!

This branch looks good. The reST-ification of the section headings is a nice touch.
As for the long "want" lines, the ones I looked at where of the form "foo: bar\n", so could be wrapped to "foo:\n bar\n" (i.e., line break at the colon and indent the next line) and still retain their readability. However, I agree that their current arrangement isn't too bad either.