Example #1
0
 def process_request(self, request):
     _thread_locals.user = getattr(request, 'user', None)
     _thread_locals.path = getattr(request, 'path', None)
     _thread_locals.request = request
     
     if not signer.open_url_match.match(request.path):
         if not request.GET.has_key('sign'):
             raise Http404
         proper_hash = signer.get_sign(request.path)
         if proper_hash != request.GET.get('sign'):
             raise Http404
Example #2
0
def signed_reverse(prefix, url):
    full_url = u'%s%s' % (prefix, url)
    if not signer.open_url_match.match(full_url):
        return  "%s?sign=%s" % (iri_to_uri(full_url), signer.get_sign(full_url))
    return iri_to_uri(full_url)