Skip to content

Commit

Permalink
Lint related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kinjelom committed Aug 26, 2024
1 parent 4ab70db commit 1932d15
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
9 changes: 5 additions & 4 deletions internal/keystore/credhub/credhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ import (
"encoding/pem"
"errors"
"fmt"
"net/http"
"os"
"strings"
"time"

"github.com/golang/groupcache/singleflight"
"github.com/google/uuid"
"github.com/minio/kes"
"github.com/minio/kes/internal/keystore"
kesdk "github.com/minio/kms-go/kes"
"net/http"
"os"
"strings"
"time"
)

const (
Expand Down
9 changes: 5 additions & 4 deletions internal/keystore/credhub/credhub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/minio/kes/internal/api"
"github.com/minio/kms-go/kes"
"io"
"net/http"
"reflect"
"testing"

"github.com/minio/kes/internal/api"
"github.com/minio/kms-go/kes"
)

/** CredHub Rest API contract tests.
Expand Down Expand Up @@ -40,7 +41,6 @@ func TestStore_MTLS(t *testing.T) {
assertNoError(t, resp.err)
fmt.Println(resp.status)
})

}

// `credhub curl -X=GET -p /health`
Expand Down Expand Up @@ -220,7 +220,6 @@ func TestStore_Get(t *testing.T) {
assertErrorIs(t, err, kes.ErrKeyNotFound)
assertAPIErrorStatus(t, err, http.StatusNotFound)
})

}

// `credhub curl -X=DELETE -p "/api/v1/data?name=/test-namespace/element-name"`
Expand Down Expand Up @@ -381,6 +380,7 @@ func assertEqualComparable(t *testing.T, expected, got any) {
t.Fatalf("expected '%v' got '%v'", expected, got)
}
}

func assertEqualBytes(t *testing.T, expected, got []byte) {
if !bytes.Equal(expected, got) {
t.Fatalf("expected '%v' got '%v'", expected, got)
Expand All @@ -395,6 +395,7 @@ func assertRequest(t *testing.T, fc *FakeHTTPClient, method, uri string) {
t.Fatalf("expected requested uri '%s' but got '%s'", uri, fc.reqURI)
}
}

func assertRequestWithJSONBody(t *testing.T, fc *FakeHTTPClient, method, uri string, jsonBody string) {
assertRequest(t, fc, method, uri)

Expand Down
1 change: 1 addition & 0 deletions internal/keystore/credhub/http_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type httpResponse struct {
func newHTTPResponseError(err error) httpResponse {
return httpResponse{statusCode: -1, status: "", body: nil, err: err}
}

func (c *httpResponse) isStatusCode2xx() bool {
return c.statusCode >= http.StatusOK && c.statusCode < http.StatusMultipleChoices
}
Expand Down

0 comments on commit 1932d15

Please sign in to comment.