integration: fix wrong jwt assertion test (#909)

The test intends to check "X-Pomerium-Jwt-Assertion" exists in response
header and not empty, but accidently always test for non-empty string.
This commit is contained in:
Cuong Manh Le 2020-06-17 21:49:39 +07:00 committed by GitHub
parent bb6c0ab725
commit 8856577f39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,6 +12,7 @@ import (
"github.com/gorilla/websocket"
"github.com/stretchr/testify/assert"
"github.com/pomerium/pomerium/integration/internal/flows"
"github.com/pomerium/pomerium/integration/internal/netutil"
)
@ -415,13 +416,8 @@ func TestAttestationJWT(t *testing.T) {
defer clearTimeout()
client := testcluster.NewHTTPClient()
req, err := http.NewRequestWithContext(ctx, "GET", "https://httpdetails.localhost.pomerium.io/", nil)
if err != nil {
t.Fatal(err)
}
res, err := client.Do(req)
res, err := flows.Authenticate(ctx, client, mustParseURL("https://httpdetails.localhost.pomerium.io/by-user"),
nil, flows.WithEmail("bob@dogs.test"), flows.WithGroups("user"))
if !assert.NoError(t, err, "unexpected http error") {
return
}
@ -435,9 +431,5 @@ func TestAttestationJWT(t *testing.T) {
return
}
assert.NotEmpty(t,
"X-Pomerium-Jwt-Assertion-Value",
result.Headers["X-Pomerium-Jwt-Assertion"],
"Expected JWT assertion")
assert.NotEmpty(t, result.Headers["X-Pomerium-Jwt-Assertion"], "Expected JWT assertion")
}