Expand verify example
parent
d8b7916639
commit
7fd0077c58
|
@ -48,9 +48,10 @@ The class method ``HTTPSignatureAuth.verify()`` can be used to verify responses
|
||||||
return 'monorail_cat'
|
return 'monorail_cat'
|
||||||
|
|
||||||
response = requests.get(url, auth=auth)
|
response = requests.get(url, auth=auth)
|
||||||
HTTPSignatureAuth.verify(response,
|
verify_result = HTTPSignatureAuth.verify(response,
|
||||||
signature_algorithm=algorithms.HMAC_SHA256,
|
signature_algorithm=algorithms.HMAC_SHA256,
|
||||||
key_resolver=MyKeyResolver())
|
key_resolver=MyKeyResolver())
|
||||||
|
# To avoid substitution attacks, only trust response data referenced by verify_result
|
||||||
|
|
||||||
More generally, you can reconstruct an arbitrary request using the
|
More generally, you can reconstruct an arbitrary request using the
|
||||||
`Requests API <https://docs.python-requests.org/en/latest/api/#requests.Request>`_ and pass it to ``verify()``:
|
`Requests API <https://docs.python-requests.org/en/latest/api/#requests.Request>`_ and pass it to ``verify()``:
|
||||||
|
|
Loading…
Reference in New Issue