[Checkins] SVN: zc.openid/trunk/ finished renaming to zc.openid and added test stubs

Shane Hathaway shane at hathawaymix.org
Tue Feb 24 18:21:16 EST 2009


Log message for revision 97229:
  finished renaming to zc.openid and added test stubs
  

Changed:
  _U  zc.openid/trunk/
  U   zc.openid/trunk/buildout.cfg
  U   zc.openid/trunk/setup.py
  _U  zc.openid/trunk/src/
  U   zc.openid/trunk/src/zc/openid/authentication.py
  U   zc.openid/trunk/src/zc/openid/configure.zcml
  A   zc.openid/trunk/src/zc/openid/ftesting.zcml
  U   zc.openid/trunk/src/zc/openid/interfaces.py
  U   zc.openid/trunk/src/zc/openid/register.py
  A   zc.openid/trunk/src/zc/openid/testing.py
  U   zc.openid/trunk/src/zc/openid/view.py

-=-

Property changes on: zc.openid/trunk
___________________________________________________________________
Added: svn:ignore
   + develop-eggs
bin
parts
.installed.cfg
coverage


Modified: zc.openid/trunk/buildout.cfg
===================================================================
--- zc.openid/trunk/buildout.cfg	2009-02-24 23:07:49 UTC (rev 97228)
+++ zc.openid/trunk/buildout.cfg	2009-02-24 23:21:15 UTC (rev 97229)
@@ -4,7 +4,7 @@
 
 [test]
 recipe = zc.recipe.testrunner
-eggs = zc.openid
+eggs = zc.openid [test]
 
 [python]
 recipe = zc.recipe.egg
@@ -13,7 +13,7 @@
 
 [coverage-test]
 recipe = zc.recipe.testrunner
-eggs = zc.openid
+eggs = zc.openid [test]
 defaults = ['--coverage', '../../coverage']
 
 [coverage-report]

Modified: zc.openid/trunk/setup.py
===================================================================
--- zc.openid/trunk/setup.py	2009-02-24 23:07:49 UTC (rev 97228)
+++ zc.openid/trunk/setup.py	2009-02-24 23:21:15 UTC (rev 97229)
@@ -50,4 +50,7 @@
                         'zope.formlib',
                         'zope.schema',
                         ],
+      extras_require={
+          'test': ['zope.app.testing'],
+          }
       )


Property changes on: zc.openid/trunk/src
___________________________________________________________________
Added: svn:ignore
   + zc.openid.egg-info


Modified: zc.openid/trunk/src/zc/openid/authentication.py
===================================================================
--- zc.openid/trunk/src/zc/openid/authentication.py	2009-02-24 23:07:49 UTC (rev 97228)
+++ zc.openid/trunk/src/zc/openid/authentication.py	2009-02-24 23:21:15 UTC (rev 97229)
@@ -29,13 +29,14 @@
 from zope.session.interfaces import ISession
 from zope.security.interfaces import IPrincipal
 
-from zope.app.openidconsumer.interfaces import AuthenticationFailed
-from zope.app.openidconsumer.interfaces import IOpenIDConsumer
+from zc.openid.interfaces import AuthenticationFailed
+from zc.openid.interfaces import IOpenIDConsumer
 
-PACKAGE = 'zope.app.openidconsumer'
+PACKAGE = 'zc.openid'
 PRINCIPAL = 'principal'
 CONSUMER = 'consumer'
 
+# XXX This needs to be in ZODB.
 store = MemoryStore()
 
 
@@ -51,7 +52,7 @@
 class OpenIDConsumer(Persistent, Location):
     implements(IOpenIDConsumer)
 
-    identity_provider = None
+    single_provider = None
 
     def authenticate(self, request):
         """Identify a principal for a request.
@@ -85,9 +86,9 @@
         return res
 
     def login(self, request, identity_url=None):
-        if self.identity_provider:
+        if self.single_provider:
             # override
-            identity_url = self.identity_provider
+            identity_url = self.single_provider
         if identity_url:
             consumer = self._get_consumer(request)
             auth_req = consumer.begin(identity_url)

Modified: zc.openid/trunk/src/zc/openid/configure.zcml
===================================================================
--- zc.openid/trunk/src/zc/openid/configure.zcml	2009-02-24 23:07:49 UTC (rev 97228)
+++ zc.openid/trunk/src/zc/openid/configure.zcml	2009-02-24 23:21:15 UTC (rev 97229)
@@ -18,21 +18,12 @@
 
   <browser:addform
       schema=".interfaces.IOpenIDConsumerConfig"
-      label="Add OpenID Consumer"
+      label="Add OpenID Authentication Consumer"
       content_factory=".authentication.OpenIDConsumer"
       name="AddOpenIDConsumer"
       permission="zope.ManageServices"
-      >
+      />
 
-    <browser:widget
-        field="identity_provider"
-        class="zope.app.form.browser.TextWidget"
-        required="False"
-        convert_missing_value="False"
-        />
-
-  </browser:addform>
-
   <browser:addMenuItem
       class=".authentication.OpenIDConsumer"
       view="AddOpenIDConsumer"

Added: zc.openid/trunk/src/zc/openid/ftesting.zcml
===================================================================
--- zc.openid/trunk/src/zc/openid/ftesting.zcml	                        (rev 0)
+++ zc.openid/trunk/src/zc/openid/ftesting.zcml	2009-02-24 23:21:15 UTC (rev 97229)
@@ -0,0 +1,50 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:meta="http://namespaces.zope.org/meta"
+           i18n_domain="zc.openid">
+
+  <!-- Turn on the devmode -->
+  <meta:provides feature="devmode" />
+  <include package="zc.openid" />
+
+  <include package="zope.app.securitypolicy" file="meta.zcml" />
+  <include package="zope.app.securitypolicy" />
+  <securityPolicy 
+      component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+  <!-- Test Principals -->
+
+  <unauthenticatedPrincipal id="zope.anybody"
+                            title="Unauthenticated User" />
+  <unauthenticatedGroup id="zope.Anybody"
+                        title="Unauthenticated Users" />
+  <authenticatedGroup id="zope.Authenticated"
+                      title="Authenticated Users" />
+  <everybodyGroup id="zope.Everybody"
+                  title="All Users" />
+
+  <!-- Principal that tests generally run as -->
+  <principal
+      id="zope.mgr"
+      title="Manager"
+      login="mgr"
+      password="mgrpw"
+      />
+  <!-- Bootstrap principal used to make local grant to the principal above -->
+  <principal
+      id="zope.globalmgr"
+      title="Manager"
+      login="globalmgr"
+      password="globalmgrpw"
+      />
+
+  <grant permission="zope.View"
+         principal="zope.Anybody" />
+  <grant permission="zope.app.dublincore.view"
+         principal="zope.Anybody" />
+
+  <role id="zope.Manager" title="Site Manager" />
+  <role id="zope.Member" title="Site Member" />
+  <grantAll role="zope.Manager" />
+  <grant role="zope.Manager" principal="zope.globalmgr" />
+
+</configure>

Modified: zc.openid/trunk/src/zc/openid/interfaces.py
===================================================================
--- zc.openid/trunk/src/zc/openid/interfaces.py	2009-02-24 23:07:49 UTC (rev 97228)
+++ zc.openid/trunk/src/zc/openid/interfaces.py	2009-02-24 23:21:15 UTC (rev 97229)
@@ -17,11 +17,15 @@
 from zope.schema import URI
 
 class IOpenIDConsumerConfig(Interface):
-    identity_provider = URI(
-        title=u'Identity Provider URI',
+    single_provider = URI(
+        title=u'Single Identity Provider URI',
+        description=(u'If you want all identities to come from a single '
+                     u'provider, set this to the server URI.  The '
+                     u'URI must contain an OpenID service description.'),
         required=False
         )
 
+
 class IOpenIDConsumer(IOpenIDConsumerConfig, IAuthentication):
     pass
 

Modified: zc.openid/trunk/src/zc/openid/register.py
===================================================================
--- zc.openid/trunk/src/zc/openid/register.py	2009-02-24 23:07:49 UTC (rev 97228)
+++ zc.openid/trunk/src/zc/openid/register.py	2009-02-24 23:21:15 UTC (rev 97229)
@@ -13,7 +13,7 @@
 ##############################################################################
 
 
-from zope.app.openidconsumer.interfaces import IOpenIDConsumer
+from zc.openid.interfaces import IOpenIDConsumer
 from zope.app.component.browser.registration import AddUtilityRegistration
 
 class Registration(AddUtilityRegistration):

Added: zc.openid/trunk/src/zc/openid/testing.py
===================================================================
--- zc.openid/trunk/src/zc/openid/testing.py	                        (rev 0)
+++ zc.openid/trunk/src/zc/openid/testing.py	2009-02-24 23:21:15 UTC (rev 97229)
@@ -0,0 +1,21 @@
+import os.path
+from zope.testing import doctest
+from zope.app.testing import functional
+
+ftesting_zcml = os.path.join(os.path.dirname(__file__), 'ftesting.zcml')
+FunctionalLayer = functional.ZCMLLayer(ftesting_zcml, __name__,
+                                       'FunctionalLayer')
+
+def FunctionalDocTestSuite(module=None, **kw):
+    module = doctest._normalize_module(module)
+    suite = functional.FunctionalDocTestSuite(module, **kw)
+    suite.layer = FunctionalLayer
+    return suite
+
+def FunctionalDocFileSuite(path, **kw):
+    suite = functional.FunctionalDocFileSuite(path, **kw)
+    suite.layer = FunctionalLayer
+    return suite
+
+class FunctionalTestCase(functional.FunctionalTestCase):
+    layer = FunctionalLayer

Modified: zc.openid/trunk/src/zc/openid/view.py
===================================================================
--- zc.openid/trunk/src/zc/openid/view.py	2009-02-24 23:07:49 UTC (rev 97228)
+++ zc.openid/trunk/src/zc/openid/view.py	2009-02-24 23:21:15 UTC (rev 97229)
@@ -21,7 +21,7 @@
 from zope.publisher.browser import BrowserView
 from zope.schema import TextLine
 
-from zope.app.openidconsumer.interfaces import IOpenIDConsumer
+from zc.openid.interfaces import IOpenIDConsumer
 
 
 class IChooseIdentitySchema(Interface):



More information about the Checkins mailing list