Re: problem with TypeError when raising exception by AuthKit

2008-11-12 Thread Maciek

I found solution. As I suspected, the problem was with Python version.
AuthKit egg is available only for Python 2.5 and I used 2.4. So just
upgrade to Plone 2.5 and it works as expected

On 11 Lis, 10:09, Maciek [EMAIL PROTECTED] wrote:
 Hi,

 I am trying to use AuthKit in Pylons (0.9.7) but I get TypeError when
 using @authorize(RemoteUser()):

   File /Library/Frameworks/Python.framework/Versions/2.4/lib/
 python2.4/site-packages/AuthKit-0.4.2-py2.4.egg/authkit/authorize/
 wsgi_adaptors.py, line 102, in __call__
     return self.permission.check(self.app, environ, start_response)
   File /Library/Frameworks/Python.framework/Versions/2.4/lib/
 python2.4/site-packages/AuthKit-0.4.2-py2.4.egg/authkit/
 permissions.py, line 174, in check
     raise NotAuthenticatedError('Not Authenticated')
 TypeError: exceptions must be classes, instances, or strings
 (deprecated), not NotAuthenticatedError

 I couldnt find any info about it in google. Can you maybe have any
 idea what can be wrong? Maybe Python version should be higher?

 Greetings,
 Maciek
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Pylons 0.9.7, AuthKit 0.4.2 - TypeError exceptions must be classes....

2008-11-12 Thread Maciek

I had the same problem, you can check
http://groups.google.pl/group/pylons-discuss/browse_thread/thread/2cc8f8a07721269b

The solution is to use Python 2.5 at least. AuthKit egg is aviable
only for Python 2.5

Maciek

On 12 Lis, 15:56, Thomas Johnson [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hi,

 I am a new pylons user and am having a few issues with AuthKit. I
 attempted to follow a few tutorials that covered the setup of AuthKit
 but they seemed pretty dated. I ended up using epydoc to generate the
 documentation for pylons and authkit. I have managed to get a basic
 setup of AuthKit working but now I am trying to get UsersFromDatabase
 authentication working. The tutorials that I have read so far are:

 http://pylonsbook.com/alpha1/authentication_and_authorizationhttp://wiki.pylonshq.com/display/pylonscookbook/AuthKit+0.4+UsersFrom...

 My controller is:

 import logging
 import datetime
 from myapp.lib.base import *
 from pylons import tmpl_context as c
 from pylons.templating import render_mako as render
 log = logging.getLogger(__name__)

 from authkit.authorize.pylons_adaptors import authorize, authorized
 from authkit.permissions import RemoteUser, ValidAuthKitUser

 class FooController(BaseController):

     @authorize(ValidAuthKitUser())
     def private(self):
         response.status = 401 Not authenticated
         return You are not authenticated

 I see the following error when I attempt to view /foo/private(when not
 logged in):
 File 'string', line 1 in lambda
 File
 '/usr/lib/python2.4/site-packages/AuthKit-0.4.2-py2.4.egg/authkit/authorize 
 /pylons_adaptors.py',
 line 36 in validate
   return permission.check(app, request.environ, self.start_response)
 File
 '/usr/lib/python2.4/site-packages/AuthKit-0.4.2-py2.4.egg/authkit/permissio 
 ns.py',
 line 300 in check
   raise NotAuthenticatedError('Not Authenticated')
 TypeError: exceptions must be classes, instances, or strings
 (deprecated), not NotAuthenticatedError

 I can't help but feel like I am missing extremely simple somewhere.
 Any suggestions would be great.

 cheers,
 Tom

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.6 (GNU/Linux)
 Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org

 iD8DBQFJGu6Up0KneERU9LsRAvo4AJwLJsED3fC1ZT8DH5r4UefKAX1yFQCfXL/i
 bk1O6XCMSs1FdS4TF5ACnBg=
 =zs9P
 -END PGP SIGNATURE-
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



problem with TypeError when raising exception by AuthKit

2008-11-11 Thread Maciek

Hi,

I am trying to use AuthKit in Pylons (0.9.7) but I get TypeError when
using @authorize(RemoteUser()):

  File /Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/AuthKit-0.4.2-py2.4.egg/authkit/authorize/
wsgi_adaptors.py, line 102, in __call__
return self.permission.check(self.app, environ, start_response)
  File /Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/AuthKit-0.4.2-py2.4.egg/authkit/
permissions.py, line 174, in check
raise NotAuthenticatedError('Not Authenticated')
TypeError: exceptions must be classes, instances, or strings
(deprecated), not NotAuthenticatedError

I couldnt find any info about it in google. Can you maybe have any
idea what can be wrong? Maybe Python version should be higher?

Greetings,
Maciek

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---