Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit d2169fb

Browse files
include signing string by default in headers
1 parent b472613 commit d2169fb

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

dynata_rex/opportunity_registry.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ def __init__(self,
2727
access_key: str,
2828
secret_key: str,
2929
base_url: str = _BASE_URL,
30-
# TODO: Hack Alert Remove Hash Registry
31-
hash_registry: bool = False,
32-
# END TODO: Hack Alert
3330
default_ttl: int = 10,
3431
shard_count: int = 1,
3532
current_shard: int = 1):
@@ -46,8 +43,7 @@ def __init__(self,
4643
self.default_ttl = default_ttl
4744
self.make_request = RexRequest(access_key,
4845
secret_key,
49-
default_ttl=default_ttl,
50-
hash_registry=hash_registry)
46+
default_ttl=default_ttl)
5147
self.base_url = base_url
5248

5349
if current_shard > shard_count:

dynata_rex/signer.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,10 @@ class RexRequest:
147147
def __init__(self,
148148
access_key,
149149
secret_key,
150-
default_ttl: int = 10,
151-
hash_registry: bool = False):
150+
default_ttl: int = 10):
152151
self.default_ttl = default_ttl
153152
self.access_key = access_key
154153
self.secret_key = secret_key
155-
# TODO: Hack Alert: Including this for compatability
156-
# Once completed, all refs to the registry hack should be removed
157-
self.hash_registry = hash_registry
158-
# END TODO: Hack Alert
159154
self.signer = Signer(access_key, secret_key)
160155
self.session = make_session()
161156

@@ -175,17 +170,12 @@ def _create_auth_headers(self,
175170
body=''):
176171
signing_string = self.signer._create_request_body_signing_string(body)
177172

178-
# TODO: Hack alert: Registry doesn't like the sha256 body signing
179-
# string yet
180-
if self.hash_registry is False and 'https://registry' in url:
181-
signing_string = ''
182-
# END Hack alert
183-
184173
signature, expiration = self._signature(signing_string=signing_string)
185174
base = {
186175
'dynata-expiration': expiration,
187176
'dynata-access-key': self.access_key,
188-
'dynata-signature': signature
177+
'dynata-signature': signature,
178+
'dynata-signing-string': signing_string
189179
}
190180
return dict(additional_headers, **base)
191181

0 commit comments

Comments
 (0)