mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-12 08:37:38 +02:00
add integration test for https IP address route (#4476)
Update the integration test libsonnet templates to assign a fixed IP address to the trusted-httpdetails service. This requires also assigning a fixed IP subnet to the docker network. Configure a route with a 'to' URL using https and this fixed IP address. Add a corresponding certificate with the IP address. Finally, add a test case that makes a request to this route.
This commit is contained in:
parent
c6b7927e1c
commit
379abecab1
11 changed files with 217 additions and 115 deletions
|
@ -567,3 +567,20 @@ func rawJWTPayload(t *testing.T, jwt string) map[string]interface{} {
|
|||
require.NoError(t, err, "JWT payload could not be deserialized")
|
||||
return decoded
|
||||
}
|
||||
|
||||
func TestUpstreamViaIPAddress(t *testing.T) {
|
||||
// Verify that we can make a successful request to a route with a 'to' URL
|
||||
// that uses https with an IP address.
|
||||
client := getClient(t)
|
||||
res, err := client.Get("https://httpdetails-ip-address.localhost.pomerium.io/")
|
||||
require.NoError(t, err, "unexpected http error")
|
||||
defer res.Body.Close()
|
||||
|
||||
var result struct {
|
||||
Headers map[string]string `json:"headers"`
|
||||
Protocol string `json:"protocol"`
|
||||
}
|
||||
err = json.NewDecoder(res.Body).Decode(&result)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "https", result.Protocol)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue