Skip to content

Commit

Permalink
fix leakix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Nov 16, 2024
1 parent 5e512c4 commit 0cec846
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bbot/modules/leakix.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ class leakix(subdomain_enum_apikey):
base_url = "https://leakix.net"
ping_url = f"{base_url}/host/1.1.1.1"

async def setup(self):
ret = await super(subdomain_enum_apikey, self).setup()
self.api_key = self.config.get("api_key", "")
if self.api_key:
return await self.require_api_key()
return ret

def prepare_api_request(self, url, kwargs):
if self.api_key:
kwargs["headers"]["api-key"] = self.api_key
Expand Down
4 changes: 4 additions & 0 deletions bbot/test/test_step_2/module_tests/test_module_leakix.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class TestLeakIX_NoAPIKey(ModuleTestBase):
modules_overrides = ["leakix"]

async def setup_before_prep(self, module_test):
module_test.httpx_mock.add_response(
url="https://leakix.net/host/1.1.1.1",
json={"title": "Not Found", "description": "Host not found"},
)
module_test.httpx_mock.add_response(
url=f"https://leakix.net/api/subdomains/blacklanternsecurity.com",
json=[
Expand Down

0 comments on commit 0cec846

Please sign in to comment.