Skip to content

Commit

Permalink
remove test case that is tested in new test
Browse files Browse the repository at this point in the history
  • Loading branch information
fairclothjm committed Jun 13, 2024
1 parent a76a918 commit 6c6abbf
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions path_login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,61 +445,6 @@ func testLogin_JWT(t *testing.T, jwks bool) {
}
}

// Test missing audience
{

cfg := testConfig{
jwks: jwks,
}
b, storage := setupBackend(t, cfg)

cl := sqjwt.Claims{
Subject: "r3qXcK2bix9eFECzsU3Sbmh0K16fatW6@clients",
Issuer: "https://team-vault.auth0.com/",
NotBefore: sqjwt.NewNumericDate(time.Now().Add(-5 * time.Second)),
Audience: sqjwt.Audience{"https://vault.plugin.auth.jwt.test"},
}

privateCl := struct {
User string `json:"https://vault/user"`
Groups []string `json:"https://vault/groups"`
}{
"jeff",
[]string{"foo", "bar"},
}

jwtData, _ := getTestJWT(t, ecdsaPrivKey, cl, privateCl)

data := map[string]interface{}{
"role": "plugin-test",
"jwt": jwtData,
}

req := &logical.Request{
Operation: logical.UpdateOperation,
Path: "login",
Storage: storage,
Data: data,
Connection: &logical.Connection{
RemoteAddr: "127.0.0.1",
},
}

resp, err := b.HandleRequest(context.Background(), req)
if err != nil {
t.Fatal(err)
}
if resp == nil {
t.Fatal("got nil response")
}
if !resp.IsError() {
t.Fatal("expected error")
}
if !strings.Contains(resp.Error().Error(), "no audiences bound to the role") {
t.Fatalf("unexpected error: %v", resp.Error())
}
}

// test valid inputs
{
// run test with and without bound_cidrs configured
Expand Down

0 comments on commit 6c6abbf

Please sign in to comment.