domaintools-api 2.7.0__tar.gz → 2.7.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-2.7.0/domaintools_api.egg-info → domaintools_api-2.7.2}/PKG-INFO +1 -1
- domaintools_api-2.7.2/VERSION +1 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/_version.py +1 -1
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/api.py +6 -2
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/constants.py +2 -2
- {domaintools_api-2.7.0 → domaintools_api-2.7.2/domaintools_api.egg-info}/PKG-INFO +1 -1
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/tests/test_api.py +10 -4
- domaintools_api-2.7.0/VERSION +0 -1
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/LICENSE +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/README.md +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/__init__.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/base_results.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/cli/__init__.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/cli/api.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/cli/commands/__init__.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/cli/commands/accounts.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/cli/commands/detects.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/cli/commands/domains.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/cli/commands/feeds.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/cli/commands/ips.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/cli/commands/iris.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/cli/constants.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/cli/main.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/cli/utils.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/decorators.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/docstring_patcher.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/exceptions.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/filters.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/request_validator.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/results.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/specs/iris-openapi.yaml +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools/utils.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools_api.egg-info/SOURCES.txt +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools_api.egg-info/dependency_links.txt +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools_api.egg-info/entry_points.txt +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools_api.egg-info/requires.txt +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools_api.egg-info/top_level.txt +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/domaintools_async/__init__.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/pyproject.toml +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/setup.cfg +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/setup.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/tests/test_async.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/tests/test_cli.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/tests/test_decorators.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/tests/test_docstring_patcher.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/tests/test_filters.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/tests/test_request_validator.py +0 -0
- {domaintools_api-2.7.0 → domaintools_api-2.7.2}/tests/test_utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.7.2
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
from datetime import datetime, timedelta, timezone
|
|
2
2
|
from hashlib import sha1, sha256
|
|
3
3
|
from hmac import new as hmac
|
|
4
|
+
from pathlib import Path
|
|
4
5
|
from typing import Union
|
|
5
6
|
|
|
6
7
|
import re
|
|
7
8
|
import ssl
|
|
8
9
|
import yaml
|
|
9
10
|
|
|
11
|
+
|
|
10
12
|
from domaintools.constants import (
|
|
11
13
|
Endpoint,
|
|
12
14
|
OutputFormat,
|
|
@@ -111,9 +113,11 @@ class API(object):
|
|
|
111
113
|
raise Exception("Proxy URL must be a string. For example: '127.0.0.1:8888'")
|
|
112
114
|
|
|
113
115
|
def _initialize_specs(self):
|
|
116
|
+
package_root = Path(__file__).parent
|
|
114
117
|
for spec_name, file_path in SPECS_MAPPING.items():
|
|
118
|
+
specs_file_path = f"{package_root}/specs/{file_path}"
|
|
115
119
|
try:
|
|
116
|
-
with open(
|
|
120
|
+
with open(specs_file_path, "r", encoding="utf-8") as f:
|
|
117
121
|
spec_content = yaml.safe_load(f)
|
|
118
122
|
if not spec_content:
|
|
119
123
|
raise ValueError("Spec file is empty or invalid.")
|
|
@@ -121,7 +125,7 @@ class API(object):
|
|
|
121
125
|
self.specs[spec_name] = spec_content
|
|
122
126
|
|
|
123
127
|
except Exception as e:
|
|
124
|
-
print(f"Error loading {
|
|
128
|
+
print(f"Error loading {specs_file_path}: {e}")
|
|
125
129
|
|
|
126
130
|
def _get_ssl_default_context(self, verify_ssl: Union[str, bool]):
|
|
127
131
|
return (
|
|
@@ -345,7 +345,9 @@ def test_exception_handling():
|
|
|
345
345
|
ValueError,
|
|
346
346
|
match=r"Invalid value 'notahash' for 'key_sign_hash'. Values available are sha1,sha256",
|
|
347
347
|
):
|
|
348
|
-
API(
|
|
348
|
+
API(
|
|
349
|
+
"notauser", "notakey", always_sign_api_key=True, key_sign_hash="notahash"
|
|
350
|
+
).domain_search("amazon")
|
|
349
351
|
|
|
350
352
|
|
|
351
353
|
@vcr.use_cassette
|
|
@@ -354,7 +356,9 @@ def test_md5_is_not_supported():
|
|
|
354
356
|
ValueError,
|
|
355
357
|
match=r"Invalid value 'md5' for 'key_sign_hash'. Values available are sha1,sha256",
|
|
356
358
|
):
|
|
357
|
-
API("notauser", "notakey", always_sign_api_key=True, key_sign_hash="md5").domain_search(
|
|
359
|
+
API("notauser", "notakey", always_sign_api_key=True, key_sign_hash="md5").domain_search(
|
|
360
|
+
"amazon"
|
|
361
|
+
)
|
|
358
362
|
|
|
359
363
|
|
|
360
364
|
# @vcr.use_cassette
|
|
@@ -464,7 +468,9 @@ def test_iris_detect_monitors():
|
|
|
464
468
|
|
|
465
469
|
@vcr.use_cassette
|
|
466
470
|
def test_iris_detect_new_domains():
|
|
467
|
-
detect_results = api.iris_detect_new_domains(
|
|
471
|
+
detect_results = api.iris_detect_new_domains(
|
|
472
|
+
monitor_id="nAwmQg2pqg", sort=["risk_score"], order="desc"
|
|
473
|
+
)
|
|
468
474
|
assert detect_results["watchlist_domains"][0]["risk_score"] == 100
|
|
469
475
|
|
|
470
476
|
|
|
@@ -476,7 +482,7 @@ def test_iris_detect_watched_domains():
|
|
|
476
482
|
detect_results = api.iris_detect_watched_domains(
|
|
477
483
|
monitor_id="nAwmQg2pqg", sort=["risk_score"], order="desc"
|
|
478
484
|
)
|
|
479
|
-
assert len(detect_results["watchlist_domains"]) ==
|
|
485
|
+
assert len(detect_results["watchlist_domains"]) == 5
|
|
480
486
|
|
|
481
487
|
detect_results = api.iris_detect_watched_domains(escalation_types="blocked")
|
|
482
488
|
assert detect_results["count"] == 1
|
domaintools_api-2.7.0/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.7.0
|
|
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
|
|
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-2.7.0 → domaintools_api-2.7.2}/domaintools_api.egg-info/dependency_links.txt
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
|
|
File without changes
|
|
File without changes
|