Merge lp:~bac/launchpad/bug-514447-anon-api into lp:launchpad
Proposed by
Brad Crittenden
on 2010-02-08
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Aaron Bentley on 2010-02-08 | ||||
| Approved revision: | not available | ||||
| Merged at revision: | not available | ||||
| Proposed branch: | lp:~bac/launchpad/bug-514447-anon-api | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
189 lines (+40/-21) 5 files modified
lib/canonical/launchpad/security.py (+5/-0) lib/lp/registry/configure.zcml (+8/-2) lib/lp/registry/interfaces/distribution.py (+15/-17) lib/lp/registry/interfaces/sourcepackage.py (+1/-1) lib/lp/registry/stories/webservice/xx-distroseries.txt (+11/-1) |
||||
| To merge this branch: | bzr merge lp:~bac/launchpad/bug-514447-anon-api | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Aaron Bentley (community) | 2010-02-08 | Approve on 2010-02-08 | |
|
Review via email:
|
|||
Commit Message
Add security adapter so that distro.series can be seen via anonymous API access.
To post a comment you must log in.
| Brad Crittenden (bac) wrote : | # |
review:
Approve

= Summary =
When anonymous API access was enabled the series data for distributions was returning
an empty list. The problem was reported as bug 514447 and was discovered to be the
same root cause as bug 515761.
== Proposed fix ==
Even though the distribution interface IDistributionPublic has no access restrictions
in the registry configure.zcml the series data was not authorized for launchpad.View.
Creating a security adapter for IDistroSeries was required.
== Pre-implementation notes ==
Talks on IRC with Leonard and Jamal, who was fixing bug 515761.
== Implementation details ==
Create the new security adapter and test.
Also you'll see some drive-by cleanups including some annoying trailing whitespace
deletions (thanks emacs!).
Also you'll note an XXX comment in the code that I'll remove before landing. Jamal rization' class I've temporarily included in this branch.
created a new security adapter for anonymous access that I wanted to take advantage
of. Unfortunately his branch was delayed in landing (I am running it through ec2 at
the moment). When his branch lands I'll merge it in and delete the
'AnonymousAutho
== Tests ==
bin/test -vvm lp.registry -t xx-distroseries.txt
== Demo and Q/A ==
Use launchpadlib to do:
> ubuntu = lp.distribution s['ubuntu' ]
> list(ubuntu.series)
If you run against edge you'll see all of the usual suspects. If you run against
launchpad.dev you'll see the four in the test data. You should definitely not get an
empty list.
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: /launchpad/ security. py registry/ configure. zcml registry/ interfaces/ sourcepackage. py registry/ interfaces/ distribution. py registry/ stories/ webservice/ xx-distroseries .txt
lib/canonical
lib/lp/
lib/lp/
lib/lp/
lib/lp/
== Pylint notices ==
lib/lp/ registry/ interfaces/ sourcepackage. py fields' (No module named restful) declarations' (No module named restful) getBranch] Operator not preceded by a space DBEnumeratedTyp e))
21: [F0401] Unable to import 'lazr.enum' (No module named enum)
27: [F0401] Unable to import 'lazr.restful.
28: [F0401] Unable to import 'lazr.restful.
187: [C0322, ISourcePackage.
vocabulary=
^
@operation_ returns_ entry(Interface ) read_operation( ) setBranch] Operator not preceded by a space DBEnumeratedTyp e), Reference( Interface, title=_("Branch"), required=False)) with(registrant =REQUEST_ USER) write_operation ()
@export_
def getBranch(pocket):
205: [C0322, ISourcePackage.
vocabulary=
^
branch=
@call_
@export_
def setBranch(pocket, branch, registrant):
lib/lp/ registry/ interfaces/ distribution. py fields' (No module named restful) interface' (No module named restful) declarations' (No module named restful)
224: [C0301] Line too long (79/78)
26: [F0401] Unable to import 'lazr.restful.
27: [F0401] Unable to import 'lazr.restful.
28: [F0401] Unable to import 'lazr.restful.