(self, org)
| 190 | return repos |
| 191 | |
| 192 | async def validate_org(self, org): |
| 193 | is_org = False |
| 194 | in_scope = False |
| 195 | url = f"{self.base_url}/orgs/{org}" |
| 196 | r = await self.api_request(url) |
| 197 | if r is None: |
| 198 | return is_org, in_scope |
| 199 | status_code = getattr(r, "status_code", 0) |
| 200 | if status_code == 403: |
| 201 | self.warning("Github is rate-limiting us (HTTP status: 403)") |
| 202 | return is_org, in_scope |
| 203 | if status_code == 200: |
| 204 | is_org = True |
| 205 | in_scope_hosts = await self.scan.extract_in_scope_hostnames(getattr(r, "text", "")) |
| 206 | if in_scope_hosts: |
| 207 | self.verbose( |
| 208 | f'Found in-scope hostname(s): "{in_scope_hosts}" for github org: {org}, it appears to be in-scope' |
| 209 | ) |
| 210 | in_scope = True |
| 211 | return is_org, in_scope |
no test coverage detected