Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: golangci-lint
on:
push:
branches:
- main
- master
pull_request:

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
args: --timeout=30m
11 changes: 8 additions & 3 deletions caller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import (
"flag"
"fmt"
"io"
"log"
"os/exec"

log "github.com/sirupsen/logrus"
)

var proxyURL = flag.String("proxy-url", "", "")
Expand All @@ -32,7 +33,9 @@ func main() {

go func() {
fmt.Println("writing to stdin")
io.WriteString(stdin, *proxyLogin)
if _, err := io.WriteString(stdin, *proxyLogin); err != nil {
log.WithError(err).Error("Failed to write to stdin")
}
closeErr = stdin.Close()
}()

Expand All @@ -51,7 +54,9 @@ func main() {
fmt.Println(scanner.Text())
}

cmd.Wait()
if err := cmd.Wait(); err != nil {
log.WithError(err).Error("failed to wait for cmd")
}

if closeErr != nil {
fmt.Printf("error when closing stdin pipe: %s\n", closeErr)
Expand Down
4 changes: 2 additions & 2 deletions http-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ func (p Proxy) BasicAuthorizationHeader() string {
return "Basic " + encodedAuth
}

func (p Proxy) HttpTransport() http.Transport {
func (p Proxy) HttpTransport() *http.Transport {
proxyURLFunc := func(r *http.Request) (*url.URL, error) {
return url.Parse(p.URL)
}
transport := http.Transport{
transport := &http.Transport{
Proxy: proxyURLFunc,
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
Expand Down
2 changes: 1 addition & 1 deletion public_root_of_trust.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func GetSigstorePublicTufTargets(usage sigtuf.UsageKind, proxy Proxy) ([]sigtuf.
}
if proxy.URL != "" {
transport := proxy.HttpTransport()
httpClient.Transport = &transport
httpClient.Transport = transport
} else {
httpClient.Transport = &http.Transport{
TLSClientConfig: &tls.Config{
Expand Down
Loading