Re: [Repoze-dev] [PATCH] Added the skip_authentication to repoze.what-quickstart config files

2010-05-06 Thread Néstor Salceda
On Wed, 2010-05-05 at 23:35 +0100, Gustavo Narea wrote:
> ¡Hola, Néstor!

Hola Gustavo :D

> Thank you very much for the patch! It looked good to me, so I applied it 
> after 
> writing a test to make sure "skip_authentication = False" also works:
> http://what.repoze.org/docs/plugins/quickstart/News.html

I was tempted to do it, but I prefer ask for feedback because the other
tests was working too :)

Nice work dudes!

Un saludo.
Néstor.

___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] [PATCH] Added the skip_authentication to repoze.what-quickstart config files

2010-05-05 Thread Gustavo Narea
¡Hola, Néstor!

Thank you very much for the patch! It looked good to me, so I applied it after 
writing a test to make sure "skip_authentication = False" also works:
http://what.repoze.org/docs/plugins/quickstart/News.html

Saludos,

 - Gustavo.

Néstor said:
> Hey,
> 
>   I would like to pass the skip_authentication parameter using the 
config
> file with repoze.what-quickstart plugin.
> 
>   I've attached a patch with this feature, if anyone wants to review it
> and perhaps it could be included in the next release :)
> 
> Any feedback?
> 
> Néstor.
-- 
Gustavo Narea .
| Tech blog: =Gustavo/(+blog)/tech  ~  About me: =Gustavo/about |
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


[Repoze-dev] [PATCH] Added the skip_authentication to repoze.what-quickstart config files

2010-05-05 Thread Néstor Salceda
Hey,

I would like to pass the skip_authentication parameter using the config
file with repoze.what-quickstart plugin.

I've attached a patch with this feature, if anyone wants to review it
and perhaps it could be included in the next release :)

Any feedback?

Néstor.
Index: tests/fixture/skip-authentication-config.ini
===
--- tests/fixture/skip-authentication-config.ini	(revision 0)
+++ tests/fixture/skip-authentication-config.ini	(revision 0)
@@ -0,0 +1,13 @@
+# Sample configuration file for repoze.what-quickstart.
+# This file uses only the mandatory options and they are all valid.
+
+[general]
+dbsession = tests.fixture.model:DBSession
+
+[authentication]
+user_class = tests.fixture.model:User
+skip_authentication = True
+
+[authorization]
+group_class = tests.fixture.model:Group
+permission_class = tests.fixture.model:Permission
Index: tests/test_config.py
===
--- tests/test_config.py	(revision 9334)
+++ tests/test_config.py	(working copy)
@@ -24,6 +24,7 @@
 from repoze.who.plugins.sa import SQLAlchemyAuthenticatorPlugin, \
   SQLAlchemyUserMDPlugin
 from repoze.who.plugins.friendlyform import FriendlyFormPlugin
+from repoze.who.plugins.testutil import AuthenticationForgerMiddleware
 from repoze.what.middleware import AuthorizationMetadata
 
 from repoze.what.plugins.quickstart import (add_auth_from_config,
@@ -229,6 +230,11 @@
 handler = app.logger.handlers[0]
 self.assertEqual(handler.stream.name,
  os.path.join(FIXTURE_DIR, "file.log"))
+
+def test_skip_authentication_config(self):
+"""A config file with skip authentication options."""
+app = make_app("skip-authentication-config")
+self.assertEqual(AuthenticationForgerMiddleware, type(app))
 
 def test_missing_options(self):
 """Configuration files with missing mandatory options."""
Index: repoze/what/plugins/quickstart/config.py
===
--- repoze/what/plugins/quickstart/config.py	(revision 9334)
+++ repoze/what/plugins/quickstart/config.py	(working copy)
@@ -150,7 +150,8 @@
 self._add_string("authentication", "login_counter_name")
 self._add_string("authentication", "log_level")
 self._add_string("authentication", "log_file")
-
+self._add_boolean("authentication", "skip_authentication")
+
 # Adding authorization options:
 self._add_object("authorization", "group_class")
 self._add_object("authorization", "permission_class")
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev