Skip to content

Commit

Permalink
Pass an ext string to the mohawk request
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmaclachlan authored Aug 8, 2022
1 parent 39ce218 commit 2e90699
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion requests_hawk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ class HawkAuth(AuthBase):
The url of the server, this is useful for hawk when signing the requests.
In case this is omitted, fallbacks to the value of the "Host" header of
the request (Optional).
:param ext:
A string of arbitrary data to be sent along with the request (Optional).
Note that the `hawk_session` and `id` parameters are mutually exclusive.
You should use either `hawk_session` or both `id` and 'key'.
"""
def __init__(self, hawk_session=None, id=None, key=None, algorithm='sha256',
credentials=None, server_url=None, _timestamp=None,
always_hash_content=True, app=None):
always_hash_content=True, ext=None, app=None):
if credentials is not None:
raise AttributeError("The 'credentials' param has been removed. "
"Pass 'id' and 'key' instead, or '**credentials_dict'.")
Expand Down Expand Up @@ -68,6 +71,7 @@ def __init__(self, hawk_session=None, id=None, key=None, algorithm='sha256',
self._timestamp = _timestamp
self.host = urlparse(server_url).netloc if server_url else None
self.always_hash_content = always_hash_content
self.ext = ext
self.app = app

def __call__(self, r):
Expand All @@ -86,6 +90,7 @@ def __call__(self, r):
content_type=content_type or EmptyValue,
always_hash_content=self.always_hash_content,
_timestamp=self._timestamp,
ext=self.ext
app=self.app
)

Expand Down

0 comments on commit 2e90699

Please sign in to comment.