(self, credentials: BundleCredentials)
| 6 | |
| 7 | class Github(BundleHandler): |
| 8 | async def verify(self, credentials: BundleCredentials): |
| 9 | query: str = "taskingai" |
| 10 | github_api_key: str = credentials.credentials.get("GITHUB_API_KEY") |
| 11 | |
| 12 | url = f'https://api.github.com/search/repositories?q={query}' |
| 13 | |
| 14 | headers = { |
| 15 | 'Authorization': f'Bearer {github_api_key}', |
| 16 | 'Content-Type': 'application/json', |
| 17 | 'X-GitHub-Api-Version': '2022-11-28' |
| 18 | } |
| 19 | |
| 20 | async with ClientSession() as session: |
| 21 | async with session.get(url=url, headers=headers, proxy=CONFIG.PROXY) as response: |
| 22 | if response.status == 200: |
| 23 | pass |
| 24 | else: |
| 25 | raise_credentials_validation_error() |
nothing calls this directly
no test coverage detected