Skip to content

Commit d9bdb9f

Browse files
authored
Merge pull request #13 from slr71/main
updated dependencies and fixed some lint warnings
2 parents 85c90c0 + b41c7f9 commit d9bdb9f

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
module github.com/cyverse-de/vice-proxy
22

3-
go 1.24
3+
go 1.24.0
44

55
require (
66
github.com/google/uuid v1.6.0
77
github.com/gorilla/mux v1.8.1
88
github.com/gorilla/sessions v1.4.0
9-
github.com/lestrrat-go/jwx v1.2.30
9+
github.com/lestrrat-go/jwx v1.2.31
1010
github.com/pkg/errors v0.9.1
1111
github.com/rs/cors v1.11.1
1212
github.com/sirupsen/logrus v1.9.3
13-
github.com/stretchr/testify v1.9.0
13+
github.com/stretchr/testify v1.10.0
1414
)
1515

1616
require (
@@ -19,12 +19,12 @@ require (
1919
github.com/goccy/go-json v0.10.5 // indirect
2020
github.com/gorilla/securecookie v1.1.2 // indirect
2121
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
22-
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
22+
github.com/lestrrat-go/blackmagic v1.0.4 // indirect
2323
github.com/lestrrat-go/httpcc v1.0.1 // indirect
2424
github.com/lestrrat-go/iter v1.0.2 // indirect
2525
github.com/lestrrat-go/option v1.0.1 // indirect
2626
github.com/pmezard/go-difflib v1.0.0 // indirect
27-
golang.org/x/crypto v0.35.0 // indirect
28-
golang.org/x/sys v0.30.0 // indirect
27+
golang.org/x/crypto v0.46.0 // indirect
28+
golang.org/x/sys v0.39.0 // indirect
2929
gopkg.in/yaml.v3 v3.0.1 // indirect
3030
)

go.sum

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ github.com/gorilla/sessions v1.4.0 h1:kpIYOp/oi6MG/p5PgxApU8srsSw9tuFbt46Lt7auzq
1717
github.com/gorilla/sessions v1.4.0/go.mod h1:FLWm50oby91+hl7p/wRxDth9bWSuk0qVL2emc7lT5ik=
1818
github.com/lestrrat-go/backoff/v2 v2.0.8 h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf2E2un5A=
1919
github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y=
20-
github.com/lestrrat-go/blackmagic v1.0.2 h1:Cg2gVSc9h7sz9NOByczrbUvLopQmXrfFx//N+AkAr5k=
21-
github.com/lestrrat-go/blackmagic v1.0.2/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU=
20+
github.com/lestrrat-go/blackmagic v1.0.4 h1:IwQibdnf8l2KoO+qC3uT4OaTWsW7tuRQXy9TRN9QanA=
21+
github.com/lestrrat-go/blackmagic v1.0.4/go.mod h1:6AWFyKNNj0zEXQYfTMPfZrAXUWUfTIZ5ECEUEJaijtw=
2222
github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE=
2323
github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E=
2424
github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI=
2525
github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4=
26-
github.com/lestrrat-go/jwx v1.2.30 h1:VKIFrmjYn0z2J51iLPadqoHIVLzvWNa1kCsTqNDHYPA=
27-
github.com/lestrrat-go/jwx v1.2.30/go.mod h1:vMxrwFhunGZ3qddmfmEm2+uced8MSI6QFWGTKygjSzQ=
26+
github.com/lestrrat-go/jwx v1.2.31 h1:/OM9oNl/fzyldpv5HKZ9m7bTywa7COUfg8gujd9nJ54=
27+
github.com/lestrrat-go/jwx v1.2.31/go.mod h1:eQJKoRwWcLg4PfD5CFA5gIZGxhPgoPYq9pZISdxLf0c=
2828
github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
2929
github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU=
3030
github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
@@ -40,13 +40,13 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
4040
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
4141
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
4242
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
43-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
44-
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
45-
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
46-
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
43+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
44+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
45+
golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
46+
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
4747
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
48-
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
49-
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
48+
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
49+
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
5050
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
5151
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
5252
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (c *VICEProxy) getResourceName(externalID string) (string, error) {
8383
if err != nil {
8484
return "", err
8585
}
86-
defer resp.Body.Close()
86+
defer func() { _ = resp.Body.Close() }()
8787
//log.Debugf("end of resource name lookup for %s at %s", externalID, c.getAnalysisIDBase)
8888

8989
analysis := &Analysis{}
@@ -164,7 +164,7 @@ func (c *VICEProxy) IsAllowed(user, resource string) (bool, error) {
164164
if err != nil {
165165
return false, err
166166
}
167-
defer resp.Body.Close()
167+
defer func() { _ = resp.Body.Close() }()
168168
//log.Debugf("end of permissions lookup for user %s on resource %s at %s", user, resource, c.checkResourceAccessBase)
169169

170170
b, err := io.ReadAll(resp.Body)
@@ -227,7 +227,7 @@ func (c *VICEProxy) FetchKeycloakCerts() (jwk.Set, error) {
227227
if err != nil {
228228
return nil, err
229229
}
230-
defer resp.Body.Close()
230+
defer func() { _ = resp.Body.Close() }()
231231

232232
body, err := io.ReadAll(resp.Body)
233233
if err != nil {
@@ -337,7 +337,7 @@ func (c *VICEProxy) HandleAuthorizationCode(w http.ResponseWriter, r *http.Reque
337337
http.Error(w, err.Error(), http.StatusInternalServerError)
338338
return
339339
}
340-
defer resp.Body.Close()
340+
defer func() { _ = resp.Body.Close() }()
341341

342342
// Extract the token from the response.
343343
log.Debug("reading the response from Keycloak")
@@ -564,7 +564,7 @@ func (c *VICEProxy) URLIsReady(w http.ResponseWriter, r *http.Request) {
564564
}
565565

566566
if ready {
567-
fmt.Fprint(w, string(body))
567+
_, _ = fmt.Fprint(w, string(body))
568568
} else {
569569
http.Error(w, string(body), http.StatusNotAcceptable)
570570
}

main_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func getVICEProxy() *VICEProxy {
1616
// Create a session store for testing
1717
authkey := make([]byte, 64)
18-
rand.Read(authkey)
18+
_, _ = rand.Read(authkey)
1919
sessionStore := sessions.NewCookieStore(authkey)
2020

2121
return &VICEProxy{
@@ -85,7 +85,7 @@ func TestProxyWithAuthDisabled(t *testing.T) {
8585
backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
8686
backendCalled = true
8787
w.WriteHeader(http.StatusOK)
88-
w.Write([]byte("backend response"))
88+
_, _ = w.Write([]byte("backend response"))
8989
}))
9090
defer backend.Close()
9191

@@ -118,7 +118,7 @@ func TestProxyWithAuthEnabled(t *testing.T) {
118118
backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
119119
backendCalled = true
120120
w.WriteHeader(http.StatusOK)
121-
w.Write([]byte("backend response"))
121+
_, _ = w.Write([]byte("backend response"))
122122
}))
123123
defer backend.Close()
124124

0 commit comments

Comments
 (0)