93611819e2
This is only configured in xDS when a service with an L7 protocol is exported. They also load any relevant trust bundles for the peered services to eventually use for L7 SPIFFE validation during mTLS termination.
32 lines
653 B
Go
32 lines
653 B
Go
//go:build !consulent
|
|
// +build !consulent
|
|
|
|
package connect
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestSpiffeIDMeshGatewayURI(t *testing.T) {
|
|
t.Run("default partition", func(t *testing.T) {
|
|
mgw := &SpiffeIDMeshGateway{
|
|
Host: "1234.consul",
|
|
Datacenter: "dc1",
|
|
}
|
|
|
|
require.Equal(t, "spiffe://1234.consul/gateway/mesh/dc/dc1", mgw.URI().String())
|
|
})
|
|
|
|
t.Run("partitions are ignored", func(t *testing.T) {
|
|
mgw := &SpiffeIDMeshGateway{
|
|
Host: "1234.consul",
|
|
Partition: "foobar",
|
|
Datacenter: "dc1",
|
|
}
|
|
|
|
require.Equal(t, "spiffe://1234.consul/gateway/mesh/dc/dc1", mgw.URI().String())
|
|
})
|
|
}
|