[Checkins] SVN: grok/trunk/ Merge changes from ulif-paster-loginhtml branch.

Uli Fouquet uli at gnufix.de
Mon Jul 13 14:26:00 EDT 2009


Log message for revision 101871:
  Merge changes from ulif-paster-loginhtml branch.

Changed:
  _U  grok/trunk/
  U   grok/trunk/CHANGES.txt
  U   grok/trunk/buildout.cfg
  U   grok/trunk/src/grok/configure.zcml
  A   grok/trunk/src/grok/ftests/publish/
  U   grok/trunk/src/grok/ftests/security/json.py
  U   grok/trunk/src/grok/ftests/test_grok_functional.py
  U   grok/trunk/src/grok/publication.py
  U   grok/trunk/versions.cfg

-=-

Property changes on: grok/trunk
___________________________________________________________________
Modified: svn:externals
   - bootstrap svn://svn.zope.org/repos/main/zc.buildout/trunk/bootstrap/


   + bootstrap svn://svn.zope.org/repos/main/zc.buildout/trunk/bootstrap/


Modified: grok/trunk/CHANGES.txt
===================================================================
--- grok/trunk/CHANGES.txt	2009-07-13 18:10:22 UTC (rev 101870)
+++ grok/trunk/CHANGES.txt	2009-07-13 18:26:00 UTC (rev 101871)
@@ -6,6 +6,10 @@
 
 See: :ref:`upgrade_notes_1.0b1` for special notes on upgrading to this release.
 
+* Added `zope.publisher.interfaces.IReRaiseException` adapter for
+  IUnauthorized exceptions. Closes
+  https://bugs.launchpad.net/grok/+bug/332061
+
 * Removed `docutils` and `Pygment` from versions.cfg. Both are pinned
   in grokdocs subpackage. Closes
   https://bugs.launchpad.net/grok/+bug/340170

Modified: grok/trunk/buildout.cfg
===================================================================
--- grok/trunk/buildout.cfg	2009-07-13 18:10:22 UTC (rev 101870)
+++ grok/trunk/buildout.cfg	2009-07-13 18:26:00 UTC (rev 101871)
@@ -16,6 +16,9 @@
 versions = versions
 extensions = buildout.dumppickedversions
 
+[versions]
+zope.testing = 3.7.0
+
 [docs]
 recipe = zc.recipe.egg
 eggs = grokdocs

Modified: grok/trunk/src/grok/configure.zcml
===================================================================
--- grok/trunk/src/grok/configure.zcml	2009-07-13 18:10:22 UTC (rev 101870)
+++ grok/trunk/src/grok/configure.zcml	2009-07-13 18:26:00 UTC (rev 101871)
@@ -79,6 +79,12 @@
       priority="1"
       />
 
+  <adapter
+      factory=".publication.DontReRaiseUnauthorizedAdapter"
+      for="zope.security.interfaces.IUnauthorized"
+      provides="zope.publisher.interfaces.IReRaiseException"
+      />
+
   <!-- need to grok this for some basic REST support -->
   <grok:grok package=".rest" />
 

Modified: grok/trunk/src/grok/ftests/security/json.py
===================================================================
--- grok/trunk/src/grok/ftests/security/json.py	2009-07-13 18:10:22 UTC (rev 101870)
+++ grok/trunk/src/grok/ftests/security/json.py	2009-07-13 18:26:00 UTC (rev 101871)
@@ -16,7 +16,7 @@
   >>> browser.open('http://localhost/dance')
   Traceback (most recent call last):
     ...
-  Unauthorized: (<grok.meta.MammothJSON object at ...>, '__call__', 'zope.ManageContent')
+  HTTPError: HTTP Error 401: Unauthorized
 
 Let's log in as the manager now. We should be able to access the method now::
 

Modified: grok/trunk/src/grok/ftests/test_grok_functional.py
===================================================================
--- grok/trunk/src/grok/ftests/test_grok_functional.py	2009-07-13 18:10:22 UTC (rev 101870)
+++ grok/trunk/src/grok/ftests/test_grok_functional.py	2009-07-13 18:26:00 UTC (rev 101871)
@@ -70,7 +70,7 @@
 
 def test_suite():
     suite = unittest.TestSuite()
-    for name in ['xmlrpc', 'traversal', 'form', 'url', 'security',
+    for name in ['xmlrpc', 'traversal', 'form', 'url', 'security', 'publish',
                  'utility', 'catalog', 'site', 'rest', 'viewlet','json']:
         suite.addTest(suiteFromPackage(name))
     return suite

Modified: grok/trunk/src/grok/publication.py
===================================================================
--- grok/trunk/src/grok/publication.py	2009-07-13 18:10:22 UTC (rev 101870)
+++ grok/trunk/src/grok/publication.py	2009-07-13 18:26:00 UTC (rev 101871)
@@ -176,3 +176,20 @@
     def __call__(self):
         request, publication = super(GrokHTTPFactory, self).__call__()
         return request, GrokHTTPPublication
+
+def DontReRaiseUnauthorizedAdapter(context):
+    """Adapter to indicate we don't want Unauthorized to be reraised.
+
+    When running the publisher in ``handle_errors=False``-mode, which
+    happens for instance when running Grok in a WSGI pipeline with a
+    debugger middleware enabled, we don't want IUnauthorized errors to
+    be reraised during publishing.
+
+    We can indicate this by providing an adapter, that adapts
+    exceptions of this type (`IUnauthorized`) to
+    `zope.publisher.interfaces.IReRaiseException` and returning
+    ``False`` when being called.
+    """
+    def shouldBeReRaised():
+        return False
+    return shouldBeReRaised

Modified: grok/trunk/versions.cfg
===================================================================
--- grok/trunk/versions.cfg	2009-07-13 18:10:22 UTC (rev 101870)
+++ grok/trunk/versions.cfg	2009-07-13 18:26:00 UTC (rev 101871)
@@ -93,7 +93,7 @@
 zope.modulealias = 3.4.0
 zope.pagetemplate = 3.4.0
 zope.proxy = 3.4.2
-zope.publisher = 3.4.8
+zope.publisher = 3.4.9
 zope.schema = 3.4.0
 zope.security = 3.4.1
 zope.securitypolicy = 3.4.1



More information about the Checkins mailing list