Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Oct 29, 2024
1 parent 9410191 commit e239480
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
8 changes: 0 additions & 8 deletions compiler/registry/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,6 @@ func (c *client) newOAuthTokenClient(ctx context.Context, token string) *github.

// create the OAuth client
tc := oauth2.NewClient(ctx, ts)
// if c.SkipVerify {
// tc.Transport.(*oauth2.Transport).Base = &http.Transport{
// Proxy: http.ProxyFromEnvironment,
// TLSClientConfig: &tls.Config{
// InsecureSkipVerify: true,
// },
// }
// }

// create the GitHub client from the OAuth client
github := github.NewClient(tc)
Expand Down
4 changes: 2 additions & 2 deletions mock/server/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const (
"private": false,
"trusted": true,
"active": true,
"install_id": 0
"install_id": 0
},
{
"id": 2,
Expand All @@ -97,7 +97,7 @@ const (
"private": false,
"trusted": true,
"active": true,
"install_id": 0
"install_id": 0
}
]`
)
Expand Down
8 changes: 0 additions & 8 deletions scm/github/app_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ func (c *client) newOAuthTokenClient(ctx context.Context, token string) *github.

// create the OAuth client
tc := oauth2.NewClient(ctx, ts)
// if c.SkipVerify {
// tc.Transport.(*oauth2.Transport).Base = &http.Transport{
// Proxy: http.ProxyFromEnvironment,
// TLSClientConfig: &tls.Config{
// InsecureSkipVerify: true,
// },
// }
// }

if c.Tracing.Config.EnableTracing {
tc.Transport = otelhttp.NewTransport(
Expand Down
4 changes: 2 additions & 2 deletions scm/github/app_transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func (c *client) newAppsTransportFromPrivateKey(tr http.RoundTripper, appID int6
// RoundTrip implements http.RoundTripper interface.
func (t *AppsTransport) RoundTrip(req *http.Request) (*http.Response, error) {
// GitHub rejects expiry and issue timestamps that are not an integer,
// while the jwt-go library serializes to fractional timestamps.
// Truncate them before passing to jwt-go.
// while the jwt-go library serializes to fractional timestamps
// then truncate them before passing to jwt-go.
iss := time.Now().Add(-30 * time.Second).Truncate(time.Second)
exp := iss.Add(2 * time.Minute)
claims := &jwt.RegisteredClaims{
Expand Down

0 comments on commit e239480

Please sign in to comment.