

def validateRequest(self, uri, postVars, expectedSignature):
    'validate a request from plivo\n\n        uri: the full URI that Plivo requested on your server\n        postVars: post vars that Plivo sent with the request\n        expectedSignature: signature in HTTP X-Plivo-Signature header\n\n        returns true if the request passes validation, false if not\n        '
    s = uri
    for (k, v) in sorted(postVars.items()):
        s += (k + v)
    return (base64.encodestring(hmac.new(self.auth_token, s, sha1).digest()).strip() == expectedSignature)

dataset/ETHPy150Open plivo/plivohelper-python/plivohelper.py Utils.validateRequest/original