Documentation ¶
Index ¶
- func AcceptancePolicy(worker, manager bool, secret string) api.AcceptancePolicy
- type TestCA
- func (tc *TestCA) NewNodeConfig(role string) (*ca.SecurityConfig, error)
- func (tc *TestCA) NewNodeConfigOrg(role, org string) (*ca.SecurityConfig, error)
- func (tc *TestCA) Stop()
- func (tc *TestCA) WriteNewNodeConfig(role string) (*ca.SecurityConfig, error)
- func (tc *TestCA) WriteNewNodeConfigOrg(role, org string) (*ca.SecurityConfig, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptancePolicy ¶
func AcceptancePolicy(worker, manager bool, secret string) api.AcceptancePolicy
AcceptancePolicy is a policy that returns a valid Acceptance policy
Types ¶
type TestCA ¶
type TestCA struct { RootCA ca.RootCA MemoryStore *store.MemoryStore TempDir, Organization string Paths *ca.SecurityConfigPaths Server grpc.Server CAServer *ca.Server Context context.Context NodeCAClients []api.NodeCAClient CAClients []api.CAClient Conns []*grpc.ClientConn Picker *picker.Picker }
TestCA is a structure that encapsulates everything needed to test a CA Server
func NewTestCA ¶
func NewTestCA(t *testing.T, policy api.AcceptancePolicy) *TestCA
NewTestCA is a helper method that creates a TestCA and a bunch of default connections and security configs
func (*TestCA) NewNodeConfig ¶
func (tc *TestCA) NewNodeConfig(role string) (*ca.SecurityConfig, error)
NewNodeConfig returns security config for a new node, given a role
func (*TestCA) NewNodeConfigOrg ¶
func (tc *TestCA) NewNodeConfigOrg(role, org string) (*ca.SecurityConfig, error)
NewNodeConfigOrg returns security config for a new node, given a role and an org
func (*TestCA) WriteNewNodeConfig ¶
func (tc *TestCA) WriteNewNodeConfig(role string) (*ca.SecurityConfig, error)
WriteNewNodeConfig returns security config for a new node, given a role saving the generated key and certificates to disk
func (*TestCA) WriteNewNodeConfigOrg ¶
func (tc *TestCA) WriteNewNodeConfigOrg(role, org string) (*ca.SecurityConfig, error)
WriteNewNodeConfigOrg returns security config for a new node, given a role and an org saving the generated key and certificates to disk