github.com/Iqoqo/consul@v1.4.5/agent/connect/testing_spiffe.go (about)

     1  package connect
     2  
     3  import (
     4  	"github.com/mitchellh/go-testing-interface"
     5  )
     6  
     7  // TestSpiffeIDService returns a SPIFFE ID representing a service.
     8  func TestSpiffeIDService(t testing.T, service string) *SpiffeIDService {
     9  	return TestSpiffeIDServiceWithHost(t, service, TestClusterID+".consul")
    10  }
    11  
    12  // TestSpiffeIDServiceWithHost returns a SPIFFE ID representing a service with
    13  // the specified trust domain.
    14  func TestSpiffeIDServiceWithHost(t testing.T, service, host string) *SpiffeIDService {
    15  	return &SpiffeIDService{
    16  		Host:       host,
    17  		Namespace:  "default",
    18  		Datacenter: "dc1",
    19  		Service:    service,
    20  	}
    21  }