diff --git a/authn/authenticate.go b/authn/authenticate.go index d732848b8..f4d1a8cb8 100644 --- a/authn/authenticate.go +++ b/authn/authenticate.go @@ -175,7 +175,7 @@ func (a *Auth) newCookieValue(token *oauth2.Token) (*CookieValue, error) { groups, err := a.getGroupMembership(token) if err != nil { - return nil, errors.Wrap(err, "getting group memebership") + return nil, errors.Wrap(err, "getting group membership") } // not needed at this point in the logic and makes the encoded cookie too large token.AccessToken = "" diff --git a/authn/authenticate_test.go b/authn/authenticate_internal_test.go similarity index 97% rename from authn/authenticate_test.go rename to authn/authenticate_internal_test.go index 42c8a3eb0..3710990ef 100644 --- a/authn/authenticate_test.go +++ b/authn/authenticate_internal_test.go @@ -177,14 +177,14 @@ func TestAuth(t *testing.T) { t.Errorf("expected error decoding block key got: %v", err) } }) - t.Run("NewCookieValue", func(t *testing.T) { + t.Run("NewCookieValue-BadAccessToken", func(t *testing.T) { _, err := a.newCookieValue(&tokenAT) if err == nil || !strings.Contains(err.Error(), "jwt claims") { t.Errorf("expected failure regarding jwt claims, got: %v", err) } }) - t.Run("NewCookieValue-1", func(t *testing.T) { + t.Run("CookieValue-NoAccessToken", func(t *testing.T) { _, err := a.newCookieValue(&tokenNoAT) if err == nil || !strings.Contains(err.Error(), "access token") { t.Errorf("expected failure regarding access token, got: %v", err) diff --git a/http/handler_internal_test.go b/http/handler_internal_test.go index e0d148c9e..e9cfee87a 100644 --- a/http/handler_internal_test.go +++ b/http/handler_internal_test.go @@ -184,7 +184,7 @@ func readResponse(w *httptest.ResponseRecorder) ([]byte, error) { return ioutil.ReadAll(res.Body) } -func TestAuth(t *testing.T) { +func TestHandlerAuth(t *testing.T) { type evaluate func(w *httptest.ResponseRecorder, data []byte) type endpoint func(w gohttp.ResponseWriter, r *gohttp.Request) var (