Skip to content

Commit

Permalink
Merge pull request #136 from krakend/deepsource_suggested_improvements
Browse files Browse the repository at this point in the history
Deepsource suggested improvements
  • Loading branch information
kpacha authored Sep 13, 2024
2 parents daeaa6c + 8efd1a0 commit bff5338
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.22
go-version: "1.23"

- name: Test
run: make test
10 changes: 8 additions & 2 deletions jwk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ func TestJWK(t *testing.T) {
},
} {
server := httptest.NewUnstartedServer(jwkEndpoint(tc.Name))
server.TLS = &tls.Config{Certificates: []tls.Certificate{cert}}
server.TLS = &tls.Config{
Certificates: []tls.Certificate{cert},
MinVersion: tls.VersionTLS13,
}
server.StartTLS()

secretProvidr, err := SecretProvider(SecretProviderConfig{URI: server.URL, LocalCA: "cert.pem"}, nil)
Expand Down Expand Up @@ -228,7 +231,10 @@ func TestJWK_cache(t *testing.T) {
} {
var hits uint32
server := httptest.NewUnstartedServer(jwkEndpointWithCounter(tc.Name, &hits))
server.TLS = &tls.Config{Certificates: []tls.Certificate{cert}}
server.TLS = &tls.Config{
Certificates: []tls.Certificate{cert},
MinVersion: tls.VersionTLS13,
}
server.StartTLS()

cfg := SecretProviderConfig{
Expand Down
4 changes: 2 additions & 2 deletions secrets/cypher.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"crypto/aes"
"crypto/cipher"
"crypto/md5"
"crypto/md5" // skipcq: GSC-G501
"crypto/rand"
"encoding/hex"
"io"
Expand Down Expand Up @@ -73,7 +73,7 @@ func (c *Cypher) Close() {
}

func createHash(key []byte) string {
hasher := md5.New()
hasher := md5.New() // skipcq: GO-S1023, GSC-G401
hasher.Write(key)
return hex.EncodeToString(hasher.Sum(nil))
}
Expand Down

0 comments on commit bff5338

Please sign in to comment.