Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions httpsig/requests_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ class HTTPSignatureAuth(requests.auth.AuthBase):
`algorithm` is one of the six specified algorithms
headers is a list of http headers to be included in the signing string,
defaulting to "Date" alone.
`sign_header`, optional, header used to include signature. defaults to
'authorization'.
"""
def __init__(self, key_id='', secret='', algorithm=None, headers=None):
def __init__(self, key_id='', secret='', algorithm=None, headers=None,
sign_header='authorization'):
headers = headers or []
self.header_signer = HeaderSigner(
key_id=key_id, secret=secret,
algorithm=algorithm, headers=headers)
algorithm=algorithm, headers=headers,
sign_header=sign_header)
self.uses_host = 'host' in [h.lower() for h in headers]

def __call__(self, r):
Expand Down