mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
clean up
This commit is contained in:
parent
9612096682
commit
b8b4425d4f
3 changed files with 4 additions and 4 deletions
|
|
@ -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 = ""
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -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 (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue