Skip to content
This repository has been archived by the owner on Nov 11, 2019. It is now read-only.

tooltool/client: more fixes due to failing tests on m-c #2084

Merged
merged 5 commits into from
May 27, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
tooltool/client: fixing taskcluster authenication
  • Loading branch information
garbas committed May 27, 2019
commit a615c01b4099c1a78d126f9b20326d11a6f9a1d1
7 changes: 3 additions & 4 deletions src/tooltool/client/tooltool.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def normalize_string(mac_type,
name or '',
host,
port,
content_hash or ''
content_hash or '',
'', # for ext which is empty in this case
'', # Add trailing new line.
]
Expand Down Expand Up @@ -237,8 +237,6 @@ def calculate_mac(mac_type,
log.debug(u'normalized resource for mac calc: {norm}'.format(norm=normalized))
digestmod = getattr(hashlib, algorithm)

# Make sure we are about to hash binary strings.

if not isinstance(normalized, six_binary_type):
normalized = normalized.encode('utf8')

Expand All @@ -264,7 +262,8 @@ def make_taskcluster_header(credentials, req):
content_hash = calculate_payload_hash( # pragma: no cover
algorithm,
req.get_data(),
req.get_method(),
# maybe we should detect this from req.headers but we anyway expect json
content_type='application/json',
)

mac = calculate_mac('header',
Expand Down