cd34/apex

NameError: global name 'auth' is not defined

sysout opened this issue · 3 comments

URL: http://www.mydomain.com/auth/apex_callback
File '/root/mydomain.com/lib/python2.6/site-packages/WebError-0.10.3-py2.6.egg/weberror/evalexception.py', line 431 in respond
app_iter = self.application(environ, detect_start_response)
File '/root/mydomain.com/lib/python2.6/site-packages/pyramid-1.4a3-py2.6.egg/pyramid/router.py', line 251 in call
response = self.invoke_subrequest(request, use_tweens=True)
File '/root/mydomain.com/lib/python2.6/site-packages/pyramid-1.4a3-py2.6.egg/pyramid/router.py', line 227 in invoke_subrequest
response = handle_request(request)
File '/root/mydomain.com/lib/python2.6/site-packages/pyramid-1.4a3-py2.6.egg/pyramid/tweens.py', line 20 in excview_tween
response = handler(request)
File '/root/mydomain.com/lib/python2.6/site-packages/pyramid_tm-0.5-py2.6.egg/pyramid_tm/init.py', line 100 in tm_tween
response = handler(request)
File '/root/mydomain.com/lib/python2.6/site-packages/pyramid-1.4a3-py2.6.egg/pyramid/router.py', line 161 in handle_request
response = view_callable(context, request)
File '/root/mydomain.com/lib/python2.6/site-packages/pyramid-1.4a3-py2.6.egg/pyramid/config/views.py', line 369 in viewresult_to_response
result = view(context, request)
File '/root/mydomain.com/lib/python2.6/site-packages/pyramid-1.4a3-py2.6.egg/pyramid/config/views.py', line 480 in _requestonly_view
response = view(request)
File '/root/mydomain.com/apex/apex/views.py', line 263 in apex_callback
auth = apexid_from_token(request.POST['token'])
File '/root/mydomain.com/apex/apex/lib/libapex.py', line 93 in apexid_from_token
if 'profile' in auth:
NameError: global name 'auth' is not defined

in apex/lib/libapex.py, the two lines of auth initialization code are commented out.
91 #auth = json.loads(dbsession.query(KeyStorage.value).
92 # filter(KeyStorage.key==token).one()[0])

cd34 commented

In looking at this, there are two problems. One is that the code on github has an issue with Pyramid 1.4 - I've fixed that and pushed that. The second issue is that Velruse changed a few things internally regarding accessing the backend key store. The code that was commented out shouldn't have been pushed and was related to some code to access the Velruse backend store.

yes, it seems like the latest Velruse removed all backend store and act more like a utility function. I think it's a good move. Reducing the dependencies will make it easier to integrate Velruse to existing applications.

cd34 commented

Recent push takes care of this and fixes a few other minor issues with 1.4 compatibility.

easy_install -U https://github.com/cd34/apex/tarball/master

should fix this.