Isn't this what the "require" function in http://svn.turbogears.org/projects/tgrepozewho/trunk/tgrepozewho/authorize.py does?
On May 8, 2:58 pm, percious <[EMAIL PROTECTED]> wrote: > chris, > > Thanks for the fix. Works great now.... Now if we could only get a > way to authorize on TG Controllers (ie. requires) we would be in good > shape. I will probably be writing this code at the next sprint. > > cheers. > -chris > > On May 7, 5:30 pm, chrism <[EMAIL PROTECTED]> wrote: > > > See also: > > >http://lists.repoze.org/pipermail/repoze-checkins/2008-May/000768.html > > > On May 7, 7:20 pm, chrism <[EMAIL PROTECTED]> wrote: > > > > I thought I fixed this in 0.9.1. You might have found an additional > > > bug. I've only tested under Python 2.4 using Paste 1.5, that may be > > > the difference. :-( There is code in repoze.who's plugins/auth_tkt.py > > > that is meant to cast an integer to a string on egress and back again > > > on ingress but it doesn't handle longs. Can you try the following > > > patch? > > > > Index: repoze/who/plugins/auth_tkt.py > > > =================================================================== > > > --- repoze/who/plugins/auth_tkt.py (revision 995) > > > +++ repoze/who/plugins/auth_tkt.py (working copy) > > > @@ -15,6 +15,7 @@ > > > > userid_type_encoders = { > > > int: ('int', str), > > > + long: ('int', str), > > > } > > > > def __init__(self, secret, cookie_name='auth_tkt', > > > > percious wrote: > > > > I tried putting tgrepozewho up on our linux server and it failed > > > > wonderfully. Something about userid being a long that it doesnt > > > > like. Where is the right place to cast the userid into a string? > > > > > cheers. > > > > -chris > > > > > URL:http://sccdata:13001/login_handler?came_from=http://sccdata:13001/ > > > > File '/var/scratch/sccdata/sites/mbms/lib/python2.5/site-packages/ > > > > WebError-0.8a-py2.5.egg/weberror/evalexception/middleware.py', line > > > > 364 in respond > > > > app_iter = self.application(environ, detect_start_response) > > > > File '/var/scratch/sccdata/sites/mbms/lib/python2.5/site-packages/ > > > > ToscaWidgets-0.8.5-py2.5.egg/tw/core/middleware.py', line 39 in > > > > __call__ > > > > return self.wsgi_app(environ, start_response) > > > > File '/var/scratch/sccdata/sites/mbms/lib/python2.5/site-packages/ > > > > Paste-1.6-py2.5.egg/paste/registry.py', line 334 in __call__ > > > > app_iter = self.application(environ, start_response) > > > > File '/var/scratch/sccdata/sites/mbms/lib/python2.5/site-packages/ > > > > ToscaWidgets-0.8.5-py2.5.egg/tw/core/middleware.py', line 54 in > > > > wsgi_app > > > > app_iter = self.application(environ, start_response) > > > > File '/var/scratch/sccdata/sites/mbms/lib/python2.5/site-packages/ > > > > Beaker-0.9.4-py2.5.egg/beaker/middleware.py', line 75 in __call__ > > > > return self.app(environ, start_response) > > > > File '/var/scratch/sccdata/sites/mbms/lib/python2.5/site-packages/ > > > > Beaker-0.9.4-py2.5.egg/beaker/middleware.py', line 147 in __call__ > > > > return self.wrap_app(environ, session_start_response) > > > > File '/var/scratch/sccdata/sites/mbms/lib/python2.5/site-packages/ > > > > Routes-1.8-py2.5.egg/routes/middleware.py', line 99 in __call__ > > > > response = self.app(environ, start_response) > > > > File '/var/scratch/sccdata/sites/mbms/lib/python2.5/site-packages/ > > > > repoze.who-0.9.1-py2.5.egg/repoze/who/middleware.py', line 131 in > > > > __call__ > > > > remember_headers = identifier.remember(environ, identity) > > > > File '/var/scratch/sccdata/sites/mbms/lib/python2.5/site-packages/ > > > > repoze.who-0.9.1-py2.5.egg/repoze/who/plugins/form.py', line 59 in > > > > remember > > > > return rememberer.remember(environ, identity) > > > > File '/var/scratch/sccdata/sites/mbms/lib/python2.5/site-packages/ > > > > repoze.who-0.9.1-py2.5.egg/repoze/who/plugins/auth_tkt.py', line 130 > > > > in remember > > > > new_cookie_value = ticket.cookie_value() > > > > File '/var/scratch/sccdata/sites/mbms/lib/python2.5/site-packages/ > > > > Paste-1.6-py2.5.egg/paste/auth/auth_tkt.py', line 102 in cookie_value > > > > v = '%s%08x%s!' % (self.digest(), int(self.time), self.userid) > > > > File '/var/scratch/sccdata/sites/mbms/lib/python2.5/site-packages/ > > > > Paste-1.6-py2.5.egg/paste/auth/auth_tkt.py', line 99 in digest > > > > self.user_data) > > > > File '/var/scratch/sccdata/sites/mbms/lib/python2.5/site-packages/ > > > > Paste-1.6-py2.5.egg/paste/auth/auth_tkt.py', line 169 in > > > > calculate_digest > > > > + tokens + '\0' + user_data).hexdigest() > > > > TypeError: cannot concatenate 'str' and 'long' objects --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
