bovine.clients.signed_http
SignedHttpClient
Client for using HTTP Signatures
Source code in bovine/bovine/clients/signed_http.py
__init__(session, public_key_url, private_key, digest_method=None)
Creates the http client. By using content_digest_sha256_rfc_9530 one can send the Content Digest according to RFC 9530.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session |
ClientSession
|
The aiohttp.ClientSession |
required |
public_key_url |
str
|
Used as keyId when signing |
required |
private_key |
str
|
The pem encoded private key |
required |
digest_method |
Callable[[bytes], Tuple[str, str]] | None
|
Allow specifying the method used to compute the digest |
None
|
Source code in bovine/bovine/clients/signed_http.py
event_source(url)
Opens an event source to url
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
Url to query |
required |
get(url, headers={})
async
post(url, body, headers={}, content_type=None)
async
Posts to url using a signed post request
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
URL to post to |
required |
body |
str
|
The post body |
required |
headers |
dict
|
extra headers |
{}
|
content_type |
str
|
Content type of the message |
None
|