domaintools-api-test-upload 2.4.1__tar.gz → 2.5.1__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.4.1/domaintools_api_test_upload.egg-info → domaintools_api_test_upload-2.5.1}/PKG-INFO +41 -1
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/README.md +41 -1
- domaintools_api_test_upload-2.5.1/VERSION +1 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/_version.py +1 -1
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/api.py +10 -5
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/api.py +0 -1
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1/domaintools_api_test_upload.egg-info}/PKG-INFO +41 -1
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/tests/test_api.py +11 -1
- domaintools_api_test_upload-2.4.1/VERSION +0 -1
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/LICENSE +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/__init__.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/base_results.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/__init__.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/commands/__init__.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/commands/accounts.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/commands/detects.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/commands/domains.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/commands/feeds.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/commands/ips.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/commands/iris.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/constants.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/main.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/utils.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/constants.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/exceptions.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/filters.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/results.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/utils.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools_api_test_upload.egg-info/SOURCES.txt +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools_api_test_upload.egg-info/dependency_links.txt +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools_api_test_upload.egg-info/entry_points.txt +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools_api_test_upload.egg-info/requires.txt +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools_api_test_upload.egg-info/top_level.txt +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools_async/__init__.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/pyproject.toml +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/setup.cfg +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/setup.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/tests/test_async.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/tests/test_cli.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/tests/test_filters.py +0 -0
- {domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: domaintools_api_test_upload
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.5.1
|
|
4
4
|
Summary: DomainTools Official Python API
|
|
5
5
|
Author-email: DomainTools <integrations@domaintools.com>
|
|
6
6
|
License: The MIT License (MIT)
|
|
@@ -321,3 +321,43 @@ results = api.nod(sessionID="my-session-id", after=-7200)
|
|
|
321
321
|
for partial_result in results.response() # generator that holds NOD feeds data for the past 2 hours and is expected to request multiple times
|
|
322
322
|
# do things to partial_result
|
|
323
323
|
```
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
Running E2E Tests Locally
|
|
327
|
+
===================
|
|
328
|
+
For now, e2e tests only covers proxy and ssl testing. We are expected to broaden our e2e tests to other scenarios moving forward.
|
|
329
|
+
To add more e2e tests, put these in the `../tests/e2e` folder.
|
|
330
|
+
|
|
331
|
+
## Preparation
|
|
332
|
+
- Create virtual environment.
|
|
333
|
+
```bash
|
|
334
|
+
python3 -m venv venv
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
- Activate virtual environment
|
|
338
|
+
```bash
|
|
339
|
+
source venv/bin/activate
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
- Install dependencies.
|
|
343
|
+
```bash
|
|
344
|
+
pip install -r requirements/development.txt
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
- From the python_api project root directory, install the package.
|
|
348
|
+
```bash
|
|
349
|
+
pip install -e .
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
- Export api credentials to use.
|
|
353
|
+
```bash
|
|
354
|
+
export TEST_USER=<user-key>
|
|
355
|
+
export TEST_KEY=<api-key>
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
## Run the end-to-end test script
|
|
359
|
+
- Before running the test, be sure that docker is running.
|
|
360
|
+
- Execute the e2e test script .
|
|
361
|
+
```bash
|
|
362
|
+
sh tests/e2e/scripts/test_e2e_runner.sh
|
|
363
|
+
```
|
|
@@ -270,4 +270,44 @@ results = api.nod(sessionID="my-session-id", after=-7200)
|
|
|
270
270
|
|
|
271
271
|
for partial_result in results.response() # generator that holds NOD feeds data for the past 2 hours and is expected to request multiple times
|
|
272
272
|
# do things to partial_result
|
|
273
|
-
```
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
Running E2E Tests Locally
|
|
277
|
+
===================
|
|
278
|
+
For now, e2e tests only covers proxy and ssl testing. We are expected to broaden our e2e tests to other scenarios moving forward.
|
|
279
|
+
To add more e2e tests, put these in the `../tests/e2e` folder.
|
|
280
|
+
|
|
281
|
+
## Preparation
|
|
282
|
+
- Create virtual environment.
|
|
283
|
+
```bash
|
|
284
|
+
python3 -m venv venv
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
- Activate virtual environment
|
|
288
|
+
```bash
|
|
289
|
+
source venv/bin/activate
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
- Install dependencies.
|
|
293
|
+
```bash
|
|
294
|
+
pip install -r requirements/development.txt
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
- From the python_api project root directory, install the package.
|
|
298
|
+
```bash
|
|
299
|
+
pip install -e .
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
- Export api credentials to use.
|
|
303
|
+
```bash
|
|
304
|
+
export TEST_USER=<user-key>
|
|
305
|
+
export TEST_KEY=<api-key>
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## Run the end-to-end test script
|
|
309
|
+
- Before running the test, be sure that docker is running.
|
|
310
|
+
- Execute the e2e test script .
|
|
311
|
+
```bash
|
|
312
|
+
sh tests/e2e/scripts/test_e2e_runner.sh
|
|
313
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.5.1
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
from datetime import datetime, timedelta, timezone
|
|
2
|
-
from hashlib import sha1, sha256
|
|
2
|
+
from hashlib import sha1, sha256
|
|
3
3
|
from hmac import new as hmac
|
|
4
|
+
from typing import Union
|
|
4
5
|
|
|
5
6
|
import re
|
|
7
|
+
import ssl
|
|
6
8
|
|
|
7
9
|
from domaintools.constants import Endpoint, ENDPOINT_TO_SOURCE_MAP, FEEDS_PRODUCTS_LIST, OutputFormat
|
|
8
10
|
from domaintools._version import current as version
|
|
@@ -24,7 +26,7 @@ from domaintools.filters import (
|
|
|
24
26
|
from domaintools.utils import validate_feeds_parameters
|
|
25
27
|
|
|
26
28
|
|
|
27
|
-
AVAILABLE_KEY_SIGN_HASHES = ["sha1", "sha256"
|
|
29
|
+
AVAILABLE_KEY_SIGN_HASHES = ["sha1", "sha256"]
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
def delimited(items, character="|"):
|
|
@@ -76,7 +78,7 @@ class API(object):
|
|
|
76
78
|
self.username = username
|
|
77
79
|
self.key = key
|
|
78
80
|
self.https = https
|
|
79
|
-
self.verify_ssl = verify_ssl
|
|
81
|
+
self.verify_ssl = self._get_ssl_default_context(verify_ssl)
|
|
80
82
|
self.rate_limit = rate_limit
|
|
81
83
|
self.proxy_url = proxy_url
|
|
82
84
|
self.extra_request_params = {}
|
|
@@ -92,9 +94,12 @@ class API(object):
|
|
|
92
94
|
if proxy_url and not isinstance(proxy_url, str):
|
|
93
95
|
raise Exception("Proxy URL must be a string. For example: '127.0.0.1:8888'")
|
|
94
96
|
|
|
97
|
+
def _get_ssl_default_context(self, verify_ssl: Union[str, bool]):
|
|
98
|
+
return ssl.create_default_context(cafile=verify_ssl) if isinstance(verify_ssl, str) else verify_ssl
|
|
99
|
+
|
|
95
100
|
def _build_api_url(self, api_url=None, api_port=None):
|
|
96
101
|
"""Build the API url based on the given url and port. Defaults to `https://api.domaintools.com`"""
|
|
97
|
-
rest_api_url = "https://api.domaintools.com
|
|
102
|
+
rest_api_url = "https://api.domaintools.com"
|
|
98
103
|
if api_url:
|
|
99
104
|
rest_api_url = api_url
|
|
100
105
|
|
|
@@ -1212,7 +1217,7 @@ class API(object):
|
|
|
1212
1217
|
kwargs.pop("headers", None)
|
|
1213
1218
|
|
|
1214
1219
|
return self._results(
|
|
1215
|
-
f"domain-risk-({source})",
|
|
1220
|
+
f"domain-risk-feed-({source})",
|
|
1216
1221
|
f"v1/{endpoint}/domainrisk/",
|
|
1217
1222
|
response_path=(),
|
|
1218
1223
|
cls=FeedsResults,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: domaintools_api_test_upload
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.5.1
|
|
4
4
|
Summary: DomainTools Official Python API
|
|
5
5
|
Author-email: DomainTools <integrations@domaintools.com>
|
|
6
6
|
License: The MIT License (MIT)
|
|
@@ -321,3 +321,43 @@ results = api.nod(sessionID="my-session-id", after=-7200)
|
|
|
321
321
|
for partial_result in results.response() # generator that holds NOD feeds data for the past 2 hours and is expected to request multiple times
|
|
322
322
|
# do things to partial_result
|
|
323
323
|
```
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
Running E2E Tests Locally
|
|
327
|
+
===================
|
|
328
|
+
For now, e2e tests only covers proxy and ssl testing. We are expected to broaden our e2e tests to other scenarios moving forward.
|
|
329
|
+
To add more e2e tests, put these in the `../tests/e2e` folder.
|
|
330
|
+
|
|
331
|
+
## Preparation
|
|
332
|
+
- Create virtual environment.
|
|
333
|
+
```bash
|
|
334
|
+
python3 -m venv venv
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
- Activate virtual environment
|
|
338
|
+
```bash
|
|
339
|
+
source venv/bin/activate
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
- Install dependencies.
|
|
343
|
+
```bash
|
|
344
|
+
pip install -r requirements/development.txt
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
- From the python_api project root directory, install the package.
|
|
348
|
+
```bash
|
|
349
|
+
pip install -e .
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
- Export api credentials to use.
|
|
353
|
+
```bash
|
|
354
|
+
export TEST_USER=<user-key>
|
|
355
|
+
export TEST_KEY=<api-key>
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
## Run the end-to-end test script
|
|
359
|
+
- Before running the test, be sure that docker is running.
|
|
360
|
+
- Execute the e2e test script .
|
|
361
|
+
```bash
|
|
362
|
+
sh tests/e2e/scripts/test_e2e_runner.sh
|
|
363
|
+
```
|
|
@@ -342,11 +342,20 @@ def test_exception_handling():
|
|
|
342
342
|
API("notauser", "notakey").domain_search("amazon").data()
|
|
343
343
|
with pytest.raises(
|
|
344
344
|
ValueError,
|
|
345
|
-
match=r"Invalid value 'notahash' for 'key_sign_hash'. Values available are sha1,sha256
|
|
345
|
+
match=r"Invalid value 'notahash' for 'key_sign_hash'. Values available are sha1,sha256",
|
|
346
346
|
):
|
|
347
347
|
API("notauser", "notakey", always_sign_api_key=True, key_sign_hash="notahash").domain_search("amazon")
|
|
348
348
|
|
|
349
349
|
|
|
350
|
+
@vcr.use_cassette
|
|
351
|
+
def test_md5_is_not_supported():
|
|
352
|
+
with pytest.raises(
|
|
353
|
+
ValueError,
|
|
354
|
+
match=r"Invalid value 'md5' for 'key_sign_hash'. Values available are sha1,sha256",
|
|
355
|
+
):
|
|
356
|
+
API("notauser", "notakey", always_sign_api_key=True, key_sign_hash="md5").domain_search("amazon")
|
|
357
|
+
|
|
358
|
+
|
|
350
359
|
@vcr.use_cassette
|
|
351
360
|
def test_rate_limiting():
|
|
352
361
|
domain_searches = ["google"] * 31
|
|
@@ -377,6 +386,7 @@ def test_formats():
|
|
|
377
386
|
|
|
378
387
|
|
|
379
388
|
@vcr.use_cassette
|
|
389
|
+
@pytest.mark.skip(reason="Iris endpoint is already deprecated in light of enrich and investigate")
|
|
380
390
|
def test_iris():
|
|
381
391
|
with pytest.raises(ValueError):
|
|
382
392
|
api.iris()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.4.1
|
|
File without changes
|
{domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/__init__.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/base_results.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/__init__.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.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/constants.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/main.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/cli/utils.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/constants.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/exceptions.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/filters.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/domaintools/results.py
RENAMED
|
File without changes
|
{domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/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
|
{domaintools_api_test_upload-2.4.1 → domaintools_api_test_upload-2.5.1}/tests/test_filters.py
RENAMED
|
File without changes
|
|
File without changes
|