domaintools-api-test-upload 2.6.0__tar.gz → 2.6.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {domaintools_api_test_upload-2.6.0/domaintools_api_test_upload.egg-info → domaintools_api_test_upload-2.6.2}/PKG-INFO +1 -1
- domaintools_api_test_upload-2.6.2/VERSION +1 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/_version.py +1 -1
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/api.py +6 -2
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/results.py +5 -23
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2/domaintools_api_test_upload.egg-info}/PKG-INFO +1 -1
- domaintools_api_test_upload-2.6.0/VERSION +0 -1
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/LICENSE +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/README.md +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/__init__.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/base_results.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/__init__.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/api.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/commands/__init__.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/commands/accounts.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/commands/detects.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/commands/domains.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/commands/feeds.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/commands/ips.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/commands/iris.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/constants.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/main.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/utils.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/constants.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/exceptions.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/filters.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/utils.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools_api_test_upload.egg-info/SOURCES.txt +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools_api_test_upload.egg-info/dependency_links.txt +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools_api_test_upload.egg-info/entry_points.txt +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools_api_test_upload.egg-info/requires.txt +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools_api_test_upload.egg-info/top_level.txt +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools_async/__init__.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/pyproject.toml +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/setup.cfg +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/setup.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/tests/test_api.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/tests/test_async.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/tests/test_cli.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/tests/test_filters.py +0 -0
- {domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/tests/test_utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.6.2
|
|
@@ -112,8 +112,12 @@ class API(object):
|
|
|
112
112
|
|
|
113
113
|
self._rest_api_url = rest_api_url
|
|
114
114
|
|
|
115
|
-
def _rate_limit(self):
|
|
115
|
+
def _rate_limit(self, product):
|
|
116
116
|
"""Pulls in and enforces the latest rate limits for the specified user"""
|
|
117
|
+
if product in RTTF_PRODUCTS_LIST:
|
|
118
|
+
self.limits_set = False
|
|
119
|
+
return
|
|
120
|
+
|
|
117
121
|
self.limits_set = True
|
|
118
122
|
for product in self.account_information():
|
|
119
123
|
limit_minutes = product["per_minute_limit"] or None
|
|
@@ -130,7 +134,7 @@ class API(object):
|
|
|
130
134
|
if product != "account-information" and self.rate_limit and not self.limits_set and not self.limits:
|
|
131
135
|
always_sign_api_key_previous_value = self.always_sign_api_key
|
|
132
136
|
header_authentication_previous_value = self.header_authentication
|
|
133
|
-
self._rate_limit()
|
|
137
|
+
self._rate_limit(product)
|
|
134
138
|
# Reset always_sign_api_key and header_authentication to its original
|
|
135
139
|
# User-set values as these might be affected when self.account_information() was executed
|
|
136
140
|
self.always_sign_api_key = always_sign_api_key_previous_value
|
{domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/results.py
RENAMED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Additionally, defines any custom result objects that may be used to enable more Pythonic interaction with endpoints.
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
-
import json
|
|
7
6
|
import logging
|
|
8
7
|
import httpx
|
|
9
8
|
import time
|
|
@@ -15,7 +14,6 @@ except ImportError: # pragma: no cover
|
|
|
15
14
|
|
|
16
15
|
from itertools import zip_longest, chain
|
|
17
16
|
from typing import Generator
|
|
18
|
-
from httpx import Client
|
|
19
17
|
|
|
20
18
|
from domaintools_async import AsyncResults as Results
|
|
21
19
|
|
|
@@ -210,7 +208,7 @@ class FeedsResults(Results):
|
|
|
210
208
|
|
|
211
209
|
Highlevel process:
|
|
212
210
|
|
|
213
|
-
httpx stream ->
|
|
211
|
+
httpx stream -> check status code -> yield back data to client -> repeat if 206
|
|
214
212
|
|
|
215
213
|
Returns the generator object for feeds results.
|
|
216
214
|
"""
|
|
@@ -242,36 +240,21 @@ class FeedsResults(Results):
|
|
|
242
240
|
yield {"status_ready": True}
|
|
243
241
|
|
|
244
242
|
for line in response.iter_lines():
|
|
245
|
-
|
|
246
|
-
yield line
|
|
243
|
+
yield line
|
|
247
244
|
except Exception as e:
|
|
248
245
|
self.latest_feeds_status_code = 500
|
|
249
|
-
|
|
250
|
-
raise
|
|
246
|
+
raise e
|
|
251
247
|
|
|
252
248
|
def _get_results(self) -> Generator:
|
|
253
249
|
try:
|
|
254
|
-
wait_for = self._wait_time()
|
|
255
250
|
feeds_generator = self._make_request()
|
|
256
|
-
|
|
257
251
|
next(feeds_generator) # to start the generator process
|
|
258
252
|
self.setStatus(self.latest_feeds_status_code) # set the status already
|
|
259
253
|
|
|
260
|
-
should_wait = (
|
|
261
|
-
wait_for
|
|
262
|
-
and wait_for > 0
|
|
263
|
-
and not (self.api.rate_limit and (self.product == "account-information"))
|
|
264
|
-
)
|
|
265
|
-
if should_wait:
|
|
266
|
-
log.info(f"Sleeping for {wait_for}s.")
|
|
267
|
-
time.sleep(wait_for)
|
|
268
|
-
|
|
269
254
|
# yield the rest of the feeds
|
|
270
255
|
yield from feeds_generator
|
|
271
256
|
except Exception as e:
|
|
272
|
-
|
|
273
|
-
self.latest_feeds_status_code = 500
|
|
274
|
-
self.setStatus(500, reason_text=f"Reason: {e}")
|
|
257
|
+
self.setStatus(500, reason_text=e)
|
|
275
258
|
return
|
|
276
259
|
|
|
277
260
|
def data(self) -> Generator:
|
|
@@ -293,8 +276,7 @@ class FeedsResults(Results):
|
|
|
293
276
|
# Otherwise, we will have an infinite request if sessionID was not provided but the required data asked is more than the maximum (1 hour of data)
|
|
294
277
|
break
|
|
295
278
|
except Exception as e:
|
|
296
|
-
self.
|
|
297
|
-
self.setStatus(500, reason_text=f"Reason: {e}")
|
|
279
|
+
self.setStatus(500, reason_text=e)
|
|
298
280
|
break # safely close the while loop if there's any error above
|
|
299
281
|
|
|
300
282
|
def __str__(self):
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.6.0
|
|
File without changes
|
|
File without changes
|
{domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/__init__.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/base_results.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/__init__.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/constants.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/main.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/cli/utils.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/constants.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/exceptions.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/filters.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/domaintools/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{domaintools_api_test_upload-2.6.0 → domaintools_api_test_upload-2.6.2}/tests/test_filters.py
RENAMED
|
File without changes
|
|
File without changes
|