diff --git a/README.md b/README.md index f96a81c..5dcc3f6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ -# infinihash-kyt (Python) +# infinihash-kyt (Python) — DEPRECATED, use Infinihash/infinihash-kyt + +> **This repository is deprecated.** The maintained Python SDK is +> [Infinihash/infinihash-kyt](https://github.com/Infinihash/infinihash-kyt). +> Both repositories claim the PyPI name `infinihash-kyt`; publish only from +> `Infinihash/infinihash-kyt`, never from this repository. This copy is kept +> for history. Thin Python wrapper for the Infinihash KYT REST API. Screen wallets, manage cases, pull SAR drafts. @@ -9,12 +15,17 @@ cases, pull SAR drafts. pip install infinihash-kyt ``` +## API keys + +Create a key at https://kyt.infinihash.com/kyt/settings/api-keys. Keys start +with `kyt_`. + ## Use ```python from infinihash_kyt import KYT -client = KYT(api_key="ih_kyt_...") # or set INFINIHASH_KYT_KEY in your env +client = KYT(api_key="kyt_...") # or set INFINIHASH_KYT_KEY in your env # Screen a wallet r = client.screen.address("0x722122dF12D4e14e13Ac3b6895a86e84145b6967", chain="ethereum") diff --git a/infinihash_kyt/__init__.py b/infinihash_kyt/__init__.py index b40d8e7..9c1cb7b 100644 --- a/infinihash_kyt/__init__.py +++ b/infinihash_kyt/__init__.py @@ -7,7 +7,7 @@ Quick start: from infinihash_kyt import KYT - client = KYT(api_key="ih_kyt_...") + client = KYT(api_key="kyt_...") result = client.screen.address( "0x722122dF12D4e14e13Ac3b6895a86e84145b6967", chain="ethereum", diff --git a/infinihash_kyt/__pycache__/__init__.cpython-315.pyc b/infinihash_kyt/__pycache__/__init__.cpython-315.pyc new file mode 100644 index 0000000..bfbb820 Binary files /dev/null and b/infinihash_kyt/__pycache__/__init__.cpython-315.pyc differ diff --git a/infinihash_kyt/__pycache__/client.cpython-315.pyc b/infinihash_kyt/__pycache__/client.cpython-315.pyc new file mode 100644 index 0000000..a8b6a0c Binary files /dev/null and b/infinihash_kyt/__pycache__/client.cpython-315.pyc differ diff --git a/infinihash_kyt/client.py b/infinihash_kyt/client.py index 713a210..74c4633 100644 --- a/infinihash_kyt/client.py +++ b/infinihash_kyt/client.py @@ -8,7 +8,7 @@ ----------- from infinihash_kyt import KYT - client = KYT(api_key="ih_kyt_...") # or set INFINIHASH_KYT_KEY env var + client = KYT(api_key="kyt_...") # or set INFINIHASH_KYT_KEY env var # Screen a wallet result = client.screen.address( @@ -29,7 +29,7 @@ Auth ---- -Issue API keys at https://kyt.infinihash.com/kyt/admin (X-API-Key header). +Issue API keys at https://kyt.infinihash.com/kyt/settings/api-keys (X-API-Key header). Pass api_key= to the constructor or export INFINIHASH_KYT_KEY in the environment. Errors @@ -243,7 +243,7 @@ def export_fincen(self, case_id: str) -> dict: class Webhooks(_Resource): """Webhook endpoint management. - Webhooks deliver real-time push notifications to your server when + Webhooks deliver push notifications to your server when screening events occur. Payloads are signed with HMAC-SHA256 using your webhook secret — verify the X-KYT-Signature header on receipt. """ @@ -507,11 +507,11 @@ def lookup(self, address: str) -> dict: Args: address: Address to look up (chain prefix optional, e.g. "eth:0xABC..."). """ - return self._c._request("GET", f"/api/v1/lookup/{address}") + return self._c._request("GET", f"/api/v1/intel/lookup/{address}") def recent_screenings(self) -> list: """Return recent screening activity for your organisation (last 50).""" - return self._c._request("GET", "/api/v1/recent-screenings") + return self._c._request("GET", "/api/v1/intel/recent-screenings") # --------------------------------------------------------------------------- @@ -549,7 +549,7 @@ class KYT: """Infinihash KYT API client. Args: - api_key: Your KYT API key (ih_kyt_...). + api_key: Your KYT API key (kyt_...). Falls back to INFINIHASH_KYT_KEY environment variable. base_url: Override the API base URL (useful for sandbox/staging). timeout: Request timeout in seconds (default 30). @@ -572,7 +572,7 @@ class KYT: ------- from infinihash_kyt import KYT - client = KYT(api_key="ih_kyt_...") + client = KYT(api_key="kyt_...") result = client.screen.address("0x722122dF12D4e14e13Ac3b6895a86e84145b6967") if result["risk_level"] in ("high", "critical"): case = client.cases.create(address=result["value"]) diff --git a/tests/__pycache__/test_audit_routes_docs.cpython-315-pytest-9.2.0.pyc b/tests/__pycache__/test_audit_routes_docs.cpython-315-pytest-9.2.0.pyc new file mode 100644 index 0000000..423ac6c Binary files /dev/null and b/tests/__pycache__/test_audit_routes_docs.cpython-315-pytest-9.2.0.pyc differ diff --git a/tests/test_audit_routes_docs.py b/tests/test_audit_routes_docs.py new file mode 100644 index 0000000..2cf6fb7 --- /dev/null +++ b/tests/test_audit_routes_docs.py @@ -0,0 +1,50 @@ +"""Audit 2026-11 C-2 / C-3 / C-4 for the deprecated kyt-python SDK. + +- intel.lookup() / intel.recent_screenings() called /api/v1/lookup/{address} + and /api/v1/recent-screenings, both 404. The real routes are + /api/v1/intel/lookup/{address} and /api/v1/intel/recent-screenings + (clearauthority-kyt app/api/v1/intel.py: prefix /intel, :60, :101). A 404 on + an intelligence lookup reads as "this address is clean". +- Key docs pointed at /kyt/admin (admin-only) and showed ih_kyt_ keys; the + engine mints kyt_ keys. +- README must carry a deprecation notice pointing at infinihash-kyt. +""" +import pathlib + +from infinihash_kyt.client import KYT + +ROOT = pathlib.Path(__file__).resolve().parent.parent +DOCS = [ROOT / "README.md", ROOT / "infinihash_kyt" / "client.py", ROOT / "infinihash_kyt" / "__init__.py"] + + +def _capture(monkeypatch): + calls = [] + c = KYT(api_key="kyt_test") + monkeypatch.setattr(c, "_request", lambda method, path, **kw: calls.append((method, path)) or {}) + return c, calls + + +def test_intel_lookup_route(monkeypatch): + c, calls = _capture(monkeypatch) + c.intel.lookup("0xabc") + assert calls == [("GET", "/api/v1/intel/lookup/0xabc")] + + +def test_intel_recent_screenings_route(monkeypatch): + c, calls = _capture(monkeypatch) + c.intel.recent_screenings() + assert calls == [("GET", "/api/v1/intel/recent-screenings")] + + +def test_key_docs(): + for f in DOCS: + s = f.read_text() + assert "/kyt/admin" not in s, f"{f.name} links /kyt/admin" + assert "ih_kyt_" not in s, f"{f.name} shows ih_kyt_ keys" + assert any("https://kyt.infinihash.com/kyt/settings/api-keys" in f.read_text() for f in DOCS) + + +def test_readme_deprecation_notice(): + s = (ROOT / "README.md").read_text() + assert "DEPRECATED" in s + assert "https://github.com/Infinihash/infinihash-kyt" in s