Skip to content

Commit 010ea80

Browse files
committed
Refactor: Remove get_api_status/is_pro (endpoint not yet available)
The /api/user/info endpoint is not deployed to production yet. Remove these methods until the backend is ready.
1 parent 362ce2b commit 010ea80

4 files changed

Lines changed: 0 additions & 41 deletions

File tree

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ and this project adheres to
1313
- AsyncClient with full async/await support using httpx
1414
- Simple `search()` API accepting raw query strings
1515
- `get_domain()` method for domain lookups
16-
- `get_api_status()` and `is_pro()` methods for account info
1716
- Streaming `bulk_export_stream()` for memory-efficient exports
1817
- `serialize_queries()` helper to reduce query serialization duplication
1918
- Async example in `example/example_async_client.py`

leakix/async_client.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -139,25 +139,6 @@ async def get_subdomains(self, domain: str) -> AbstractResponse:
139139
"""Returns the list of subdomains for a given domain."""
140140
return self._parse_subdomains(await self._get(f"/api/subdomains/{domain}"))
141141

142-
async def get_api_status(self, force: bool = False) -> AbstractResponse:
143-
"""
144-
Check API status and subscription info via /api/user/info endpoint.
145-
Results are cached per client instance. Use force=True to refresh.
146-
"""
147-
if self._api_status is not None and not force:
148-
return self._api_status
149-
150-
r = await self._get("/api/user/info")
151-
self._api_status = r
152-
return r
153-
154-
async def is_pro(self) -> bool:
155-
"""Check if the API key has Pro access. Result is cached."""
156-
r = await self.get_api_status()
157-
if r.is_success():
158-
return bool(r.json().get("is_pro", False))
159-
return False
160-
161142
async def bulk_export(self, queries: list[Query] | None = None) -> AbstractResponse:
162143
"""Bulk export leaks (Pro API feature)."""
163144
serialized_query = serialize_queries(queries)

leakix/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def __init__(
3838
}
3939
if api_key:
4040
self.headers["api-key"] = api_key
41-
self._api_status: AbstractResponse | None = None
4241

4342
@staticmethod
4443
def _parse_events(response: AbstractResponse) -> AbstractResponse:

leakix/client.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -215,23 +215,3 @@ def bulk_export_stream(
215215
l9format.L9Aggregation,
216216
l9format.L9Aggregation.from_dict(json_event),
217217
)
218-
219-
def get_api_status(self, force: bool = False) -> AbstractResponse:
220-
"""
221-
Check API status and subscription info via /api/user/info endpoint.
222-
Results are cached per client instance. Use force=True to refresh.
223-
"""
224-
if self._api_status is not None and not force:
225-
return self._api_status
226-
227-
url = f"{self.base_url}/api/user/info"
228-
r = self.__get(url, params=None)
229-
self._api_status = r
230-
return r
231-
232-
def is_pro(self) -> bool:
233-
"""Check if the API key has Pro access. Result is cached."""
234-
r = self.get_api_status()
235-
if r.is_success():
236-
return bool(r.json().get("is_pro", False))
237-
return False

0 commit comments

Comments
 (0)