Merge lp:~salgado/launchpad/apidoc into lp:launchpad
- apidoc
- Merge into devel
Status: | Merged |
---|---|
Approved by: | Guilherme Salgado |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11220 |
Proposed branch: | lp:~salgado/launchpad/apidoc |
Merge into: | lp:launchpad |
Diff against target: |
593 lines (+217/-52) 20 files modified
configs/development/apidoc-configure-normal.zcml (+84/-39) configs/development/launchpad-lazr.conf (+3/-0) lib/canonical/config/schema-lazr.conf (+2/-0) lib/canonical/launchpad/browser/launchpad.py (+2/-2) lib/canonical/launchpad/doc/webapp-publication.txt (+5/-0) lib/canonical/launchpad/layers.py (+4/-0) lib/canonical/launchpad/permissions.zcml (+5/-0) lib/canonical/launchpad/security.py (+14/-0) lib/canonical/launchpad/systemhomes.py (+11/-2) lib/canonical/launchpad/webapp/authentication.py (+21/-1) lib/canonical/launchpad/webapp/authorization.py (+6/-2) lib/canonical/launchpad/webapp/configure.zcml (+1/-1) lib/canonical/launchpad/webapp/interfaces.py (+4/-0) lib/canonical/launchpad/webapp/publisher.py (+0/-3) lib/canonical/launchpad/webapp/servers.py (+15/-1) lib/lp/app/stories/apidoc.txt (+25/-0) setup.py (+5/-0) site.zcml (+1/-0) versions.cfg (+7/-1) zopeapp.zcml (+2/-0) |
To merge this branch: | bzr merge lp:~salgado/launchpad/apidoc |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gary Poster (community) | Approve | ||
Review via email: mp+30520@code.launchpad.net |
Commit message
Add a new vhost (apidoc.
Description of the change
Make zope.app.apidoc available on the new apidoc.lp.dev vhost.
Gary Poster (gary) wrote : | # |
Gary Poster (gary) : | # |
Guilherme Salgado (salgado) wrote : | # |
On Wed, 2010-07-21 at 17:08 +0000, Gary Poster wrote:
> Hi Salgado. Very cool. Thank you. Comments below.
>
> Requested:
>
> - Let's put the changes from
> lib/canonical/
> apidoc-
Good catch. Done.
>
> Questions and comments:
>
> - Why is this necessary, do you know? I realize it is an existing
> code that you moved around, but neither the comment nor the "provides"
> made much sense to me, though Google did show me some hints that it
> might be standard practice for enabling the apidoc for some reason.
> Did you try removing it?
> + <!-- Turn on devmode for the following includes principal=work
> -->
> + <meta:provides feature="devmode" />
For some reason it became necessary when I moved the zcml to
apidoc-
>
> - I'm concerned that the tests are going to be run with even more
> registrations that will not be part of production. I wish there were
> a light, easy way to start up another LP instance for the apidoc smoke
> test that then would not pollute the rest of the tests with the apidoc
> registrations in the zcml file. However, I don't know of one, and
> unless you do, I won't insist that we address this concern. It's
> certainly just slightly enlarging an existing problem, rather than
> making a new one.
I hadn't thought about that, but I'll see if I can find a way to not
make this situation any worse.
>
> - Did you audit zope.login to make sure it's registrations don't do
> something we need to be worried about from a security perspective? If
> not, one of us should. I'd feel somewhat happier if ``<include
> package=
> exacerbating the previous problem (that is, production registrations
> are more and more different from test registrations).
zope.login is now needed because the ILoginPassword adapter has been
moved there from zope.publisher, but you have a good point that it
should be audited.
I've just checked and it just registers the ILoginPassword adapters for
both IHTTPCredentials and IFTPCredentials as zope.publisher did until
version 3.10.
I'm now wondering if I should do the same for all the eggs that I've
updated as part of this -- they could also register new things that
we're not expecting.
>
> Suggested:
>
> - I suggest renaming LaunchpadPrinci
> TemporaryPrinci
> implementation is effectively a stub) is something worth highlighting.
> Calling it "Launchpad" doesn't buy us anything.
I like your suggestion; renamed.
>
> - FWIW, LaunchpadPrinci
> and be shortened to the __init__ plus a call to the shared constructor
> and the interface declarations. Do it if you want.
I'm all for it!
Also, I thought I could make apidoc.lp.dev work for anonymous users by
just registering an adapter like the above for
IUnauthenticate
http://
I'm thinking that it may be better to actually require a logged-in user
to use apidoc.lp.dev and ask them to login in case they're no...
Guilherme Salgado (salgado) wrote : | # |
Another alternative to deal with the fact that apidoc.lp.dev doesn't seem to work for anonymous users would be to somehow pretend all requests on apidoc.lp.dev are authenticated. I did that by making APIDocBrowserPu
Gary Poster (gary) wrote : | # |
Hey Salgado. Thank you. Below, I've deleted sections for which I thought no further discussion was necessary.
On Jul 22, 2010, at 5:15 AM, Guilherme Salgado wrote:
> On Wed, 2010-07-21 at 17:08 +0000, Gary Poster wrote:
>> Hi Salgado. Very cool. Thank you. Comments below.
>>
>> Requested:
>>
>> - Let's put the changes from
>> lib/canonical/
>> apidoc-
>
> Good catch. Done.
I don't understand why you didn't also move this:
+ <utility
+ component=
+ provides=
Was it an oversight, or is there a reason to keep it where it is?
...
>> - I'm concerned that the tests are going to be run with even more
>> registrations that will not be part of production. I wish there were
>> a light, easy way to start up another LP instance for the apidoc smoke
>> test that then would not pollute the rest of the tests with the apidoc
>> registrations in the zcml file. However, I don't know of one, and
>> unless you do, I won't insist that we address this concern. It's
>> certainly just slightly enlarging an existing problem, rather than
>> making a new one.
>
> I hadn't thought about that, but I'll see if I can find a way to not
> make this situation any worse.
Ack, thanks.
>> - Did you audit zope.login to make sure it's registrations don't do
>> something we need to be worried about from a security perspective? If
>> not, one of us should. I'd feel somewhat happier if ``<include
>> package=
>> exacerbating the previous problem (that is, production registrations
>> are more and more different from test registrations).
>
> zope.login is now needed because the ILoginPassword adapter has been
> moved there from zope.publisher, but you have a good point that it
> should be audited.
>
> I've just checked and it just registers the ILoginPassword adapters for
> both IHTTPCredentials and IFTPCredentials as zope.publisher did until
> version 3.10.
Cool.
> I'm now wondering if I should do the same for all the eggs that I've
> updated as part of this -- they could also register new things that
> we're not expecting.
The reason why I singled in on this one is that it is registered in zopeapp.zcml, so it will affect production. The rest will only affect tests and development, so I'm less concerned in this regard.
zope.publisher's update I guess is worth a look, actually. But that's the only other one I see.
> - FWIW, LaunchpadPrinci
>> and be shortened to the __init__ plus a call to the shared constructor
>> and the interface declarations. Do it if you want.
>
> I'm all for it!
>
> Also, I thought I could make apidoc.lp.dev work for anonymous users by
> just registering an adapter like the above for
> IUnauthenticate
> http://
Meh, digging into it just a bit, I see that preference group thing is doing somewhat unusual security dances. I wouldn't be all that surprised if that LocationError were actually hiding a Forbidd...
Gary Poster (gary) : | # |
Guilherme Salgado (salgado) wrote : | # |
On Fri, 2010-07-23 at 12:42 +0000, Gary Poster wrote:
> Hey Salgado. Thank you. Below, I've deleted sections for which I thought no further discussion was necessary.
>
> On Jul 22, 2010, at 5:15 AM, Guilherme Salgado wrote:
>
> > On Wed, 2010-07-21 at 17:08 +0000, Gary Poster wrote:
> >> Hi Salgado. Very cool. Thank you. Comments below.
> >>
> >> Requested:
> >>
> >> - Let's put the changes from
> >> lib/canonical/
> >> apidoc-
> >
> > Good catch. Done.
>
> I don't understand why you didn't also move this:
> + <utility
> + component=
> + provides=
> Was it an oversight, or is there a reason to keep it where it is?
Yep, oversight. Moved.
>
> > I'm now wondering if I should do the same for all the eggs that I've
> > updated as part of this -- they could also register new things that
> > we're not expecting.
>
> The reason why I singled in on this one is that it is registered in
> zopeapp.zcml, so it will affect production. The rest will only affect
> tests and development, so I'm less concerned in this regard.
>
> zope.publisher's update I guess is worth a look, actually. But that's
> the only other one I see.
>
http://
configure.zcml and the current version, so nothing to worry about, I
think?
> > - FWIW, LaunchpadPrinci
> >> and be shortened to the __init__ plus a call to the shared constructor
> >> and the interface declarations. Do it if you want.
> >
> > I'm all for it!
> >
> > Also, I thought I could make apidoc.lp.dev work for anonymous users by
> > just registering an adapter like the above for
> > IUnauthenticate
> > http://
>
> Meh, digging into it just a bit, I see that preference group thing is
> doing somewhat unusual security dances. I wouldn't be all that
> surprised if that LocationError were actually hiding a
> ForbiddenAttribute on a value that should be there, but maybe I'm
> wrong.
>
> > I'm thinking that it may be better to actually require a logged-in user
> > to use apidoc.lp.dev and ask them to login in case they're not, just
> > like we do on other launchpad.AnyPerson pages. What do you think?
>
> Since this is only for devel instances, in the abstract there's no
> reason not to expose this for anonymous users that I see. That will
> also make it easier to make a static version of the apidoc, which I
> think is part of the plan.
Agreed. All I wanted was to make sure we require people to login as
early as possible so that they don't see these obscure errors that one
has no idea can be worked around just by logging in.
>
> If you want me to look into the traceback further just ask.
I'd really appreciate as I wouldn't know where to start. Just some
pointers so I can get started would be great.
>
> ...
>
> >> - I have said that I was fine with the change to authorization.py, but
> >> actually I had another idea. I'm not 100% convinced the new idea is
> >> better, ...
Gary Poster (gary) wrote : | # |
On Jul 23, 2010, at 9:12 AM, Guilherme Salgado wrote:
> On Fri, 2010-07-23 at 12:42 +0000, Gary Poster wrote:
>> Hey Salgado. Thank you. Below, I've deleted sections for which I thought no further discussion was necessary.
Doing that again.
>>
>> On Jul 22, 2010, at 5:15 AM, Guilherme Salgado wrote:
>>
>>> On Wed, 2010-07-21 at 17:08 +0000, Gary Poster wrote:
>
...
>>
>>> I'm now wondering if I should do the same for all the eggs that I've
>>> updated as part of this -- they could also register new things that
>>> we're not expecting.
>>
>> The reason why I singled in on this one is that it is registered in
>> zopeapp.zcml, so it will affect production. The rest will only affect
>> tests and development, so I'm less concerned in this regard.
>>
>> zope.publisher's update I guess is worth a look, actually. But that's
>> the only other one I see.
>>
>
> http://
> configure.zcml and the current version, so nothing to worry about, I
> think?
Agreed, thanks.
>
>
>>> - FWIW, LaunchpadPrinci
>>>> and be shortened to the __init__ plus a call to the shared constructor
>>>> and the interface declarations. Do it if you want.
>>>
>>> I'm all for it!
>>>
>>> Also, I thought I could make apidoc.lp.dev work for anonymous users by
>>> just registering an adapter like the above for
>>> IUnauthenticate
>>> http://
>>
>> Meh, digging into it just a bit, I see that preference group thing is
>> doing somewhat unusual security dances. I wouldn't be all that
>> surprised if that LocationError were actually hiding a
>> ForbiddenAttribute on a value that should be there, but maybe I'm
>> wrong.
>>
>>> I'm thinking that it may be better to actually require a logged-in user
>>> to use apidoc.lp.dev and ask them to login in case they're not, just
>>> like we do on other launchpad.AnyPerson pages. What do you think?
>>
>> Since this is only for devel instances, in the abstract there's no
>> reason not to expose this for anonymous users that I see. That will
>> also make it easier to make a static version of the apidoc, which I
>> think is part of the plan.
>
> Agreed. All I wanted was to make sure we require people to login as
> early as possible so that they don't see these obscure errors that one
> has no idea can be worked around just by logging in.
>
>>
>> If you want me to look into the traceback further just ask.
>
> I'd really appreciate as I wouldn't know where to start. Just some
> pointers so I can get started would be great.
I was skeptical of the way you were using object and UserDict together--that doesn't make UserDict a new-style class, so it doesn't play the "super" game. This fixes the traceback for unauthenticated users, and is generally more correct:
=== modified file 'lib/canonical/
--- lib/canonical/
+++ lib/canonical/
@@ -326,12 +326,12 @@
# zope.app.apidoc expects our principals to be adaptable into IAnno...
Gary Poster (gary) wrote : | # |
One more thing, but it's really important.
I think LP devs might get a lot more excited about this if you just add this little bit.
=== modified file 'configs/
--- configs/
+++ configs/
@@ -3,6 +3,7 @@
xmlns:
xmlns:meta="http://
xmlns:i18n="http://
+ xmlns:apidoc="http://
i18n_
<!-- These packages/
@@ -48,7 +49,7 @@
<!-- apidoc.lp.dev breaks if we make IAPIDocRoot subclass ISite, so we
need to register this view here. -->
<view
- for="canonical.
+ for="canonical.
name=""
@@ -74,5 +75,15 @@
<include package=
<include package=
+ <apidoc:rootModule module="canonical" />
+ <apidoc:rootModule module="lp" />
+ <apidoc:rootModule module="lazr" />
+ <apidoc:rootModule module="zc" />
+ <apidoc:rootModule module="wadllib" />
+ <apidoc:rootModule module="martian" />
+ <apidoc:rootModule module="manuel" />
+ <apidoc:rootModule module="chameleon" />
+ <apidoc:rootModule module="bzrlib" />
+ <apidoc:rootModule module="storm" />
+
</configure>
-
With this, all of that code is browsable and searchable, and the work you've done shows what we expect in the apidoc. It's pretty cool, I think.
Preview Diff
1 | === renamed file 'configs/development/apidoc-configure-normal.zcml.OFF' => 'configs/development/apidoc-configure-normal.zcml' | |||
2 | --- configs/development/apidoc-configure-normal.zcml.OFF 2008-09-02 16:03:35 +0000 | |||
3 | +++ configs/development/apidoc-configure-normal.zcml 2010-07-23 19:21:07 +0000 | |||
4 | @@ -1,48 +1,93 @@ | |||
5 | 1 | <configure | 1 | <configure |
6 | 2 | xmlns="http://namespaces.zope.org/zope" | 2 | xmlns="http://namespaces.zope.org/zope" |
19 | 3 | xmlns:meta="http://namespaces.zope.org/meta"> | 3 | xmlns:browser="http://namespaces.zope.org/browser" |
20 | 4 | <!-- These packages are required by apidoc. If they are deemed | 4 | xmlns:meta="http://namespaces.zope.org/meta" |
21 | 5 | generally useful, move them to zopeapp.zcml | 5 | xmlns:i18n="http://namespaces.zope.org/i18n" |
22 | 6 | --> | 6 | xmlns:apidoc="http://namespaces.zope.org/apidoc" |
23 | 7 | <!-- | 7 | i18n_domain="canonical"> |
24 | 8 | How frustrating. This is needed for just one page registration | 8 | |
25 | 9 | in introspector.zcml. | 9 | <!-- These packages/declarations are required by apidoc. If they are |
26 | 10 | --> | 10 | deemed generally useful, move them to zopeapp.zcml --> |
27 | 11 | <include package="zope.app" file="menus.zcml" /> | 11 | |
28 | 12 | <include package="zope.app.tree.browser" /> | 12 | <browser:menu |
29 | 13 | <include package="zope.app.tree" /> | 13 | id="zmi_views" |
30 | 14 | <include package="zope.app.renderer" file="meta.zcml" /> | 14 | title="Views" |
31 | 15 | description="Menu for displaying alternate representations of an object" | ||
32 | 16 | /> | ||
33 | 17 | <browser:menu | ||
34 | 18 | id="zmi_actions" | ||
35 | 19 | title="Actions" | ||
36 | 20 | description="Menu for displaying actions to be performed" | ||
37 | 21 | /> | ||
38 | 22 | |||
39 | 23 | <!-- Use the default IAbsoluteURL adapter for requests on the apidoc | ||
40 | 24 | vhost. --> | ||
41 | 25 | <adapter | ||
42 | 26 | for="zope.interface.Interface | ||
43 | 27 | canonical.launchpad.webapp.servers.APIDocBrowserRequest" | ||
44 | 28 | provides="zope.traversing.browser.interfaces.IAbsoluteURL" | ||
45 | 29 | factory="zope.traversing.browser.AbsoluteURL" | ||
46 | 30 | /> | ||
47 | 31 | |||
48 | 32 | <view | ||
49 | 33 | for="zope.container.interfaces.IReadContainer" | ||
50 | 34 | type="zope.publisher.interfaces.http.IHTTPRequest" | ||
51 | 35 | provides="zope.publisher.interfaces.IPublishTraverse" | ||
52 | 36 | factory="zope.container.traversal.ContainerTraverser" | ||
53 | 37 | permission="zope.Public" | ||
54 | 38 | allowed_interface="zope.publisher.interfaces.IPublishTraverse" | ||
55 | 39 | /> | ||
56 | 40 | |||
57 | 41 | <utility | ||
58 | 42 | component="canonical.launchpad.systemhomes.apidocroot" | ||
59 | 43 | provides="canonical.launchpad.webapp.interfaces.IAPIDocRoot" /> | ||
60 | 44 | |||
61 | 45 | <adapter factory="canonical.launchpad.webapp.authentication.TemporaryPrincipalAnnotations" /> | ||
62 | 46 | <adapter | ||
63 | 47 | factory="canonical.launchpad.webapp.authentication.TemporaryUnauthenticatedPrincipalAnnotations" /> | ||
64 | 48 | |||
65 | 49 | <class class="canonical.launchpad.webapp.servers.LaunchpadBrowserRequest"> | ||
66 | 50 | <implements interface="zope.app.apidoc.browser.skin.APIDOC" /> | ||
67 | 51 | </class> | ||
68 | 52 | |||
69 | 53 | <!-- apidoc.lp.dev breaks if we make IAPIDocRoot subclass ISite, so we | ||
70 | 54 | need to register this view here. --> | ||
71 | 55 | <view | ||
72 | 56 | for="canonical.launchpad.webapp.interfaces.IAPIDocRoot" | ||
73 | 57 | type="zope.publisher.interfaces.browser.IDefaultBrowserLayer" | ||
74 | 58 | name="" | ||
75 | 59 | factory="zope.browserresource.resources.Resources" | ||
76 | 60 | permission="zope.Public" | ||
77 | 61 | allowed_interface="zope.publisher.interfaces.browser.IBrowserPublisher" | ||
78 | 62 | /> | ||
79 | 63 | |||
80 | 64 | <browser:defaultView | ||
81 | 65 | for="canonical.launchpad.webapp.interfaces.IAPIDocRoot" | ||
82 | 66 | name="++apidoc++" | ||
83 | 67 | /> | ||
84 | 68 | |||
85 | 69 | <!-- Turn on devmode for the following includes to work --> | ||
86 | 70 | <meta:provides feature="devmode" /> | ||
87 | 71 | |||
88 | 72 | <include package="zope.location" /> | ||
89 | 73 | <include package="zope.app.applicationcontrol" /> | ||
90 | 15 | <include package="zope.app.renderer" /> | 74 | <include package="zope.app.renderer" /> |
91 | 16 | |||
92 | 17 | <!-- XXX: StuartBishop 2005-03-13 bug=39834: | ||
93 | 18 | We also need the Z3 preference junk, whatever that is. | ||
94 | 19 | Unfortunately, this depends on annotatable principals so will not | ||
95 | 20 | currently work with Launchpad. We can still get some apidoc functionality, | ||
96 | 21 | such as the ZCML browser, but the bulk of it is not functional. | ||
97 | 22 | --> | ||
98 | 23 | <include package="zope.app.preference" file="meta.zcml" /> | 75 | <include package="zope.app.preference" file="meta.zcml" /> |
100 | 24 | <!-- | 76 | <include package="zope.app.apidoc.codemodule" file="meta.zcml" /> |
101 | 77 | <include package="zope.app.apidoc.bookmodule" file="meta.zcml" /> | ||
102 | 25 | <include package="zope.app.preference" /> | 78 | <include package="zope.app.preference" /> |
110 | 26 | --> | 79 | <include package="zope.app.tree" /> |
104 | 27 | |||
105 | 28 | |||
106 | 29 | <!-- Turn on devmode for the following includes principal=work --> | ||
107 | 30 | <meta:provides feature="devmode" /> | ||
108 | 31 | |||
109 | 32 | <include package="zope.app.apidoc" file="meta.zcml" /> | ||
111 | 33 | <include package="zope.app.apidoc" /> | 80 | <include package="zope.app.apidoc" /> |
112 | 34 | 81 | ||
124 | 35 | <meta:redefinePermission | 82 | <apidoc:rootModule module="canonical" /> |
125 | 36 | from="zope.app.apidoc.UseAPIDoc" to="zope.Public" | 83 | <apidoc:rootModule module="lp" /> |
126 | 37 | /> | 84 | <apidoc:rootModule module="lazr" /> |
127 | 38 | 85 | <apidoc:rootModule module="zc" /> | |
128 | 39 | <!-- Override a strange permission in apidoc --> | 86 | <apidoc:rootModule module="wadllib" /> |
129 | 40 | <class class="zope.app.apidoc.apidoc.APIDocumentation"> | 87 | <apidoc:rootModule module="martian" /> |
130 | 41 | <require | 88 | <apidoc:rootModule module="manuel" /> |
131 | 42 | interface="zope.app.container.interfaces.IReadContainer" | 89 | <apidoc:rootModule module="chameleon" /> |
132 | 43 | permission="zope.Public" | 90 | <apidoc:rootModule module="bzrlib" /> |
133 | 44 | /> | 91 | <apidoc:rootModule module="storm" /> |
123 | 45 | </class> | ||
134 | 46 | 92 | ||
135 | 47 | </configure> | 93 | </configure> |
136 | 48 | |||
137 | 49 | 94 | ||
138 | === modified file 'configs/development/launchpad-lazr.conf' | |||
139 | --- configs/development/launchpad-lazr.conf 2010-07-15 15:57:40 +0000 | |||
140 | +++ configs/development/launchpad-lazr.conf 2010-07-23 19:21:07 +0000 | |||
141 | @@ -300,6 +300,9 @@ | |||
142 | 300 | [vhost.openid] | 300 | [vhost.openid] |
143 | 301 | hostname: openid.launchpad.dev | 301 | hostname: openid.launchpad.dev |
144 | 302 | 302 | ||
145 | 303 | [vhost.apidoc] | ||
146 | 304 | hostname: apidoc.launchpad.dev | ||
147 | 305 | |||
148 | 303 | [vhost.testopenid] | 306 | [vhost.testopenid] |
149 | 304 | hostname: testopenid.dev | 307 | hostname: testopenid.dev |
150 | 305 | 308 | ||
151 | 306 | 309 | ||
152 | === added symlink 'configs/testrunner/apidoc-configure-normal.zcml' | |||
153 | === target is u'../development/apidoc-configure-normal.zcml' | |||
154 | === modified file 'lib/canonical/config/schema-lazr.conf' | |||
155 | --- lib/canonical/config/schema-lazr.conf 2010-07-16 20:55:50 +0000 | |||
156 | +++ lib/canonical/config/schema-lazr.conf 2010-07-23 19:21:07 +0000 | |||
157 | @@ -1977,6 +1977,8 @@ | |||
158 | 1977 | 1977 | ||
159 | 1978 | [vhost.testopenid] | 1978 | [vhost.testopenid] |
160 | 1979 | 1979 | ||
161 | 1980 | [vhost.apidoc] | ||
162 | 1981 | |||
163 | 1980 | [vhost.ubuntu_openid] | 1982 | [vhost.ubuntu_openid] |
164 | 1981 | 1983 | ||
165 | 1982 | [vhost.shipitubuntu] | 1984 | [vhost.shipitubuntu] |
166 | 1983 | 1985 | ||
167 | === modified file 'lib/canonical/launchpad/browser/launchpad.py' | |||
168 | --- lib/canonical/launchpad/browser/launchpad.py 2010-07-14 13:54:20 +0000 | |||
169 | +++ lib/canonical/launchpad/browser/launchpad.py 2010-07-23 19:21:07 +0000 | |||
170 | @@ -62,8 +62,8 @@ | |||
171 | 62 | stepto) | 62 | stepto) |
172 | 63 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb | 63 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb |
173 | 64 | from canonical.launchpad.webapp.interfaces import ( | 64 | from canonical.launchpad.webapp.interfaces import ( |
176 | 65 | GoneError, IBreadcrumb, ILaunchBag, ILaunchpadRoot, INavigationMenu, | 65 | GoneError, IBreadcrumb, ILaunchBag, ILaunchpadRoot, |
177 | 66 | NotFoundError, POSTToNonCanonicalURL) | 66 | INavigationMenu, NotFoundError, POSTToNonCanonicalURL) |
178 | 67 | from canonical.launchpad.webapp.publisher import RedirectionView | 67 | from canonical.launchpad.webapp.publisher import RedirectionView |
179 | 68 | from canonical.launchpad.webapp.authorization import check_permission | 68 | from canonical.launchpad.webapp.authorization import check_permission |
180 | 69 | from canonical.launchpad.webapp.tales import PageTemplateContextsAPI | 69 | from canonical.launchpad.webapp.tales import PageTemplateContextsAPI |
181 | 70 | 70 | ||
182 | === modified file 'lib/canonical/launchpad/doc/webapp-publication.txt' | |||
183 | --- lib/canonical/launchpad/doc/webapp-publication.txt 2010-07-21 00:34:38 +0000 | |||
184 | +++ lib/canonical/launchpad/doc/webapp-publication.txt 2010-07-23 19:21:07 +0000 | |||
185 | @@ -41,6 +41,10 @@ | |||
186 | 41 | rooturl: http://api.launchpad.dev/ | 41 | rooturl: http://api.launchpad.dev/ |
187 | 42 | althosts: | 42 | althosts: |
188 | 43 | ---- | 43 | ---- |
189 | 44 | apidoc @ apidoc.launchpad.dev | ||
190 | 45 | rooturl: http://apidoc.launchpad.dev/ | ||
191 | 46 | althosts: | ||
192 | 47 | ---- | ||
193 | 44 | blueprints @ blueprints.launchpad.dev | 48 | blueprints @ blueprints.launchpad.dev |
194 | 45 | rooturl: http://blueprints.launchpad.dev/ | 49 | rooturl: http://blueprints.launchpad.dev/ |
195 | 46 | althosts: | 50 | althosts: |
196 | @@ -106,6 +110,7 @@ | |||
197 | 106 | ... print hostname | 110 | ... print hostname |
198 | 107 | answers.launchpad.dev | 111 | answers.launchpad.dev |
199 | 108 | api.launchpad.dev | 112 | api.launchpad.dev |
200 | 113 | apidoc.launchpad.dev | ||
201 | 109 | blueprints.launchpad.dev | 114 | blueprints.launchpad.dev |
202 | 110 | bugs.launchpad.dev | 115 | bugs.launchpad.dev |
203 | 111 | code.launchpad.dev | 116 | code.launchpad.dev |
204 | 112 | 117 | ||
205 | === modified file 'lib/canonical/launchpad/layers.py' | |||
206 | --- lib/canonical/launchpad/layers.py 2010-07-21 22:09:39 +0000 | |||
207 | +++ lib/canonical/launchpad/layers.py 2010-07-23 19:21:07 +0000 | |||
208 | @@ -36,6 +36,10 @@ | |||
209 | 36 | """ | 36 | """ |
210 | 37 | 37 | ||
211 | 38 | 38 | ||
212 | 39 | class APIDocLayer(IBrowserRequest, IDefaultBrowserLayer): | ||
213 | 40 | """The `APIDocLayer` layer.""" | ||
214 | 41 | |||
215 | 42 | |||
216 | 39 | class TestOpenIDLayer(LaunchpadLayer): | 43 | class TestOpenIDLayer(LaunchpadLayer): |
217 | 40 | """The `TestOpenIDLayer` layer.""" | 44 | """The `TestOpenIDLayer` layer.""" |
218 | 41 | 45 | ||
219 | 42 | 46 | ||
220 | === modified file 'lib/canonical/launchpad/permissions.zcml' | |||
221 | --- lib/canonical/launchpad/permissions.zcml 2009-11-15 01:05:49 +0000 | |||
222 | +++ lib/canonical/launchpad/permissions.zcml 2010-07-23 19:21:07 +0000 | |||
223 | @@ -85,5 +85,10 @@ | |||
224 | 85 | title="Review Launchpad projects" | 85 | title="Review Launchpad projects" |
225 | 86 | access_level="write" /> | 86 | access_level="write" /> |
226 | 87 | 87 | ||
227 | 88 | <!-- This permission only exists to please apidoc.launchpad.dev and | ||
228 | 89 | shouldn't be used anywhere else. --> | ||
229 | 90 | <permission | ||
230 | 91 | id="zope.ManageApplication" title="Needed by zope.app.apidoc" | ||
231 | 92 | access_level="read" /> | ||
232 | 88 | 93 | ||
233 | 89 | </configure> | 94 | </configure> |
234 | 90 | 95 | ||
235 | === modified file 'lib/canonical/launchpad/security.py' | |||
236 | --- lib/canonical/launchpad/security.py 2010-07-20 12:33:43 +0000 | |||
237 | +++ lib/canonical/launchpad/security.py 2010-07-23 19:21:07 +0000 | |||
238 | @@ -1080,13 +1080,27 @@ | |||
239 | 1080 | 1080 | ||
240 | 1081 | 1081 | ||
241 | 1082 | class UseApiDoc(AuthorizationBase): | 1082 | class UseApiDoc(AuthorizationBase): |
242 | 1083 | """This is just to please apidoc.launchpad.dev.""" | ||
243 | 1083 | permission = 'zope.app.apidoc.UseAPIDoc' | 1084 | permission = 'zope.app.apidoc.UseAPIDoc' |
244 | 1084 | usedfor = Interface | 1085 | usedfor = Interface |
245 | 1085 | 1086 | ||
246 | 1087 | def checkUnauthenticated(self): | ||
247 | 1088 | return True | ||
248 | 1089 | |||
249 | 1086 | def checkAuthenticated(self, user): | 1090 | def checkAuthenticated(self, user): |
250 | 1087 | return True | 1091 | return True |
251 | 1088 | 1092 | ||
252 | 1089 | 1093 | ||
253 | 1094 | class ManageApplicationForEverybody(UseApiDoc): | ||
254 | 1095 | """This is just to please apidoc.launchpad.dev. | ||
255 | 1096 | |||
256 | 1097 | We do this because zope.app.apidoc uses that permission, but nothing else | ||
257 | 1098 | should be using it. | ||
258 | 1099 | """ | ||
259 | 1100 | permission = 'zope.ManageApplication' | ||
260 | 1101 | usedfor = Interface | ||
261 | 1102 | |||
262 | 1103 | |||
263 | 1090 | class OnlyBazaarExpertsAndAdmins(AuthorizationBase): | 1104 | class OnlyBazaarExpertsAndAdmins(AuthorizationBase): |
264 | 1091 | """Base class that allows only the Launchpad admins and Bazaar | 1105 | """Base class that allows only the Launchpad admins and Bazaar |
265 | 1092 | experts.""" | 1106 | experts.""" |
266 | 1093 | 1107 | ||
267 | === modified file 'lib/canonical/launchpad/systemhomes.py' | |||
268 | --- lib/canonical/launchpad/systemhomes.py 2010-04-19 06:35:23 +0000 | |||
269 | +++ lib/canonical/launchpad/systemhomes.py 2010-07-23 19:21:07 +0000 | |||
270 | @@ -6,7 +6,7 @@ | |||
271 | 6 | __all__ = [ | 6 | __all__ = [ |
272 | 7 | 'AuthServerApplication', | 7 | 'AuthServerApplication', |
273 | 8 | 'BazaarApplication', | 8 | 'BazaarApplication', |
275 | 9 | 'CodeImportScheduler', | 9 | 'CodeImportSchedulerApplication', |
276 | 10 | 'FeedsApplication', | 10 | 'FeedsApplication', |
277 | 11 | 'MailingListApplication', | 11 | 'MailingListApplication', |
278 | 12 | 'MaloneApplication', | 12 | 'MaloneApplication', |
279 | @@ -39,7 +39,8 @@ | |||
280 | 39 | from lp.hardwaredb.interfaces.hwdb import ( | 39 | from lp.hardwaredb.interfaces.hwdb import ( |
281 | 40 | IHWDeviceSet, IHWDriverSet, IHWSubmissionDeviceSet, IHWSubmissionSet, | 40 | IHWDeviceSet, IHWDriverSet, IHWSubmissionDeviceSet, IHWSubmissionSet, |
282 | 41 | IHWVendorIDSet, ParameterError) | 41 | IHWVendorIDSet, ParameterError) |
284 | 42 | from canonical.launchpad.webapp.interfaces import ICanonicalUrlData | 42 | from canonical.launchpad.webapp.interfaces import ( |
285 | 43 | IAPIDocRoot, ICanonicalUrlData) | ||
286 | 43 | from lp.bugs.interfaces.bug import ( | 44 | from lp.bugs.interfaces.bug import ( |
287 | 44 | CreateBugParams, IBugSet, InvalidBugTargetType) | 45 | CreateBugParams, IBugSet, InvalidBugTargetType) |
288 | 45 | from lp.code.interfaces.codehosting import ICodehostingApplication | 46 | from lp.code.interfaces.codehosting import ICodehostingApplication |
289 | @@ -388,3 +389,11 @@ | |||
290 | 388 | 389 | ||
291 | 389 | class TestOpenIDApplication: | 390 | class TestOpenIDApplication: |
292 | 390 | implements(ITestOpenIDApplication) | 391 | implements(ITestOpenIDApplication) |
293 | 392 | |||
294 | 393 | |||
295 | 394 | class APIDocRoot: | ||
296 | 395 | implements(IAPIDocRoot) | ||
297 | 396 | __parent__ = None | ||
298 | 397 | __name__ = None | ||
299 | 398 | |||
300 | 399 | apidocroot = APIDocRoot() | ||
301 | 391 | 400 | ||
302 | === modified file 'lib/canonical/launchpad/webapp/authentication.py' | |||
303 | --- lib/canonical/launchpad/webapp/authentication.py 2010-02-16 14:25:51 +0000 | |||
304 | +++ lib/canonical/launchpad/webapp/authentication.py 2010-07-23 19:21:07 +0000 | |||
305 | @@ -16,12 +16,16 @@ | |||
306 | 16 | import binascii | 16 | import binascii |
307 | 17 | import hashlib | 17 | import hashlib |
308 | 18 | import random | 18 | import random |
309 | 19 | from UserDict import UserDict | ||
310 | 19 | 20 | ||
311 | 20 | from contrib.oauth import OAuthRequest | 21 | from contrib.oauth import OAuthRequest |
312 | 21 | 22 | ||
313 | 23 | from zope.annotation.interfaces import IAnnotations | ||
314 | 24 | from zope.authentication.interfaces import IUnauthenticatedPrincipal | ||
315 | 22 | from zope.interface import implements | 25 | from zope.interface import implements |
317 | 23 | from zope.component import getUtility | 26 | from zope.component import adapts, getUtility |
318 | 24 | from zope.event import notify | 27 | from zope.event import notify |
319 | 28 | from zope.preference.interfaces import IPreferenceGroup | ||
320 | 25 | 29 | ||
321 | 26 | from zope.security.proxy import removeSecurityProxy | 30 | from zope.security.proxy import removeSecurityProxy |
322 | 27 | 31 | ||
323 | @@ -320,6 +324,22 @@ | |||
324 | 320 | return encryptor.validate(pw1, pw2) | 324 | return encryptor.validate(pw1, pw2) |
325 | 321 | 325 | ||
326 | 322 | 326 | ||
327 | 327 | # zope.app.apidoc expects our principals to be adaptable into IAnnotations, so | ||
328 | 328 | # we use these dummy adapters here just to make that code not OOPS. | ||
329 | 329 | class TemporaryPrincipalAnnotations(UserDict): | ||
330 | 330 | implements(IAnnotations) | ||
331 | 331 | adapts(ILaunchpadPrincipal, IPreferenceGroup) | ||
332 | 332 | |||
333 | 333 | def __init__(self, principal, pref_group): | ||
334 | 334 | UserDict.__init__(self) | ||
335 | 335 | |||
336 | 336 | |||
337 | 337 | class TemporaryUnauthenticatedPrincipalAnnotations( | ||
338 | 338 | TemporaryPrincipalAnnotations): | ||
339 | 339 | implements(IAnnotations) | ||
340 | 340 | adapts(IUnauthenticatedPrincipal, IPreferenceGroup) | ||
341 | 341 | |||
342 | 342 | |||
343 | 323 | def get_oauth_authorization(request): | 343 | def get_oauth_authorization(request): |
344 | 324 | """Retrieve OAuth authorization information from a request. | 344 | """Retrieve OAuth authorization information from a request. |
345 | 325 | 345 | ||
346 | 326 | 346 | ||
347 | === modified file 'lib/canonical/launchpad/webapp/authorization.py' | |||
348 | --- lib/canonical/launchpad/webapp/authorization.py 2010-01-14 13:25:34 +0000 | |||
349 | +++ lib/canonical/launchpad/webapp/authorization.py 2010-07-23 19:21:07 +0000 | |||
350 | @@ -10,6 +10,7 @@ | |||
351 | 10 | from zope.component import getUtility, queryAdapter | 10 | from zope.component import getUtility, queryAdapter |
352 | 11 | from zope.browser.interfaces import IView | 11 | from zope.browser.interfaces import IView |
353 | 12 | 12 | ||
354 | 13 | from zope.proxy import removeAllProxies | ||
355 | 13 | from zope.publisher.interfaces import IApplicationRequest | 14 | from zope.publisher.interfaces import IApplicationRequest |
356 | 14 | from zope.security.interfaces import ISecurityPolicy | 15 | from zope.security.interfaces import ISecurityPolicy |
357 | 15 | from zope.security.checker import CheckerPublic | 16 | from zope.security.checker import CheckerPublic |
358 | @@ -138,8 +139,11 @@ | |||
359 | 138 | # We will not be able to lookup an adapter for this, so we can | 139 | # We will not be able to lookup an adapter for this, so we can |
360 | 139 | # return False already. | 140 | # return False already. |
361 | 140 | return False | 141 | return False |
364 | 141 | # Remove security proxies from object to authorize. | 142 | # Remove all proxies from object to authorize. The security proxy is |
365 | 142 | objecttoauthorize = removeSecurityProxy(objecttoauthorize) | 143 | # removed for obvious reasons but we also need to remove the location |
366 | 144 | # proxy (which is used on apidoc.lp.dev) because otherwise we can't | ||
367 | 145 | # create a weak reference to our object in our security policy cache. | ||
368 | 146 | objecttoauthorize = removeAllProxies(objecttoauthorize) | ||
369 | 143 | 147 | ||
370 | 144 | participations = [participation | 148 | participations = [participation |
371 | 145 | for participation in self.participations | 149 | for participation in self.participations |
372 | 146 | 150 | ||
373 | === modified file 'lib/canonical/launchpad/webapp/configure.zcml' | |||
374 | --- lib/canonical/launchpad/webapp/configure.zcml 2010-07-15 15:57:40 +0000 | |||
375 | +++ lib/canonical/launchpad/webapp/configure.zcml 2010-07-23 19:21:07 +0000 | |||
376 | @@ -672,7 +672,7 @@ | |||
377 | 672 | permission="zope.Public" | 672 | permission="zope.Public" |
378 | 673 | class="canonical.launchpad.webapp.launchbag.LaunchBagView" | 673 | class="canonical.launchpad.webapp.launchbag.LaunchBagView" |
379 | 674 | /> | 674 | /> |
381 | 675 | 675 | ||
382 | 676 | <!-- Resource unnamed view, allowing Z3 preferred spelling | 676 | <!-- Resource unnamed view, allowing Z3 preferred spelling |
383 | 677 | /@@/launchpad-icon-small to access the images directory --> | 677 | /@@/launchpad-icon-small to access the images directory --> |
384 | 678 | <browser:page | 678 | <browser:page |
385 | 679 | 679 | ||
386 | === modified file 'lib/canonical/launchpad/webapp/interfaces.py' | |||
387 | --- lib/canonical/launchpad/webapp/interfaces.py 2010-07-15 15:59:24 +0000 | |||
388 | +++ lib/canonical/launchpad/webapp/interfaces.py 2010-07-23 19:21:07 +0000 | |||
389 | @@ -65,6 +65,10 @@ | |||
390 | 65 | """ | 65 | """ |
391 | 66 | 66 | ||
392 | 67 | 67 | ||
393 | 68 | class IAPIDocRoot(IContainmentRoot): | ||
394 | 69 | """Marker interface for the root object of the apidoc vhost.""" | ||
395 | 70 | |||
396 | 71 | |||
397 | 68 | class ILaunchpadContainer(Interface): | 72 | class ILaunchpadContainer(Interface): |
398 | 69 | """Marker interface for objects used as the context of something.""" | 73 | """Marker interface for objects used as the context of something.""" |
399 | 70 | 74 | ||
400 | 71 | 75 | ||
401 | === modified file 'lib/canonical/launchpad/webapp/publisher.py' | |||
402 | --- lib/canonical/launchpad/webapp/publisher.py 2010-03-15 17:17:05 +0000 | |||
403 | +++ lib/canonical/launchpad/webapp/publisher.py 2010-07-23 19:21:07 +0000 | |||
404 | @@ -544,9 +544,6 @@ | |||
405 | 544 | 544 | ||
406 | 545 | class RootObject: | 545 | class RootObject: |
407 | 546 | implements(ILaunchpadApplication, ILaunchpadRoot) | 546 | implements(ILaunchpadApplication, ILaunchpadRoot) |
408 | 547 | # These next two needed by the Z3 API browser | ||
409 | 548 | __parent__ = None | ||
410 | 549 | __name__ = 'Launchpad' | ||
411 | 550 | 547 | ||
412 | 551 | 548 | ||
413 | 552 | rootObject = ProxyFactory(RootObject(), NamesChecker(["__class__"])) | 549 | rootObject = ProxyFactory(RootObject(), NamesChecker(["__class__"])) |
414 | 553 | 550 | ||
415 | === modified file 'lib/canonical/launchpad/webapp/servers.py' | |||
416 | --- lib/canonical/launchpad/webapp/servers.py 2010-07-23 18:54:44 +0000 | |||
417 | +++ lib/canonical/launchpad/webapp/servers.py 2010-07-23 19:21:07 +0000 | |||
418 | @@ -61,7 +61,7 @@ | |||
419 | 61 | from canonical.launchpad.webapp.notifications import ( | 61 | from canonical.launchpad.webapp.notifications import ( |
420 | 62 | NotificationRequest, NotificationResponse, NotificationList) | 62 | NotificationRequest, NotificationResponse, NotificationList) |
421 | 63 | from canonical.launchpad.webapp.interfaces import ( | 63 | from canonical.launchpad.webapp.interfaces import ( |
423 | 64 | IBasicLaunchpadRequest, IBrowserFormNG, | 64 | IAPIDocRoot, IBasicLaunchpadRequest, IBrowserFormNG, |
424 | 65 | ILaunchpadBrowserApplicationRequest, ILaunchpadProtocolError, | 65 | ILaunchpadBrowserApplicationRequest, ILaunchpadProtocolError, |
425 | 66 | INotificationRequest, INotificationResponse, IPlacelessAuthUtility, | 66 | INotificationRequest, INotificationResponse, IPlacelessAuthUtility, |
426 | 67 | IPlacelessLoginSource, OAuthPermission, UnexpectedFormData) | 67 | IPlacelessLoginSource, OAuthPermission, UnexpectedFormData) |
427 | @@ -1077,6 +1077,16 @@ | |||
428 | 1077 | implements(canonical.launchpad.layers.FeedsLayer) | 1077 | implements(canonical.launchpad.layers.FeedsLayer) |
429 | 1078 | 1078 | ||
430 | 1079 | 1079 | ||
431 | 1080 | # ---- apidoc | ||
432 | 1081 | |||
433 | 1082 | class APIDocBrowserRequest(LaunchpadBrowserRequest): | ||
434 | 1083 | implements(canonical.launchpad.layers.APIDocLayer) | ||
435 | 1084 | |||
436 | 1085 | |||
437 | 1086 | class APIDocBrowserPublication(LaunchpadBrowserPublication): | ||
438 | 1087 | root_object_interface = IAPIDocRoot | ||
439 | 1088 | |||
440 | 1089 | |||
441 | 1080 | # ---- testopenid | 1090 | # ---- testopenid |
442 | 1081 | 1091 | ||
443 | 1082 | class TestOpenIDBrowserRequest(LaunchpadBrowserRequest): | 1092 | class TestOpenIDBrowserRequest(LaunchpadBrowserRequest): |
444 | @@ -1442,6 +1452,10 @@ | |||
445 | 1442 | factories.append(VHRP('testopenid', TestOpenIDBrowserRequest, | 1452 | factories.append(VHRP('testopenid', TestOpenIDBrowserRequest, |
446 | 1443 | TestOpenIDBrowserPublication)) | 1453 | TestOpenIDBrowserPublication)) |
447 | 1444 | 1454 | ||
448 | 1455 | if config.devmode: | ||
449 | 1456 | factories.append( | ||
450 | 1457 | VHRP('apidoc', APIDocBrowserRequest, APIDocBrowserPublication)) | ||
451 | 1458 | |||
452 | 1445 | # We may also have a private XML-RPC server. | 1459 | # We may also have a private XML-RPC server. |
453 | 1446 | private_port = None | 1460 | private_port = None |
454 | 1447 | for server in config.servers: | 1461 | for server in config.servers: |
455 | 1448 | 1462 | ||
456 | === added file 'lib/lp/app/stories/apidoc.txt' | |||
457 | --- lib/lp/app/stories/apidoc.txt 1970-01-01 00:00:00 +0000 | |||
458 | +++ lib/lp/app/stories/apidoc.txt 2010-07-23 19:21:07 +0000 | |||
459 | @@ -0,0 +1,25 @@ | |||
460 | 1 | Launchpad's API docs | ||
461 | 2 | ==================== | ||
462 | 3 | |||
463 | 4 | It is generated by the zope.app.apidoc package, and can be seen on | ||
464 | 5 | apidoc.launchpad.dev. (Note that this is just a smoke test) | ||
465 | 6 | |||
466 | 7 | >>> browser.open('http://apidoc.launchpad.dev') | ||
467 | 8 | >>> print extract_text(browser.contents) | ||
468 | 9 | Zope 3 API Documentation | ||
469 | 10 | |||
470 | 11 | It uses frames, so here we open the URL of the main frame manually. | ||
471 | 12 | |||
472 | 13 | >>> browser.open('http://apidoc.launchpad.dev/++apidoc++/contents.html') | ||
473 | 14 | >>> print extract_text(browser.contents) | ||
474 | 15 | Zope 3 apidoc... | ||
475 | 16 | Welcome to the Zope 3 API documentation tool... | ||
476 | 17 | Code Browser... | ||
477 | 18 | Interfaces... | ||
478 | 19 | |||
479 | 20 | And here we open the page of one of our interfaces, just to make sure they | ||
480 | 21 | render fine. | ||
481 | 22 | |||
482 | 23 | >>> browser.open('http://apidoc.launchpad.dev/++apidoc++/Interface/' | ||
483 | 24 | ... 'lp.code.interfaces.branchcollection.IAllBranches/' | ||
484 | 25 | ... 'index.html') | ||
485 | 0 | 26 | ||
486 | === modified file 'setup.py' | |||
487 | --- setup.py 2010-07-21 18:51:37 +0000 | |||
488 | +++ setup.py 2010-07-23 19:21:07 +0000 | |||
489 | @@ -71,6 +71,7 @@ | |||
490 | 71 | 'z3c.pt', | 71 | 'z3c.pt', |
491 | 72 | 'z3c.ptcompat', | 72 | 'z3c.ptcompat', |
492 | 73 | 'zc.zservertracelog', | 73 | 'zc.zservertracelog', |
493 | 74 | 'zope.app.apidoc', | ||
494 | 74 | 'zope.app.appsetup', | 75 | 'zope.app.appsetup', |
495 | 75 | 'zope.app.component', | 76 | 'zope.app.component', |
496 | 76 | 'zope.app.dav', # ./package-includes/dav-configure.zcml | 77 | 'zope.app.dav', # ./package-includes/dav-configure.zcml |
497 | @@ -78,7 +79,9 @@ | |||
498 | 78 | 'zope.app.exception', | 79 | 'zope.app.exception', |
499 | 79 | 'zope.app.file', | 80 | 'zope.app.file', |
500 | 80 | 'zope.app.form', | 81 | 'zope.app.form', |
501 | 82 | 'zope.app.onlinehelp', | ||
502 | 81 | 'zope.app.pagetemplate', | 83 | 'zope.app.pagetemplate', |
503 | 84 | 'zope.app.preference', | ||
504 | 82 | 'zope.app.publication', | 85 | 'zope.app.publication', |
505 | 83 | 'zope.app.publisher', | 86 | 'zope.app.publisher', |
506 | 84 | 'zope.app.security', | 87 | 'zope.app.security', |
507 | @@ -86,6 +89,7 @@ | |||
508 | 86 | 'zope.app.server', | 89 | 'zope.app.server', |
509 | 87 | 'zope.app.session', | 90 | 'zope.app.session', |
510 | 88 | 'zope.app.testing', | 91 | 'zope.app.testing', |
511 | 92 | 'zope.app.tree', | ||
512 | 89 | 'zope.app.zcmlfiles', | 93 | 'zope.app.zcmlfiles', |
513 | 90 | 'zope.app.wsgi', | 94 | 'zope.app.wsgi', |
514 | 91 | 'zope.app.zapi', | 95 | 'zope.app.zapi', |
515 | @@ -102,6 +106,7 @@ | |||
516 | 102 | 'zope.hookable', # indirect, via zope.app.component | 106 | 'zope.hookable', # indirect, via zope.app.component |
517 | 103 | 'zope.lifecycleevent', | 107 | 'zope.lifecycleevent', |
518 | 104 | 'zope.location', | 108 | 'zope.location', |
519 | 109 | 'zope.login', | ||
520 | 105 | 'zope.pagetemplate', | 110 | 'zope.pagetemplate', |
521 | 106 | 'zope.publisher', | 111 | 'zope.publisher', |
522 | 107 | 'zope.proxy', | 112 | 'zope.proxy', |
523 | 108 | 113 | ||
524 | === modified file 'site.zcml' | |||
525 | --- site.zcml 2009-07-13 18:15:02 +0000 | |||
526 | +++ site.zcml 2010-07-23 19:21:07 +0000 | |||
527 | @@ -38,4 +38,5 @@ | |||
528 | 38 | <include file="summarizerequests.zcml" /> | 38 | <include file="summarizerequests.zcml" /> |
529 | 39 | 39 | ||
530 | 40 | <include package="zc.zservertracelog" /> | 40 | <include package="zc.zservertracelog" /> |
531 | 41 | |||
532 | 41 | </configure> | 42 | </configure> |
533 | 42 | 43 | ||
534 | === modified file 'versions.cfg' | |||
535 | --- versions.cfg 2010-07-21 18:51:37 +0000 | |||
536 | +++ versions.cfg 2010-07-23 19:21:07 +0000 | |||
537 | @@ -124,6 +124,7 @@ | |||
538 | 124 | ZODB3 = 3.9.2 | 124 | ZODB3 = 3.9.2 |
539 | 125 | zodbcode = 3.4.0 | 125 | zodbcode = 3.4.0 |
540 | 126 | zope.annotation = 3.5.0 | 126 | zope.annotation = 3.5.0 |
541 | 127 | zope.app.apidoc = 3.7.3 | ||
542 | 127 | zope.app.applicationcontrol = 3.5.1 | 128 | zope.app.applicationcontrol = 3.5.1 |
543 | 128 | zope.app.appsetup = 3.12.0 | 129 | zope.app.appsetup = 3.12.0 |
544 | 129 | zope.app.authentication = 3.6.1 | 130 | zope.app.authentication = 3.6.1 |
545 | @@ -146,7 +147,10 @@ | |||
546 | 146 | zope.app.interface = 3.5.0 | 147 | zope.app.interface = 3.5.0 |
547 | 147 | zope.app.locales = 3.5.1 | 148 | zope.app.locales = 3.5.1 |
548 | 148 | zope.app.localpermission = 3.7.0 | 149 | zope.app.localpermission = 3.7.0 |
549 | 150 | zope.app.onlinehelp = 3.5.2 | ||
550 | 149 | zope.app.pagetemplate = 3.7.1 | 151 | zope.app.pagetemplate = 3.7.1 |
551 | 152 | zope.app.preference = 3.8.1 | ||
552 | 153 | zope.preference = 3.8.0 | ||
553 | 150 | zope.app.principalannotation = 3.6.1 | 154 | zope.app.principalannotation = 3.6.1 |
554 | 151 | zope.app.publication = 3.9.0 | 155 | zope.app.publication = 3.9.0 |
555 | 152 | zope.app.publisher = 3.10.0 | 156 | zope.app.publisher = 3.10.0 |
556 | @@ -159,6 +163,7 @@ | |||
557 | 159 | # not in ZTK | 163 | # not in ZTK |
558 | 160 | zope.app.session = 3.6.0 | 164 | zope.app.session = 3.6.0 |
559 | 161 | zope.app.testing = 3.7.5 | 165 | zope.app.testing = 3.7.5 |
560 | 166 | zope.app.tree = 3.6.0 | ||
561 | 162 | zope.app.wsgi = 3.6.0 | 167 | zope.app.wsgi = 3.6.0 |
562 | 163 | # not in ZTK | 168 | # not in ZTK |
563 | 164 | zope.app.zapi = 3.4.1 | 169 | zope.app.zapi = 3.4.1 |
564 | @@ -198,6 +203,7 @@ | |||
565 | 198 | zope.interface = 3.5.2 | 203 | zope.interface = 3.5.2 |
566 | 199 | zope.lifecycleevent = 3.5.2 | 204 | zope.lifecycleevent = 3.5.2 |
567 | 200 | zope.location = 3.7.0 | 205 | zope.location = 3.7.0 |
568 | 206 | zope.login = 1.0.0 | ||
569 | 201 | zope.minmax = 1.1.1 | 207 | zope.minmax = 1.1.1 |
570 | 202 | zope.modulealias = 3.4.0 | 208 | zope.modulealias = 3.4.0 |
571 | 203 | zope.pagetemplate = 3.5.0 | 209 | zope.pagetemplate = 3.5.0 |
572 | @@ -207,7 +213,7 @@ | |||
573 | 207 | zope.processlifetime = 1.0 | 213 | zope.processlifetime = 1.0 |
574 | 208 | zope.proxy = 3.5.0 | 214 | zope.proxy = 3.5.0 |
575 | 209 | zope.ptresource = 3.9.0 | 215 | zope.ptresource = 3.9.0 |
577 | 210 | zope.publisher = 3.10.0 | 216 | zope.publisher = 3.12.0 |
578 | 211 | zope.schema = 3.5.4 | 217 | zope.schema = 3.5.4 |
579 | 212 | zope.security = 3.7.1 | 218 | zope.security = 3.7.1 |
580 | 213 | zope.securitypolicy = 3.6.1 | 219 | zope.securitypolicy = 3.6.1 |
581 | 214 | 220 | ||
582 | === modified file 'zopeapp.zcml' | |||
583 | --- zopeapp.zcml 2009-07-13 18:15:02 +0000 | |||
584 | +++ zopeapp.zcml 2010-07-23 19:21:07 +0000 | |||
585 | @@ -25,6 +25,8 @@ | |||
586 | 25 | <include package="zope.app.interface" /> | 25 | <include package="zope.app.interface" /> |
587 | 26 | <include package="zope.app.security" /> | 26 | <include package="zope.app.security" /> |
588 | 27 | 27 | ||
589 | 28 | <include package="zope.login" /> | ||
590 | 29 | |||
591 | 28 | <!-- | 30 | <!-- |
592 | 29 | <include package="zope.app.observable" /> | 31 | <include package="zope.app.observable" /> |
593 | 30 | <include package="zope.app.annotation" /> | 32 | <include package="zope.app.annotation" /> |
Hi Salgado. Very cool. Thank you. Comments below.
Requested:
- Let's put the changes from lib/canonical/ launchpad/ webapp/ configure. zcml into apidoc- configure- normal. zcml.
Questions and comments:
- Why is this necessary, do you know? I realize it is an existing code that you moved around, but neither the comment nor the "provides" made much sense to me, though Google did show me some hints that it might be standard practice for enabling the apidoc for some reason. Did you try removing it?
+ <!-- Turn on devmode for the following includes principal=work -->
+ <meta:provides feature="devmode" />
- I'm concerned that the tests are going to be run with even more registrations that will not be part of production. I wish there were a light, easy way to start up another LP instance for the apidoc smoke test that then would not pollute the rest of the tests with the apidoc registrations in the zcml file. However, I don't know of one, and unless you do, I won't insist that we address this concern. It's certainly just slightly enlarging an existing problem, rather than making a new one.
- Did you audit zope.login to make sure it's registrations don't do something we need to be worried about from a security perspective? If not, one of us should. I'd feel somewhat happier if ``<include package= "zope.login" />`` were part of the apidoc zcml, but then we're exacerbating the previous problem (that is, production registrations are more and more different from test registrations).
Suggested:
- I suggest renaming LaunchpadPrinci palAnnotations to TemporaryPrinci palAnnotations: the behavior (and the fact that the implementation is effectively a stub) is something worth highlighting. Calling it "Launchpad" doesn't buy us anything.
- FWIW, LaunchpadPrinci palAnnotations could subclass UserDict.UserDict and be shortened to the __init__ plus a call to the shared constructor and the interface declarations. Do it if you want.
- For this comment: ource as apidoc breaks if we make
+ <!-- XXX: Copied from zope.browserres
+ IAPIDocRoot implement ISite so that the original registration works
+ for us. -->
I suggest that this is not an XXX. To that point, this is not "Copied" but "Modified" (the "for" is different, and that's the key).
- For this comment: ainer. Safer:
+ <!-- XXX Probably make this in overrides for ISimpleReadCont
+ register for all apidoc containers, one way or another -->
You mentioned that these comments came from me. I think we can just remove the comment entirely. As I said on IRC, for the first half, I think I expected that this was going to have to go in overrides. Since it works without being in overrides, this is a "never mind...". For the second half ("Safer:..."), I think we're probably fine. It would be nice if we could easily register this only for the bots we care about, but, eh. It's all right, I think.
- I have said that I was fine with the change to authorization.py, but actually I had another idea. I'm not 100% convinced the new idea is better, but it is simpler, at least. The idea is to revert all current changes from that file, and then add ``from zope.proxy import removeAllProx...