def valid_ua_signature(request, signed_headers=('User-Agent', 'Client-Vendor-ID'), signature_header=SIGNATURE_UA_HEADER):
 payload = '|'.join(('{}:{}'.format(h, (request.headers.get(h) or '')) for h in signed_headers))
 return valid_signature(payload, request.headers.get(signature_header), field='ua')

def valid_ua_signature ( request , signed_headers = ( 'User-Agent' , 'Client-Vendor-ID' ) , signature_header = SIGNATURE_UA_HEADER ) : payload = '|' . join ( ( '{}:{}' . format ( h , ( request . headers . get ( h ) or '' ) ) for h in signed_headers ) ) return valid_signature ( payload , request . headers . get ( signature_header ) , field = 'ua' )
validate that the request has a properly signed user-agent .