Function
_ValidateResponseObject
( response, response_text )
Source from the content-addressed store, hash-verified
| 315 | |
| 316 | |
| 317 | def _ValidateResponseObject( response, response_text ): |
| 318 | if not response_text: |
| 319 | return |
| 320 | our_hmac = CreateHmac( response_text, BaseRequest.hmac_secret ) |
| 321 | their_hmac = ToBytes( b64decode( response.headers[ _HMAC_HEADER ] ) ) |
| 322 | if not compare_digest( our_hmac, their_hmac ): |
| 323 | raise RuntimeError( 'Received invalid HMAC for response!' ) |
| 324 | |
| 325 | |
| 326 | def _BuildUri( handler ): |
Tested by
no test coverage detected