mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-30 15:00:51 +02:00
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:
parent
bb6c0ab725
commit
8856577f39
1 changed files with 4 additions and 12 deletions
|
@ -12,6 +12,7 @@ import (
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
|
"github.com/pomerium/pomerium/integration/internal/flows"
|
||||||
"github.com/pomerium/pomerium/integration/internal/netutil"
|
"github.com/pomerium/pomerium/integration/internal/netutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -415,13 +416,8 @@ func TestAttestationJWT(t *testing.T) {
|
||||||
defer clearTimeout()
|
defer clearTimeout()
|
||||||
|
|
||||||
client := testcluster.NewHTTPClient()
|
client := testcluster.NewHTTPClient()
|
||||||
|
res, err := flows.Authenticate(ctx, client, mustParseURL("https://httpdetails.localhost.pomerium.io/by-user"),
|
||||||
req, err := http.NewRequestWithContext(ctx, "GET", "https://httpdetails.localhost.pomerium.io/", nil)
|
nil, flows.WithEmail("bob@dogs.test"), flows.WithGroups("user"))
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
res, err := client.Do(req)
|
|
||||||
if !assert.NoError(t, err, "unexpected http error") {
|
if !assert.NoError(t, err, "unexpected http error") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -435,9 +431,5 @@ func TestAttestationJWT(t *testing.T) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.NotEmpty(t,
|
assert.NotEmpty(t, result.Headers["X-Pomerium-Jwt-Assertion"], "Expected JWT assertion")
|
||||||
"X-Pomerium-Jwt-Assertion-Value",
|
|
||||||
result.Headers["X-Pomerium-Jwt-Assertion"],
|
|
||||||
"Expected JWT assertion")
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue