~ubuntu-branches/ubuntu/wily/zope.app.security/wily

« back to all changes in this revision

Viewing changes to PKG-INFO

  • Committer: Bazaar Package Importer
  • Author(s): Gediminas Paulauskas
  • Date: 2010-12-02 19:34:05 UTC
  • Revision ID: james.westby@ubuntu.com-20101202193405-ssc1x1c1pznqdrnc
Tags: upstream-3.7.5
ImportĀ upstreamĀ versionĀ 3.7.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Metadata-Version: 1.0
 
2
Name: zope.app.security
 
3
Version: 3.7.5
 
4
Summary: ZMI Views For Zope3 Security Components
 
5
Home-page: http://pypi.python.org/pypi/zope.app.security
 
6
Author: Zope Foundation and Contributors
 
7
Author-email: zope-dev@zope.org
 
8
License: ZPL 2.1
 
9
Description: This package provides ZMI browser views for Zope security components.
 
10
        
 
11
        It used to provide a large part of security functionality for Zope 3, but it was
 
12
        factored out from this package to several little packages to reduce dependencies
 
13
        and improve reusability.
 
14
        
 
15
        The functionality was splitted into these new packages:
 
16
        
 
17
        * zope.authentication - the IAuthentication interface and related utilities.
 
18
        * zope.principalregistry - the global principal registry and its zcml directives.
 
19
        * zope.app.localpermission - the LocalPermission class that implements
 
20
        persistent permissions.
 
21
        
 
22
        The rest of functionality that were provided by this package is merged into
 
23
        ``zope.security`` and ``zope.publisher``.
 
24
        
 
25
        Backward-compatibility imports are provided to ensure that older applications
 
26
        work. See CHANGES.txt for more info.
 
27
        
 
28
        
 
29
        Detailed Documentation
 
30
        ======================
 
31
        
 
32
        
 
33
        ===========================================
 
34
        The Query View for Authentication Utilities
 
35
        ===========================================
 
36
        
 
37
        A regular authentication service will not provide the `ISourceQueriables`
 
38
        interface, but it is a queriable itself, since it provides the simple
 
39
        `getPrincipals(name)` method:
 
40
        
 
41
        >>> class Principal:
 
42
        ...     def __init__(self, id):
 
43
        ...         self.id = id
 
44
        
 
45
        >>> class MyAuthUtility:
 
46
        ...     data = {'jim': Principal(42), 'don': Principal(0),
 
47
        ...             'stephan': Principal(1)}
 
48
        ...
 
49
        ...     def getPrincipals(self, name):
 
50
        ...         return [principal
 
51
        ...                 for id, principal in self.data.items()
 
52
        ...                 if name in id]
 
53
        
 
54
        Now that we have our queriable, we create the view for it:
 
55
        
 
56
        >>> from zope.app.security.browser.auth import AuthUtilitySearchView
 
57
        >>> from zope.publisher.browser import TestRequest
 
58
        >>> request = TestRequest()
 
59
        >>> view = AuthUtilitySearchView(MyAuthUtility(), request)
 
60
        
 
61
        This allows us to render a search form.
 
62
        
 
63
        >>> print view.render('test') # doctest: +NORMALIZE_WHITESPACE
 
64
        <h4>principals.zcml</h4>
 
65
        <div class="row">
 
66
        <div class="label">
 
67
        Search String
 
68
        </div>
 
69
        <div class="field">
 
70
        <input type="text" name="test.searchstring" />
 
71
        </div>
 
72
        </div>
 
73
        <div class="row">
 
74
        <div class="field">
 
75
        <input type="submit" name="test.search" value="Search" />
 
76
        </div>
 
77
        </div>
 
78
        
 
79
        If we ask for results:
 
80
        
 
81
        >>> view.results('test')
 
82
        
 
83
        We don't get any, since we did not provide any. But if we give input:
 
84
        
 
85
        >>> request.form['test.searchstring'] = 'n'
 
86
        
 
87
        we still don't get any:
 
88
        
 
89
        >>> view.results('test')
 
90
        
 
91
        because we did not press the button. So let's press the button:
 
92
        
 
93
        >>> request.form['test.search'] = 'Search'
 
94
        
 
95
        so that we now get results (!):
 
96
        
 
97
        >>> ids = list(view.results('test'))
 
98
        >>> ids.sort()
 
99
        >>> ids
 
100
        [0, 1]
 
101
        
 
102
        
 
103
        ====================
 
104
        Login/Logout Snippet
 
105
        ====================
 
106
        
 
107
        The class LoginLogout:
 
108
        
 
109
        >>> from zope.app.security.browser.auth import LoginLogout
 
110
        
 
111
        is used as a view to generate an HTML snippet suitable for logging in or
 
112
        logging out based on whether or not the current principal is authenticated.
 
113
        
 
114
        When the current principal is unauthenticated, it provides
 
115
        IUnauthenticatedPrincipal:
 
116
        
 
117
        >>> from zope.authentication.interfaces import IUnauthenticatedPrincipal
 
118
        >>> from zope.principalregistry.principalregistry import UnauthenticatedPrincipal
 
119
        >>> anonymous = UnauthenticatedPrincipal('anon', '', '')
 
120
        >>> IUnauthenticatedPrincipal.providedBy(anonymous)
 
121
        True
 
122
        
 
123
        When LoginLogout is used for a request that has an unauthenticated principal,
 
124
        it provides the user with a link to 'Login':
 
125
        
 
126
        >>> from zope.publisher.browser import TestRequest
 
127
        >>> request = TestRequest()
 
128
        >>> request.setPrincipal(anonymous)
 
129
        >>> LoginLogout(None, request)()
 
130
        u'<a href="@@login.html?nextURL=http%3A//127.0.0.1">[Login]</a>'
 
131
        
 
132
        Logout, however, behaves differently. Not all authentication protocols (i.e.
 
133
        credentials extractors/challengers) support 'logout'. Furthermore, we don't
 
134
        know how an admin may have configured Zope's authentication. Our solution is
 
135
        to rely on the admin to tell us explicitly that the site supports logout.
 
136
        
 
137
        By default, the LoginLogout snippet will not provide a logout link for an
 
138
        unauthenticated principal. To illustrate, we'll first setup a request with an
 
139
        unauthenticated principal:
 
140
        
 
141
        >>> from zope.security.interfaces import IPrincipal
 
142
        >>> from zope.interface import implements
 
143
        >>> class Bob:
 
144
        ...     implements(IPrincipal)
 
145
        ...     id = 'bob'
 
146
        ...     title = description = ''
 
147
        >>> bob = Bob()
 
148
        >>> IUnauthenticatedPrincipal.providedBy(bob)
 
149
        False
 
150
        >>> request.setPrincipal(bob)
 
151
        
 
152
        In this case, the default behavior is to return None for the snippet:
 
153
        
 
154
        >>> print LoginLogout(None, request)()
 
155
        None
 
156
        
 
157
        To show a logout prompt, an admin must register a marker adapter that provides
 
158
        the interface:
 
159
        
 
160
        >>> from zope.authentication.interfaces import ILogoutSupported
 
161
        
 
162
        This flags to LoginLogout that the site supports logout. There is a 'no-op'
 
163
        adapter that can be registered for this:
 
164
        
 
165
        >>> from zope.authentication.logout import LogoutSupported
 
166
        >>> from zope.component import provideAdapter
 
167
        >>> provideAdapter(LogoutSupported, (None,), ILogoutSupported)
 
168
        
 
169
        Now when we use LoginLogout with an unauthenticated principal, we get a logout
 
170
        prompt:
 
171
        
 
172
        >>> LoginLogout(None, request)()
 
173
        u'<a href="@@logout.html?nextURL=http%3A//127.0.0.1">[Logout]</a>'
 
174
        
 
175
        
 
176
        =======
 
177
        CHANGES
 
178
        =======
 
179
        
 
180
        3.7.5 (2010-01-08)
 
181
        ------------------
 
182
        
 
183
        - Move 'zope.ManageApplication' permission to zope.app.applicationcontrol
 
184
        
 
185
        - Fix tests using a newer zope.publisher that requires zope.login.
 
186
        
 
187
        3.7.3 (2009-11-29)
 
188
        ------------------
 
189
        
 
190
        - provide a clean zope setup and move zope.app.testing to a test dependency
 
191
        
 
192
        - removed unused dependencies like ZODB3 etc. from install_requires
 
193
        
 
194
        3.7.2 (2009-09-10)
 
195
        ------------------
 
196
        
 
197
        - Added data attribute to '_protections.zcml' for PersistentList
 
198
        and PersistentDict to accomodate UserList and UserDict behavior
 
199
        when they are proxied.
 
200
        
 
201
        3.7.1 (2009-08-15)
 
202
        ------------------
 
203
        
 
204
        - Changed globalmodules.zcml to avoid making declarations for
 
205
        deprecated standard modules, to avoid deprecation warnings.
 
206
        
 
207
        Note that globalmodules.zcml should be avoided.  It's better to make
 
208
        declarations for only what you actually need to use.
 
209
        
 
210
        3.7.0 (2009-03-14)
 
211
        ------------------
 
212
        
 
213
        - All interfaces, as well as some authentication-related helper classes and
 
214
        functions (checkPrincipal, PrincipalSource, PrincipalTerms, etc.) were moved
 
215
        into the new ``zope.authentication`` package. Backward-compatibility imports
 
216
        are provided.
 
217
        
 
218
        - The "global principal registry" along with its zcml directives was moved into
 
219
        new "zope.principalregistry" package. Backward-compatibility imports are
 
220
        provided.
 
221
        
 
222
        - The IPrincipal -> zope.publisher.interfaces.logginginfo.ILoggingInfo
 
223
        adapter was moved to ``zope.publisher``. Backward-compatibility import
 
224
        is provided.
 
225
        
 
226
        - The PermissionsVocabulary and PermissionIdsVocabulary has been moved
 
227
        to the ``zope.security`` package. Backward-compatibility imports are
 
228
        provided.
 
229
        
 
230
        - The registration of the "zope.Public" permission as well as some other
 
231
        common permissions, like "zope.View" have been moved to ``zope.security``.
 
232
        Its configure.zcml is now included by this package.
 
233
        
 
234
        - The "protect" function is now a no-op and is not needed anymore, because
 
235
        zope.security now knows about i18n messages and __name__ and __parent__
 
236
        attributes and won't protect them by default.
 
237
        
 
238
        - The addCheckerPublic was moved from zope.app.security.tests to
 
239
        zope.security.testing. Backward-compatibility import is provided.
 
240
        
 
241
        - The ``LocalPermission`` class is now moved to new ``zope.app.localpermission``
 
242
        package. This package now only has backward-compatibility imports and
 
243
        zcml includes.
 
244
        
 
245
        - Cleanup dependencies after refactorings. Also, don't depend on
 
246
        zope.app.testing for tests anymore.
 
247
        
 
248
        - Update package's description to point about refactorings done.
 
249
        
 
250
        3.6.2 (2009-03-10)
 
251
        ------------------
 
252
        
 
253
        - The `Allow`, `Deny` and `Unset` permission settings was preferred to
 
254
        be imported from ``zope.securitypolicy.interfaces`` for a long time
 
255
        and now they are completely moved there from ``zope.app.security.settings``
 
256
        as well as the ``PermissionSetting`` class. The only thing left for
 
257
        backward compatibility is the import of Allow/Unset/Deny constants if
 
258
        ``zope.securitypolicy`` is installed to allow unpickling of security
 
259
        settings.
 
260
        
 
261
        3.6.1 (2009-03-09)
 
262
        ------------------
 
263
        
 
264
        - Depend on new ``zope.password`` package instead of ``zope.app.authentication``
 
265
        to get password managers for the authentication utility, thus remove
 
266
        dependency on ``zope.app.authentication``.
 
267
        
 
268
        - Use template for AuthUtilitySearchView instead of ugly HTML
 
269
        constructing in the python code.
 
270
        
 
271
        - Bug: The `sha` and `md5` modules has been deprecated in Python 2.6.
 
272
        Whenever the ZCML of this package was included when using Python 2.6,
 
273
        a deprecation warning had been raised stating that `md5` and `sha` have
 
274
        been deprecated. Provided a simple condition to check whether Python 2.6
 
275
        or later is installed by checking for the presense of `json` module
 
276
        thas was added only in Python 2.6 and thus optionally load the security
 
277
        declaration for `md5` and `sha`.
 
278
        
 
279
        - Remove deprecated code, thus removing explicit dependency on
 
280
        zope.deprecation and zope.deferredimport.
 
281
        
 
282
        - Cleanup code a bit, replace old __used_for__ statements by ``adapts``
 
283
        calls.
 
284
        
 
285
        3.6.0 (2009-01-31)
 
286
        ------------------
 
287
        
 
288
        - Changed mailing list address to zope-dev at zope.org, because
 
289
        zope3-dev is retired now. Changed "cheeseshop" to "pypi" in
 
290
        the package homepage.
 
291
        
 
292
        - Moved the `protectclass` module to `zope.security` leaving only a
 
293
        compatibility module here that imports from the new location.
 
294
        
 
295
        - Moved the <module> directive implementation to `zope.security`.
 
296
        
 
297
        - Use `zope.container` instead of `zope.app.container`;.
 
298
        
 
299
        3.5.3 (2008-12-11)
 
300
        ------------------
 
301
        
 
302
        - use zope.browser.interfaces.ITerms instead of
 
303
        `zope.app.form.browser.interfaces`.
 
304
        
 
305
        3.5.2 (2008-07-31)
 
306
        ------------------
 
307
        
 
308
        - Bug: It turned out that checking for regex was not much better of an
 
309
        idea, since it causes deprecation warnings in Python 2.4. Thus let's
 
310
        look for a library that was added in Python 2.5.
 
311
        
 
312
        3.5.1 (2008-06-24)
 
313
        ------------------
 
314
        
 
315
        - Bug: The `gopherlib` module has been deprecated in Python 2.5. Whenever the
 
316
        ZCML of this package was included when using Python 2.5, a deprecation
 
317
        warning had been raised stating that `gopherlib` has been
 
318
        deprecated. Provided a simple condition to check whether Python 2.5 or later
 
319
        is installed by checking for the deleted `regex` module and thus optionally
 
320
        load the security declaration for `gopherlib`.
 
321
        
 
322
        3.5.0 (2008-02-05)
 
323
        ------------------
 
324
        
 
325
        - Feature:
 
326
        `zope.app.security.principalregistry.PrincipalRegistry.getPrincipal` returns
 
327
        `zope.security.management.system_user` when its id is used for the search
 
328
        key.
 
329
        
 
330
        3.4.0 (2007-10-27)
 
331
        ------------------
 
332
        
 
333
        - Initial release independent of the main Zope tree.
 
334
        
 
335
Keywords: zope security authentication principal ftp http
 
336
Platform: UNKNOWN
 
337
Classifier: Development Status :: 5 - Production/Stable
 
338
Classifier: Environment :: Web Environment
 
339
Classifier: Intended Audience :: Developers
 
340
Classifier: License :: OSI Approved :: Zope Public License
 
341
Classifier: Programming Language :: Python
 
342
Classifier: Natural Language :: English
 
343
Classifier: Operating System :: OS Independent
 
344
Classifier: Topic :: Internet :: WWW/HTTP
 
345
Classifier: Framework :: Zope3