Skip to content

Commit 5f09863

Browse files
committed
lint fixes and dependencies update
1 parent 6cfe621 commit 5f09863

8 files changed

Lines changed: 71 additions & 1547 deletions

File tree

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
golangci:
1111
strategy:
1212
matrix:
13-
go-version: [ 1.17.x ]
13+
go-version: [ 1.18.x ]
1414
name: lint
1515
runs-on: ubuntu-latest
1616
steps:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Go
2020
uses: actions/setup-go@v2
2121
with:
22-
go-version: 1.17
22+
go-version: 1.18
2323
- name: Run GoReleaser
2424
uses: goreleaser/goreleaser-action@v2
2525
with:

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
test:
1010
strategy:
1111
matrix:
12-
go-version: [ 1.17.x ]
12+
go-version: [ 1.18.x ]
1313
os: [ubuntu-latest]
1414
runs-on: ${{ matrix.os }}
1515
timeout-minutes: 10
@@ -26,7 +26,7 @@ jobs:
2626

2727
- name: Setup test execution
2828
run: |
29-
go get -u gotest.tools/gotestsum
29+
go install gotest.tools/gotestsum@latest
3030
go mod tidy
3131
3232
- name: Test

go.mod

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
11
module github.com/upvestco/httpsignature-proxy
22

3-
go 1.17
3+
go 1.18
44

55
require (
66
github.com/google/uuid v1.3.0
77
github.com/gorilla/mux v1.8.0
88
github.com/magiconair/properties v1.8.6 // indirect
99
github.com/mitchellh/go-homedir v1.1.0
10-
github.com/ory/x v0.0.291
10+
github.com/ory/x v0.0.455
1111
github.com/pkg/errors v0.9.1
12-
github.com/spf13/afero v1.8.1 // indirect
13-
github.com/spf13/cobra v1.4.0
12+
github.com/spf13/afero v1.9.2 // indirect
13+
github.com/spf13/cobra v1.5.0
1414
github.com/spf13/pflag v1.0.5
15-
github.com/spf13/viper v1.10.1
16-
github.com/stretchr/testify v1.7.0
17-
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa
18-
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 // indirect
15+
github.com/spf13/viper v1.12.0
16+
github.com/stretchr/testify v1.8.0
17+
golang.org/x/crypto v0.0.0-20220824171710-5757bc0c5503
18+
golang.org/x/sys v0.0.0-20220823224334-20c2bfdbfe24 // indirect
1919
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
20-
gopkg.in/ini.v1 v1.66.4 // indirect
20+
gopkg.in/ini.v1 v1.67.0 // indirect
2121
)
2222

2323
require (
2424
github.com/davecgh/go-spew v1.1.1 // indirect
25-
github.com/fsnotify/fsnotify v1.5.1 // indirect
25+
github.com/fsnotify/fsnotify v1.5.4 // indirect
2626
github.com/hashicorp/hcl v1.0.0 // indirect
27-
github.com/inconshreveable/mousetrap v1.0.0 // indirect
28-
github.com/mitchellh/mapstructure v1.4.3 // indirect
29-
github.com/pelletier/go-toml v1.9.4 // indirect
27+
github.com/inconshreveable/mousetrap v1.0.1 // indirect
28+
github.com/mitchellh/mapstructure v1.5.0 // indirect
29+
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
30+
github.com/pelletier/go-toml v1.9.5 // indirect
31+
github.com/pelletier/go-toml/v2 v2.0.3 // indirect
3032
github.com/pmezard/go-difflib v1.0.0 // indirect
31-
github.com/spf13/cast v1.4.1 // indirect
33+
github.com/spf13/cast v1.5.0 // indirect
3234
github.com/spf13/jwalterweatherman v1.1.0 // indirect
33-
github.com/subosito/gotenv v1.2.0 // indirect
35+
github.com/subosito/gotenv v1.4.1 // indirect
3436
golang.org/x/text v0.3.7 // indirect
3537
gopkg.in/yaml.v2 v2.4.0 // indirect
36-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
38+
gopkg.in/yaml.v3 v3.0.1 // indirect
3739
)

go.sum

Lines changed: 40 additions & 1517 deletions
Large diffs are not rendered by default.

service/runtime/handler.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"encoding/json"
2323
"fmt"
2424
"io"
25-
"io/ioutil"
2625
"net/http"
2726
"net/url"
2827
"strings"
@@ -213,7 +212,7 @@ func (h *Handler) ServeHTTP(rw http.ResponseWriter, inReq *http.Request) {
213212
toUrl.RawQuery = inReq.URL.RawQuery
214213
h.log.LogF(" - To url '%s'\n", toUrl.String())
215214

216-
body, err := ioutil.ReadAll(inReq.Body)
215+
body, err := io.ReadAll(inReq.Body)
217216
if err != nil {
218217
h.writeError(rw, http.StatusInternalServerError, err)
219218
return
@@ -240,7 +239,7 @@ func (h *Handler) ServeHTTP(rw http.ResponseWriter, inReq *http.Request) {
240239
}
241240
defer resp.Body.Close()
242241

243-
data, err := ioutil.ReadAll(resp.Body)
242+
data, err := io.ReadAll(resp.Body)
244243
if err != nil {
245244
h.writeError(rw, http.StatusInternalServerError, err)
246245
return

service/runtime/runtime_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"bytes"
2121
"context"
2222
"fmt"
23-
"io/ioutil"
23+
"io"
2424
"log"
2525
"net/http"
2626
"testing"
@@ -121,7 +121,7 @@ func (s *TestRuntimeSuite) Test_RuntimeRun() {
121121
require.NoError(s.T(), err)
122122
defer resp.Body.Close()
123123
assert.Exactly(s.T(), http.StatusOK, resp.StatusCode)
124-
respBody, err := ioutil.ReadAll(resp.Body)
124+
respBody, err := io.ReadAll(resp.Body)
125125
require.NoError(s.T(), err)
126126
require.Equal(s.T(), pl, respBody)
127127
}
@@ -157,7 +157,7 @@ func (s *testService) Start(t *testing.T) {
157157

158158
func (s *testService) endpoint(w http.ResponseWriter, r *http.Request) {
159159
defer r.Body.Close()
160-
body, err := ioutil.ReadAll(r.Body)
160+
body, err := io.ReadAll(r.Body)
161161
if err != nil {
162162
w.WriteHeader(http.StatusInternalServerError)
163163
return
@@ -171,7 +171,7 @@ type handler struct {
171171
}
172172

173173
func (e *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
174-
body, err := ioutil.ReadAll(r.Body)
174+
body, err := io.ReadAll(r.Body)
175175
require.NoError(e.t, err)
176176
require.True(e.t, len(body) != 0)
177177
defer r.Body.Close()
@@ -182,6 +182,6 @@ func (e *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
182182
if val, ok := headers[material.SignatureInputHeader]; !ok || val == nil {
183183
e.t.Error("request doesn't have signature input header")
184184
}
185-
r.Body = ioutil.NopCloser(bytes.NewReader(body))
185+
r.Body = io.NopCloser(bytes.NewReader(body))
186186
e.router.ServeHTTP(w, r)
187187
}

service/signer/local-scheme-builder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"crypto/ecdsa"
2121
"encoding/pem"
2222
"fmt"
23-
"io/ioutil"
23+
"os"
2424

2525
"github.com/pkg/errors"
2626
"golang.org/x/crypto/ssh"
@@ -30,7 +30,7 @@ import (
3030
)
3131

3232
func NewLocalPrivateSchemeBuilder(cfg *config.BaseConfig) (*LocalPrivateSchemeBuilder, error) {
33-
body, err := ioutil.ReadFile(cfg.PrivateKeyFileName)
33+
body, err := os.ReadFile(cfg.PrivateKeyFileName)
3434
if err != nil {
3535
return nil, err
3636
}

0 commit comments

Comments
 (0)