Merge lp:~stevenk/launchpad/less-lazr-security into lp:launchpad

Proposed by Steve Kowalik
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 12437
Proposed branch: lp:~stevenk/launchpad/less-lazr-security
Merge into: lp:launchpad
Diff against target: 118 lines (+1/-92)
4 files modified
lib/canonical/lazr/debug.py (+0/-9)
lib/canonical/lazr/doc/checker-utilities.txt (+0/-73)
lib/canonical/lazr/security.py (+0/-9)
versions.cfg (+1/-1)
To merge this branch: bzr merge lp:~stevenk/launchpad/less-lazr-security
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
William Grant code* Approve
Review via email: mp+50824@code.launchpad.net

Commit message

[r=lifeless,wgrant][no-qa] Remove a doctest and some glue from lib/canonical/lazr.

Description of the change

Delete as much of lib/canonical/lazr as I could. The doctest is now in lazr.restful 0.17.1, and so the helper methods can die too.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code*)
Revision history for this message
Robert Collins (lifeless) :
review: Approve
Revision history for this message
Robert Collins (lifeless) wrote :

Be ware that shipit may choose to hate on you. We'll see.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'lib/canonical/lazr/debug.py'
2--- lib/canonical/lazr/debug.py 2009-06-25 05:30:52 +0000
3+++ lib/canonical/lazr/debug.py 1970-01-01 00:00:00 +0000
4@@ -1,9 +0,0 @@
5-# Copyright 2009 Canonical Ltd. This software is licensed under the
6-# GNU Affero General Public License version 3 (see the file LICENSE).
7-
8-# Re-import code from lazr.restful until it can be refactored into a
9-# utility module.
10-__all__ = []
11-import lazr.restful.debug
12-__all__.extend(lazr.restful.debug.__all__)
13-from lazr.restful.debug import *
14
15=== removed file 'lib/canonical/lazr/doc/checker-utilities.txt'
16--- lib/canonical/lazr/doc/checker-utilities.txt 2009-04-17 10:32:16 +0000
17+++ lib/canonical/lazr/doc/checker-utilities.txt 1970-01-01 00:00:00 +0000
18@@ -1,73 +0,0 @@
19-= Utilities to define security checkers =
20-
21-LAZR provides utility functions to make it easy to define security
22-checkers for content class.
23-
24-[XXX leonardr 2009-04-02 bug=354441
25- This test should be moved into the same lazr module as the code it
26- tests, security.py (in lazr.restful as of this writing.)]
27-
28-
29-== protect_schema() ==
30-
31-The protect_schema() function will define a checker for a class based on
32-the schema passed in as parameter.
33-
34- >>> from canonical.lazr.security import protect_schema
35- >>> from zope.interface import Attribute, Interface, implements
36- >>> from zope.schema import TextLine
37-
38- >>> class MySchema(Interface):
39- ... an_attr = Attribute(u'An attribute.')
40- ...
41- ... a_field = TextLine(title=u'A property that can be set.')
42- ...
43- ... a_read_only_field = TextLine(
44- ... title=u'A read only property', readonly=True)
45- ...
46- ... def aMethod():
47- ... "A simple method."
48-
49- >>> class MyContent(object):
50- ... implements(MySchema)
51- ... def __init__(self, an_attr, a_field, a_read_only_field):
52- ... self.an_attr = an_attr
53- ... self.a_field = a_field
54- ... self.a_read_only_field = a_read_only_field
55- ...
56- ... def aMethod(self):
57- ... pass
58- ...
59- >>> protect_schema(MyContent, MySchema)
60-
61-By default, the defined checker will grant public access to all
62-attributes defined in the schema.
63-
64- >>> from canonical.lazr.debug import debug_proxy
65- >>> from zope.security.checker import undefineChecker, ProxyFactory
66- >>> content = MyContent(1, u'Mutable Field', u'RO Field')
67-
68- # ProxyFactory wraps the content using the defined checker.
69- >>> print debug_proxy(ProxyFactory(content))
70- zope.security._proxy._Proxy (using zope.security.checker.Checker)
71- public: aMethod, a_field, a_read_only_field, an_attr
72-
73-The permission required can be specified using the read_permission
74-parameter:
75-
76- >>> undefineChecker(MyContent)
77- >>> protect_schema(MyContent, MySchema, read_permission='lazr.View')
78- >>> print debug_proxy(ProxyFactory(content))
79- zope.security._proxy._Proxy (using zope.security.checker.Checker)
80- lazr.View: aMethod, a_field, a_read_only_field, an_attr
81-
82-If you specify a write_permission parameter, set permission will be
83-granted for Attribute and non-readonly fields defined in the schema.
84-
85- >>> undefineChecker(MyContent)
86- >>> protect_schema(MyContent, MySchema, write_permission='lazr.Edit')
87- >>> print debug_proxy(ProxyFactory(content))
88- zope.security._proxy._Proxy (using zope.security.checker.Checker)
89- lazr.Edit (set): a_field, an_attr
90- public: aMethod, a_field, a_read_only_field, an_attr
91-
92
93=== removed file 'lib/canonical/lazr/security.py'
94--- lib/canonical/lazr/security.py 2009-06-25 05:30:52 +0000
95+++ lib/canonical/lazr/security.py 1970-01-01 00:00:00 +0000
96@@ -1,9 +0,0 @@
97-# Copyright 2009 Canonical Ltd. This software is licensed under the
98-# GNU Affero General Public License version 3 (see the file LICENSE).
99-
100-# Re-import code from lazr.restful until it can be refactored into a
101-# utility module.
102-__all__ = []
103-import lazr.restful.security
104-__all__.extend(lazr.restful.security.__all__)
105-from lazr.restful.security import *
106
107=== modified file 'versions.cfg'
108--- versions.cfg 2011-02-17 01:41:03 +0000
109+++ versions.cfg 2011-02-22 23:06:22 +0000
110@@ -33,7 +33,7 @@
111 lazr.delegates = 1.2.0
112 lazr.enum = 1.1.2
113 lazr.lifecycle = 1.1
114-lazr.restful = 0.16.1
115+lazr.restful = 0.17.1
116 lazr.restfulclient = 0.11.2
117 lazr.smtptest = 1.1
118 lazr.testing = 0.1.1