Skip to content

Commit

Permalink
Re-enable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
buger committed Jun 4, 2018
1 parent d3dcb35 commit f58c4e3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mw_basic_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ func TestBasicAuth(t *testing.T) {
session := testPrepareBasicAuth()

validPassword := map[string]string{"Authorization": genAuthHeader("user", "password")}
// wrongPassword := map[string]string{"Authorization": genAuthHeader("user", "wrong")}
// wrongFormat := map[string]string{"Authorization": genAuthHeader("user", "password:more")}
// malformed := map[string]string{"Authorization": "not base64"}
wrongPassword := map[string]string{"Authorization": genAuthHeader("user", "wrong")}
wrongFormat := map[string]string{"Authorization": genAuthHeader("user", "password:more")}
malformed := map[string]string{"Authorization": "not base64"}

ts.Run(t, []test.TestCase{
// Create base auth based key
{Method: "POST", Path: "/tyk/keys/defaultuser", Data: session, AdminAuth: true, Code: 200},
// {Method: "GET", Path: "/", Code: 401, BodyMatch: `Authorization field missing`},
{Method: "GET", Path: "/", Code: 401, BodyMatch: `Authorization field missing`},
{Method: "GET", Path: "/", Headers: validPassword, Code: 200},
// {Method: "GET", Path: "/", Headers: wrongPassword, Code: 401},
// {Method: "GET", Path: "/", Headers: wrongFormat, Code: 400, BodyMatch: `Attempted access with malformed header, values not in basic auth format`},
// {Method: "GET", Path: "/", Headers: malformed, Code: 400, BodyMatch: `Attempted access with malformed header, auth data not encoded correctly`},
{Method: "GET", Path: "/", Headers: wrongPassword, Code: 401},
{Method: "GET", Path: "/", Headers: wrongFormat, Code: 400, BodyMatch: `Attempted access with malformed header, values not in basic auth format`},
{Method: "GET", Path: "/", Headers: malformed, Code: 400, BodyMatch: `Attempted access with malformed header, auth data not encoded correctly`},
}...)
}

Expand Down

0 comments on commit f58c4e3

Please sign in to comment.