def verify_request():
 query_string = (frappe.local.flags.signed_query_string or getattr(frappe.request, u'query_string', None))
 valid = False
 if (u'&_signature=' in query_string):
  (params, signature) = query_string.split(u'&_signature=')
  given_signature = hmac.new(params.encode(u'utf-8'))
  given_signature.update(get_secret())
  valid = (signature == given_signature.hexdigest())
 if (not valid):
  frappe.respond_as_web_page(_(u'Invalid Link'), _(u'This link is invalid or expired. Please make sure you have pasted correctly.'))
 return valid

def verify_request ( ) : query_string = ( frappe . local . flags . signed_query_string or getattr ( frappe . request , u'query_string' , None ) ) valid = False if ( u'&_signature=' in query_string ) : ( params , signature ) = query_string . split ( u'&_signature=' ) given_signature = hmac . new ( params . encode ( u'utf-8' ) ) given_signature . update ( get_secret ( ) ) valid = ( signature == given_signature . hexdigest ( ) ) if ( not valid ) : frappe . respond_as_web_page ( _ ( u'Invalid Link' ) , _ ( u'This link is invalid or expired. Please make sure you have pasted correctly.' ) ) return valid
verify if the incoming signed request if it is correct .