Nir Diwakar (Nir)
08/27/2024, 6:56 AMvisch
08/27/2024, 2:41 PMEdgar Ramírez (Arch.dev)
08/27/2024, 3:57 PMhttp_headers contain a field which signs the URL parameters dictI'd advice against introducing those dependencies and instead use the authenticator to sign the request, similar to https://github.com/edgarrmondragon/tap-bitso/blob/ced67abd27315be77b1d7a37fd2ac5f5b53dd9c0/tap_bitso/auth.py#L57-L93
Nir Diwakar (Nir)
08/30/2024, 3:00 PM@property
def http_headers(self) -> dict:
params = {}
params["mintime"] = self.start_time
params["maxtime"] = str(self.end_time)
params["limit"] = str(self.limit)
if self.next_page is not None:
params["next_offset"] = self.next_page
<http://self.logger.info|self.logger.info>(f'Request params: {params}')
headers = super().sign("GET", self.config.get("domain"), self.path,
params, self.config.get("skey"), self.config.get("ikey"))
headers["Host"] = self.config.get("domain").encode('utf-8')
return headers
and get_params will have:
def get_url_params(
self,
context,
next_page_token,
):
params = {}
params["mintime"] = self.start_time
params["maxtime"] = str(self.end_time)
params["limit"] = str(self.limit)
if next_page_token is not None:
self.next_page = next_page_token
params["next_offset"] = self.next_page
Since mintime, maxtime needs to be assigned to both and need to be the same, the only way to maintain consistency was to not update the endtime for 60 seconds.
return params