- try:
- self.backend.validate_token(token)
- self.check_permissions(self.tokens_cache[token], cherrypy.request.path_info,
- cherrypy.request.method)
- # TODO: check if this can be avoided. Backend may provide enough information
- return deepcopy(self.tokens_cache[token])
- except AuthException:
- self.del_token(token)
- raise
+ token_info = self.backend.validate_token(token)
+ # TODO add to token info remote host, port
+
+ self.check_permissions(token_info, cherrypy.request.path_info,
+ cherrypy.request.method)
+ return token_info