Skip to content

Find, verify, and analyze leaked credentials

[chore] Use static token in GitHub source (#3834)

Miccahfbf835f6b275
diff --git a/pkg/sources/github/connector_token.go b/pkg/sources/github/connector_token.go
index cd6e9ba0d..88ef8f8f1 100644
--- a/pkg/sources/github/connector_token.go
+++ b/pkg/sources/github/connector_token.go
@@ -30,7 +30,7 @@ func newTokenConnector(apiEndpoint string, token string, handleRateLimit func(co
tokenSource := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token})
httpClient.Transport = &oauth2.Transport{
Base: httpClient.Transport,
- Source: oauth2.ReuseTokenSource(nil, tokenSource),
+ Source: tokenSource,
}
apiClient, err := createGitHubClient(httpClient, apiEndpoint)
diff --git a/pkg/sources/sources.go b/pkg/sources/sources.go
index b1190209c..ad53ff698 100644
--- a/pkg/sources/sources.go
+++ b/pkg/sources/sources.go
@@ -98,7 +98,7 @@ type SourceUnitEnumerator interface {
// synchronous but can be called in a goroutine to support concurrent
// enumeration and chunking. An error should only be returned from this
// method in the case of context cancellation, fatal source errors, or
- // errors returned by the reporter All other errors related to unit
+ // errors returned by the reporter. All other errors related to unit
// enumeration are tracked by the UnitReporter.
Enumerate(ctx context.Context, reporter UnitReporter) error
}
@@ -106,7 +106,7 @@ type SourceUnitEnumerator interface {
// BaseUnitReporter is a helper struct that implements the UnitReporter interface
// and includes a JobProgress reference.
type baseUnitReporter struct {
- child UnitReporter
+ child UnitReporter
progress *JobProgress
}
@@ -126,7 +126,6 @@ func (b baseUnitReporter) UnitErr(ctx context.Context, err error) error {
return nil
}
-
// UnitReporter defines the interface a source will use to report whether a
// unit was found during enumeration. Either method may be called any number of
// times. Implementors of this interface should allow for concurrent calls.