Commit Graph
10 Commits
Author SHA1 Message Date
Richard GomezandKashif Khan bb899f20dc [GitHub] Add a GraphQL client to the connector (#3837)
* feat(github): add graphql client

* Update connector.go

* Update connector.go

* Update connector_basicauth.go

* Update connector_token.go

* Update connector_unauthenticated.go

* Update connector_app.go

---------

Co-authored-by: Kashif Khan <70996046+kashifkhan0771@users.noreply.github.com>
2025-08-26 11:25:38 +05:00
Kashif Khan 07c16636eb Enable cloning repository to a specified location with retention option (#4408)
* Enabled cloning repositories to a specified path with retention option

* Fixes after testing

* resolved lint issue

* resolved comments

* enabled clone path for github basic auth
2025-08-20 18:10:02 +05:00
Kashif Khan 92e9157267 Github and Gitlab Authentication via http.extraHeader for cloning Repositories (#4139)
* initial code changes

* move args before clone command

* add comments

* added flag for github source to support backward compatibility

* added flag for gitlab source to support backward compatibility

* inverse the logic for enterprise

* remove print statement

* remove flag defaults

* updated comments and removed CloneRepoUsingTokenInHeader function

* false->true
2025-05-27 11:24:43 +05:00
Cody Rose ae793d7030 Enable GitHub Realtime authentication (#3929)
GitHub Realtime needs to be able to authenticate. This PR adds relevant fields to the relevant protobuf message, and exports/tweaks some stuff from the github source package to permit its (eventual) use by the GitHub Realtime implementation:

The Connector interface and its constructors are now exported
Connector.Clone now accepts additional clone arguments
The github-specific connection construction has been moved into github.go
The injected rate limit handler no longer accepts error reporters that it never uses
I also added an API endpoint field to the GitHub Realtime proto message, because we need that too and I was here.
2025-02-26 10:20:05 -05:00
0x1 3ee9c2f1af [SCAN-165] Use Err Reporting (#3862)
* nit

* update rate limit handler to use reporter

* update process repos to use rate limit handler with unit reporter

* update getReposByOrgOrUser to report err

* update dedupreporter to report err

* add errReporter interface to handle both types of reporters

* convert to error reporter types

* update handleRateLimit signature

* use reporters for all rate limit handlers in github

* get repo url before err check

* use iterator

* remove err log

* nit

* pluralize

* remove err log

* update tests

* make linter happy
2025-02-04 13:44:37 -05:00
Miccah fbf835f6b2 [chore] Use static token in GitHub source (#3834)
Also some minor formatting in sources.go
2025-01-09 14:08:20 -08:00
ahrav e2f5e0e4bc upgrade Github dep (#3699) 2024-12-02 12:34:47 -08:00
ahrav e57c712998 Manually upgrade github dep (#3387) 2024-10-10 06:16:40 -07:00
Nash 17f6c98119 GitHub source logger clean up (#3269)
* GitHub source logger clean up

* applied pr comments

* applied pr comments

* applied pr comments

* applied PR review comments
2024-09-09 15:44:56 -04:00
Cody Rose f26b502c2e Auth GitHub in Init (#3131)
The GitHub source currently applies its authentication configuration as the first step of enumeration. This is incompatible with both targeted scans and scan job reports, and also means that authentication logic has to be duplicated into the validation flow. This PR moves it into Init so that it's available to targeted scans and, eventually, unit-specific scans. This also allows us to remove the copy of the old logic that was in Validate.

As part of the work I've also cleaned up the integration test suite. (Several of them were apparently disabled back when they ran on every push, but now that we're not doing that, we can re-enable them.)
2024-08-05 15:13:29 -04:00