MCPcopy Create free account
hub / github.com/blacklanternsecurity/bbot / setup

Method setup

bbot/modules/templates/github.py:20–46  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

18 return url, kwargs
19
20 async def setup(self):
21 await super().setup()
22 self.headers = {}
23 api_keys = set()
24 modules_config = self.scan.config.get("modules", {})
25 git_modules = [m for m in modules_config if str(m).startswith("git")]
26 for module_name in git_modules:
27 module_config = modules_config.get(module_name, {})
28 api_key = module_config.get("api_key", "")
29 if isinstance(api_key, str):
30 api_key = [api_key]
31 for key in api_key:
32 key = key.strip()
33 if key:
34 api_keys.add(key)
35 if not api_keys:
36 if self.auth_required:
37 return None, "No API key set"
38 self.api_key = api_keys
39 try:
40 await self.ping()
41 self.hugesuccess("API is ready")
42 return True
43 except Exception as e:
44 self.trace(traceback.format_exc())
45 return None, f"Error with API ({str(e).strip()})"
46 return True
47
48 async def github_graphql_request(self, graphql_query, resp_key):
49 url = f"{self.base_url}/graphql"

Callers

nothing calls this directly

Calls 6

setFunction · 0.85
getMethod · 0.45
addMethod · 0.45
pingMethod · 0.45
hugesuccessMethod · 0.45
traceMethod · 0.45

Tested by

no test coverage detected