Commits

iElectric  committed 33064a1

docs update; additional tests

  • Participants
  • Parent commits 72a7095

Comments (0)

Files changed (2)

File repoze/who/plugins/test_captcha.py

 
     def test_handler_fail(self):
 
-        plugin = self._makeOne(PRIVATE_KEY, '/process')
+        plugin = self._makeOne(PRIVATE_KEY, '/ /process /login')
         environ = self._makeFormEnviron()
         plugin.authenticate(environ, environ['repoze.who.plugins']['cookie'])
 
 
 version = '0.2'
 
-desc = """**repoze.who.recaptcha** implements server side of the recaptcha API. This ``IAuthenticator`` plugin examines environment for recaptcha form values and if given submits to recaptcha main server for validation. If the validation succeeds, no action is taken. Otherwise error is passed to ``environ['repoze.who.error']`` and ``HTTPUnauthorzied(401)`` is triggered.
+desc = """**repoze.who.recaptcha** implements server side of the recaptcha API. This ``IAuthenticator`` plugin examines environment for recaptcha form values and requests verification. 
 
-.. _www.bitbucket.org: http://www.bitbucket.org/iElectric/repozewhorecaptcha/
+**repoze.who.recaptcha** works based on form_handler condition:
 
-Public Mercurial repo is avaliable at www.bitbucket.org_ ::
+* if form_handler parameter is not given, always perform authentication.
+* if form_handler parameter is given, perform authentication only when one of the form_handler values (separated by space) matches the absolute URL where the form is processed.
+
+If the validation succeeds, no action is taken. Otherwise error is passed to ``environ['repoze.who.error']`` and ``HTTPUnauthorzied(401)`` is triggered.
+
+.. _bitbucket.org: http://www.bitbucket.org/iElectric/repozewhorecaptcha/
+
+Public Mercurial repo is avaliable at bitbucket.org_ ::
 
     # sample .ini configuration
 
     [plugin:recaptcha]
     use = repoze.who.plugins.captcha:make_authentication_plugin
     private_key = si3di5ndlam3x44d
+    #optional
+    form_handler = /process /login /admin
 
     [authenticators]
     plugins =