def process_signature(request, max_age=(((60 * 60) * 24) * 10)):
 sig = (request.GET.get('_') or request.POST.get('_sentry_request_signature'))
 if ((not sig) or (sig.count(':') < 2)):
  return None
 signed_data = ('%s|%s|%s' % (request.build_absolute_uri('/').rstrip('/'), request.path, sig))
 try:
  data = get_signer().unsign(signed_data, max_age=max_age)
 except signing.BadSignature:
  return None
 (_, signed_path, user_id) = data.rsplit('|', 2)
 if (signed_path != request.path):
  return None
 try:
  return User.objects.get(pk=base36_decode(user_id))
 except (ValueError, User.DoesNotExist):
  return None

def process_signature ( request , max_age = ( ( ( 60 * 60 ) * 24 ) * 10 ) ) : sig = ( request . GET . get ( '_' ) or request . POST . get ( '_sentry_request_signature' ) ) if ( ( not sig ) or ( sig . count ( ':' ) < 2 ) ) : return None signed_data = ( '%s|%s|%s' % ( request . build_absolute_uri ( '/' ) . rstrip ( '/' ) , request . path , sig ) ) try : data = get_signer ( ) . unsign ( signed_data , max_age = max_age ) except signing . BadSignature : return None ( _ , signed_path , user_id ) = data . rsplit ( '|' , 2 ) if ( signed_path != request . path ) : return None try : return User . objects . get ( pk = base36_decode ( user_id ) ) except ( ValueError , User . DoesNotExist ) : return None
given a request object this validates the signature from the current request and returns the user .