intrigueio / intrigue-core

Discover Your Attack Surface!
https://core.intrigue.io
Other
1.35k stars 262 forks source link

Github Gather Repositories Task Rework + Bug Fixes #428

Closed m-q-t closed 3 years ago

m-q-t commented 3 years ago

Hi team,

Please find attached the PR which is a rework of the gather_github_repositories.rb task. There are several enhancements to the task which include:

# when calling client.repos and passing in a name, it will return only public repositories
# even if the client is associated with the user's token
# since we have a valid access token; we will call client.repos
# also call client.repos with the name of the github account provided
# then extract out all the repos which belong to the github account provided
(client.repos + client.repos(name)).uniq

Not only did this result in the task taking longer it also wasted the precious API Request quota limit... By directly interacting with the REST API, we are now able to avoid taking this 'hacky' route as the route returns all the repositories belonging to the user including ones that the key has access to.

Bug Fixes

Other

Pending specs

Thank you.

Best regards, Maxim