Skip to content

Commit

Permalink
[chore] Use static token in GitHub source (#3834)
Browse files Browse the repository at this point in the history
Also some minor formatting in sources.go
  • Loading branch information
mcastorina authored Jan 9, 2025
1 parent a94d152 commit fbf835f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/sources/github/connector_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions pkg/sources/sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ 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
}

// BaseUnitReporter is a helper struct that implements the UnitReporter interface
// and includes a JobProgress reference.
type baseUnitReporter struct {
child UnitReporter
child UnitReporter
progress *JobProgress
}

Expand All @@ -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.
Expand Down

0 comments on commit fbf835f

Please sign in to comment.