From 3dc47a9251def221d7385c6c868e74c2906de7c1 Mon Sep 17 00:00:00 2001 From: tradel Date: Tue, 27 Aug 2019 14:09:01 -0700 Subject: [PATCH] Added DC and domain args to Configure method --- agent/connect/ca/mock_Provider.go | 10 +- agent/connect/ca/plugin/plugin_test.go | 24 +- agent/connect/ca/plugin/provider.pb.go | 437 ++++++++++++++------ agent/connect/ca/plugin/provider.proto | 6 +- agent/connect/ca/plugin/transport_grpc.go | 12 +- agent/connect/ca/plugin/transport_netrpc.go | 20 +- agent/connect/ca/provider.go | 3 +- 7 files changed, 356 insertions(+), 156 deletions(-) diff --git a/agent/connect/ca/mock_Provider.go b/agent/connect/ca/mock_Provider.go index e8b9e5892..cc579c61f 100644 --- a/agent/connect/ca/mock_Provider.go +++ b/agent/connect/ca/mock_Provider.go @@ -66,13 +66,13 @@ func (_m *MockProvider) Cleanup() error { return r0 } -// Configure provides a mock function with given fields: clusterId, isRoot, rawConfig -func (_m *MockProvider) Configure(clusterId string, isRoot bool, rawConfig map[string]interface{}) error { - ret := _m.Called(clusterId, isRoot, rawConfig) +// Configure provides a mock function with given fields: clusterID, datacenterName, dnsDomain, isRoot, rawConfig +func (_m *MockProvider) Configure(clusterId string, datacenterName string, dnsDomain string, isRoot bool, rawConfig map[string]interface{}) error { + ret := _m.Called(clusterId, datacenterName, dnsDomain, isRoot, rawConfig) var r0 error - if rf, ok := ret.Get(0).(func(string, bool, map[string]interface{}) error); ok { - r0 = rf(clusterId, isRoot, rawConfig) + if rf, ok := ret.Get(0).(func(string, string, string, bool, map[string]interface{}) error); ok { + r0 = rf(clusterId, datacenterName, dnsDomain, isRoot, rawConfig) } else { r0 = ret.Error(0) } diff --git a/agent/connect/ca/plugin/plugin_test.go b/agent/connect/ca/plugin/plugin_test.go index f4c100c28..90d9c6b51 100644 --- a/agent/connect/ca/plugin/plugin_test.go +++ b/agent/connect/ca/plugin/plugin_test.go @@ -18,11 +18,11 @@ func TestProvider_Configure(t *testing.T) { require := require.New(t) // Basic configure - m.On("Configure", "foo", false, map[string]interface{}{ + m.On("Configure", "foo", "foo", "consul", false, map[string]interface{}{ "string": "bar", "number": float64(42), // because json }).Once().Return(nil) - require.NoError(p.Configure("foo", false, map[string]interface{}{ + require.NoError(p.Configure("foo", "foo", "consul", false, map[string]interface{}{ "string": "bar", "number": float64(42), })) @@ -30,8 +30,8 @@ func TestProvider_Configure(t *testing.T) { // Try with an error m.Mock = mock.Mock{} - m.On("Configure", "foo", false, map[string]interface{}{}).Once().Return(errors.New("hello world")) - err := p.Configure("foo", false, map[string]interface{}{}) + m.On("Configure", "foo", "foo", "consul", false, map[string]interface{}{}).Once().Return(errors.New("hello world")) + err := p.Configure("foo", "foo", "consul", false, map[string]interface{}{}) require.Error(err) require.Contains(err.Error(), "hello") m.AssertExpectations(t) @@ -42,7 +42,7 @@ func TestProvider_GenerateRoot(t *testing.T) { testPlugin(t, func(t *testing.T, m *ca.MockProvider, p ca.Provider) { require := require.New(t) - // Try cleanup with no error + // Try with no error m.On("GenerateRoot").Once().Return(nil) require.NoError(p.GenerateRoot()) m.AssertExpectations(t) @@ -61,7 +61,7 @@ func TestProvider_ActiveRoot(t *testing.T) { testPlugin(t, func(t *testing.T, m *ca.MockProvider, p ca.Provider) { require := require.New(t) - // Try cleanup with no error + // Try with no error m.On("ActiveRoot").Once().Return("foo", nil) actual, err := p.ActiveRoot() require.NoError(err) @@ -82,7 +82,7 @@ func TestProvider_GenerateIntermediateCSR(t *testing.T) { testPlugin(t, func(t *testing.T, m *ca.MockProvider, p ca.Provider) { require := require.New(t) - // Try cleanup with no error + // Try with no error m.On("GenerateIntermediateCSR").Once().Return("foo", nil) actual, err := p.GenerateIntermediateCSR() require.NoError(err) @@ -103,7 +103,7 @@ func TestProvider_SetIntermediate(t *testing.T) { testPlugin(t, func(t *testing.T, m *ca.MockProvider, p ca.Provider) { require := require.New(t) - // Try cleanup with no error + // Try with no error m.On("SetIntermediate", "foo", "bar").Once().Return(nil) err := p.SetIntermediate("foo", "bar") require.NoError(err) @@ -123,7 +123,7 @@ func TestProvider_ActiveIntermediate(t *testing.T) { testPlugin(t, func(t *testing.T, m *ca.MockProvider, p ca.Provider) { require := require.New(t) - // Try cleanup with no error + // Try with no error m.On("ActiveIntermediate").Once().Return("foo", nil) actual, err := p.ActiveIntermediate() require.NoError(err) @@ -144,7 +144,7 @@ func TestProvider_GenerateIntermediate(t *testing.T) { testPlugin(t, func(t *testing.T, m *ca.MockProvider, p ca.Provider) { require := require.New(t) - // Try cleanup with no error + // Try with no error m.On("GenerateIntermediate").Once().Return("foo", nil) actual, err := p.GenerateIntermediate() require.NoError(err) @@ -166,7 +166,7 @@ func TestProvider_Sign(t *testing.T) { require := require.New(t) // Create a CSR - csrPEM, _ := connect.TestCSR(t, connect.TestSpiffeIDService(t, "web")) + csrPEM, _ := connect.TestCSR(t, connect.TestSpiffeIDService(t, "web"), "node1.web.service.dc1.consul.") block, _ := pem.Decode([]byte(csrPEM)) csr, err := x509.ParseCertificateRequest(block.Bytes) require.NoError(err) @@ -197,7 +197,7 @@ func TestProvider_SignIntermediate(t *testing.T) { require := require.New(t) // Create a CSR - csrPEM, _ := connect.TestCSR(t, connect.TestSpiffeIDService(t, "web")) + csrPEM, _ := connect.TestCSR(t, connect.TestSpiffeIDService(t, "web"), "node1.web.service.dc1.consul.") block, _ := pem.Decode([]byte(csrPEM)) csr, err := x509.ParseCertificateRequest(block.Bytes) require.NoError(err) diff --git a/agent/connect/ca/plugin/provider.pb.go b/agent/connect/ca/plugin/provider.pb.go index 8c15dcdc0..6c02983a0 100644 --- a/agent/connect/ca/plugin/provider.pb.go +++ b/agent/connect/ca/plugin/provider.pb.go @@ -1,19 +1,17 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: agent/connect/ca/plugin/provider.proto -package plugin // import "github.com/hashicorp/consul/agent/connect/ca/plugin" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +package plugin import ( - context "golang.org/x/net/context" + context "context" + fmt "fmt" + proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" + io "io" + math "math" ) -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -27,8 +25,10 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type ConfigureRequest struct { ClusterId string `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - IsRoot bool `protobuf:"varint,2,opt,name=is_root,json=isRoot,proto3" json:"is_root,omitempty"` - Config []byte `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"` + DatacenterName string `protobuf:"bytes,2,opt,name=datacenter_name,json=datacenterName,proto3" json:"datacenter_name,omitempty"` + DnsDomain string `protobuf:"bytes,3,opt,name=dns_domain,json=dnsDomain,proto3" json:"dns_domain,omitempty"` + IsRoot bool `protobuf:"varint,4,opt,name=is_root,json=isRoot,proto3" json:"is_root,omitempty"` + Config []byte `protobuf:"bytes,5,opt,name=config,proto3" json:"config,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -38,7 +38,7 @@ func (m *ConfigureRequest) Reset() { *m = ConfigureRequest{} } func (m *ConfigureRequest) String() string { return proto.CompactTextString(m) } func (*ConfigureRequest) ProtoMessage() {} func (*ConfigureRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_provider_8ff2d2670790989c, []int{0} + return fileDescriptor_94daeb7181770839, []int{0} } func (m *ConfigureRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -55,8 +55,8 @@ func (m *ConfigureRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (dst *ConfigureRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigureRequest.Merge(dst, src) +func (m *ConfigureRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigureRequest.Merge(m, src) } func (m *ConfigureRequest) XXX_Size() int { return m.Size() @@ -74,6 +74,20 @@ func (m *ConfigureRequest) GetClusterId() string { return "" } +func (m *ConfigureRequest) GetDatacenterName() string { + if m != nil { + return m.DatacenterName + } + return "" +} + +func (m *ConfigureRequest) GetDnsDomain() string { + if m != nil { + return m.DnsDomain + } + return "" +} + func (m *ConfigureRequest) GetIsRoot() bool { if m != nil { return m.IsRoot @@ -100,7 +114,7 @@ func (m *SetIntermediateRequest) Reset() { *m = SetIntermediateRequest{} func (m *SetIntermediateRequest) String() string { return proto.CompactTextString(m) } func (*SetIntermediateRequest) ProtoMessage() {} func (*SetIntermediateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_provider_8ff2d2670790989c, []int{1} + return fileDescriptor_94daeb7181770839, []int{1} } func (m *SetIntermediateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -117,8 +131,8 @@ func (m *SetIntermediateRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (dst *SetIntermediateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetIntermediateRequest.Merge(dst, src) +func (m *SetIntermediateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetIntermediateRequest.Merge(m, src) } func (m *SetIntermediateRequest) XXX_Size() int { return m.Size() @@ -154,7 +168,7 @@ func (m *SignRequest) Reset() { *m = SignRequest{} } func (m *SignRequest) String() string { return proto.CompactTextString(m) } func (*SignRequest) ProtoMessage() {} func (*SignRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_provider_8ff2d2670790989c, []int{2} + return fileDescriptor_94daeb7181770839, []int{2} } func (m *SignRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -171,8 +185,8 @@ func (m *SignRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (dst *SignRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignRequest.Merge(dst, src) +func (m *SignRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignRequest.Merge(m, src) } func (m *SignRequest) XXX_Size() int { return m.Size() @@ -201,7 +215,7 @@ func (m *SignIntermediateRequest) Reset() { *m = SignIntermediateRequest func (m *SignIntermediateRequest) String() string { return proto.CompactTextString(m) } func (*SignIntermediateRequest) ProtoMessage() {} func (*SignIntermediateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_provider_8ff2d2670790989c, []int{3} + return fileDescriptor_94daeb7181770839, []int{3} } func (m *SignIntermediateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -218,8 +232,8 @@ func (m *SignIntermediateRequest) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (dst *SignIntermediateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignIntermediateRequest.Merge(dst, src) +func (m *SignIntermediateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignIntermediateRequest.Merge(m, src) } func (m *SignIntermediateRequest) XXX_Size() int { return m.Size() @@ -248,7 +262,7 @@ func (m *CrossSignCARequest) Reset() { *m = CrossSignCARequest{} } func (m *CrossSignCARequest) String() string { return proto.CompactTextString(m) } func (*CrossSignCARequest) ProtoMessage() {} func (*CrossSignCARequest) Descriptor() ([]byte, []int) { - return fileDescriptor_provider_8ff2d2670790989c, []int{4} + return fileDescriptor_94daeb7181770839, []int{4} } func (m *CrossSignCARequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -265,8 +279,8 @@ func (m *CrossSignCARequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *CrossSignCARequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CrossSignCARequest.Merge(dst, src) +func (m *CrossSignCARequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CrossSignCARequest.Merge(m, src) } func (m *CrossSignCARequest) XXX_Size() int { return m.Size() @@ -295,7 +309,7 @@ func (m *ActiveRootResponse) Reset() { *m = ActiveRootResponse{} } func (m *ActiveRootResponse) String() string { return proto.CompactTextString(m) } func (*ActiveRootResponse) ProtoMessage() {} func (*ActiveRootResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_provider_8ff2d2670790989c, []int{5} + return fileDescriptor_94daeb7181770839, []int{5} } func (m *ActiveRootResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -312,8 +326,8 @@ func (m *ActiveRootResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *ActiveRootResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActiveRootResponse.Merge(dst, src) +func (m *ActiveRootResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ActiveRootResponse.Merge(m, src) } func (m *ActiveRootResponse) XXX_Size() int { return m.Size() @@ -342,7 +356,7 @@ func (m *GenerateIntermediateCSRResponse) Reset() { *m = GenerateInterme func (m *GenerateIntermediateCSRResponse) String() string { return proto.CompactTextString(m) } func (*GenerateIntermediateCSRResponse) ProtoMessage() {} func (*GenerateIntermediateCSRResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_provider_8ff2d2670790989c, []int{6} + return fileDescriptor_94daeb7181770839, []int{6} } func (m *GenerateIntermediateCSRResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -359,8 +373,8 @@ func (m *GenerateIntermediateCSRResponse) XXX_Marshal(b []byte, deterministic bo return b[:n], nil } } -func (dst *GenerateIntermediateCSRResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenerateIntermediateCSRResponse.Merge(dst, src) +func (m *GenerateIntermediateCSRResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenerateIntermediateCSRResponse.Merge(m, src) } func (m *GenerateIntermediateCSRResponse) XXX_Size() int { return m.Size() @@ -389,7 +403,7 @@ func (m *ActiveIntermediateResponse) Reset() { *m = ActiveIntermediateRe func (m *ActiveIntermediateResponse) String() string { return proto.CompactTextString(m) } func (*ActiveIntermediateResponse) ProtoMessage() {} func (*ActiveIntermediateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_provider_8ff2d2670790989c, []int{7} + return fileDescriptor_94daeb7181770839, []int{7} } func (m *ActiveIntermediateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -406,8 +420,8 @@ func (m *ActiveIntermediateResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (dst *ActiveIntermediateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ActiveIntermediateResponse.Merge(dst, src) +func (m *ActiveIntermediateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ActiveIntermediateResponse.Merge(m, src) } func (m *ActiveIntermediateResponse) XXX_Size() int { return m.Size() @@ -436,7 +450,7 @@ func (m *GenerateIntermediateResponse) Reset() { *m = GenerateIntermedia func (m *GenerateIntermediateResponse) String() string { return proto.CompactTextString(m) } func (*GenerateIntermediateResponse) ProtoMessage() {} func (*GenerateIntermediateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_provider_8ff2d2670790989c, []int{8} + return fileDescriptor_94daeb7181770839, []int{8} } func (m *GenerateIntermediateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -453,8 +467,8 @@ func (m *GenerateIntermediateResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (dst *GenerateIntermediateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenerateIntermediateResponse.Merge(dst, src) +func (m *GenerateIntermediateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenerateIntermediateResponse.Merge(m, src) } func (m *GenerateIntermediateResponse) XXX_Size() int { return m.Size() @@ -483,7 +497,7 @@ func (m *SignResponse) Reset() { *m = SignResponse{} } func (m *SignResponse) String() string { return proto.CompactTextString(m) } func (*SignResponse) ProtoMessage() {} func (*SignResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_provider_8ff2d2670790989c, []int{9} + return fileDescriptor_94daeb7181770839, []int{9} } func (m *SignResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -500,8 +514,8 @@ func (m *SignResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (dst *SignResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignResponse.Merge(dst, src) +func (m *SignResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignResponse.Merge(m, src) } func (m *SignResponse) XXX_Size() int { return m.Size() @@ -530,7 +544,7 @@ func (m *SignIntermediateResponse) Reset() { *m = SignIntermediateRespon func (m *SignIntermediateResponse) String() string { return proto.CompactTextString(m) } func (*SignIntermediateResponse) ProtoMessage() {} func (*SignIntermediateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_provider_8ff2d2670790989c, []int{10} + return fileDescriptor_94daeb7181770839, []int{10} } func (m *SignIntermediateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -547,8 +561,8 @@ func (m *SignIntermediateResponse) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (dst *SignIntermediateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignIntermediateResponse.Merge(dst, src) +func (m *SignIntermediateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignIntermediateResponse.Merge(m, src) } func (m *SignIntermediateResponse) XXX_Size() int { return m.Size() @@ -577,7 +591,7 @@ func (m *CrossSignCAResponse) Reset() { *m = CrossSignCAResponse{} } func (m *CrossSignCAResponse) String() string { return proto.CompactTextString(m) } func (*CrossSignCAResponse) ProtoMessage() {} func (*CrossSignCAResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_provider_8ff2d2670790989c, []int{11} + return fileDescriptor_94daeb7181770839, []int{11} } func (m *CrossSignCAResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -594,8 +608,8 @@ func (m *CrossSignCAResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *CrossSignCAResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CrossSignCAResponse.Merge(dst, src) +func (m *CrossSignCAResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CrossSignCAResponse.Merge(m, src) } func (m *CrossSignCAResponse) XXX_Size() int { return m.Size() @@ -625,7 +639,7 @@ func (m *Empty) Reset() { *m = Empty{} } func (m *Empty) String() string { return proto.CompactTextString(m) } func (*Empty) ProtoMessage() {} func (*Empty) Descriptor() ([]byte, []int) { - return fileDescriptor_provider_8ff2d2670790989c, []int{12} + return fileDescriptor_94daeb7181770839, []int{12} } func (m *Empty) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -642,8 +656,8 @@ func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (dst *Empty) XXX_Merge(src proto.Message) { - xxx_messageInfo_Empty.Merge(dst, src) +func (m *Empty) XXX_Merge(src proto.Message) { + xxx_messageInfo_Empty.Merge(m, src) } func (m *Empty) XXX_Size() int { return m.Size() @@ -670,6 +684,52 @@ func init() { proto.RegisterType((*Empty)(nil), "plugin.Empty") } +func init() { + proto.RegisterFile("agent/connect/ca/plugin/provider.proto", fileDescriptor_94daeb7181770839) +} + +var fileDescriptor_94daeb7181770839 = []byte{ + // 607 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x55, 0xdd, 0x6e, 0xd3, 0x30, + 0x18, 0x25, 0xfb, 0x69, 0xb7, 0x6f, 0x85, 0x55, 0xde, 0xb4, 0x85, 0x02, 0x5d, 0x15, 0xa1, 0x75, + 0x08, 0x68, 0x04, 0x03, 0x4d, 0xe2, 0x8a, 0x11, 0xc6, 0x34, 0x21, 0xa1, 0x91, 0x89, 0x1b, 0x2e, + 0xa8, 0x32, 0xc7, 0x74, 0x96, 0x1a, 0x3b, 0xd8, 0xce, 0x24, 0xde, 0x84, 0x67, 0xe0, 0x45, 0xe0, + 0x92, 0x47, 0x40, 0xe3, 0x45, 0x90, 0xf3, 0xb7, 0x24, 0x4d, 0x97, 0xbb, 0xfa,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39, 0x6d, 0xae, 0xaa, 0x0c, 0xb3, 0x63, 0xd3, + 0x58, 0xbc, 0x86, 0xf5, 0xca, 0xfa, 0xa0, 0x7e, 0xc6, 0xad, 0xdf, 0xab, 0x6a, 0x36, 0xc7, 0xd9, + 0xa8, 0x96, 0x44, 0x2a, 0x7e, 0xac, 0x72, 0x56, 0xb5, 0x3d, 0x7d, 0x0f, 0x9b, 0x75, 0x6e, 0xab, + 0x52, 0x0f, 0x6f, 0x4a, 0x2d, 0x17, 0x7b, 0x06, 0x4b, 0x7a, 0x04, 0xd0, 0x46, 0x9e, 0xcc, 0xf5, + 0x12, 0xf7, 0x36, 0xcb, 0xc1, 0x94, 0xf2, 0x09, 0xba, 0xd5, 0x79, 0x43, 0x3b, 0x45, 0x64, 0x5d, + 0x31, 0x06, 0xf3, 0x01, 0xa9, 0xec, 0x3b, 0x58, 0x2b, 0x4c, 0x24, 0xca, 0xfb, 0x3b, 0xfb, 0x3f, + 0xd0, 0xbb, 0x57, 0xfb, 0x2d, 0xd5, 0x19, 0x42, 0xdb, 0x99, 0x12, 0x8f, 0x45, 0xe1, 0xcd, 0xe3, + 0xf5, 0xe6, 0xe8, 0xf7, 0x55, 0xdf, 0xf8, 0x73, 0xd5, 0x37, 0xfe, 0x5e, 0xf5, 0x8d, 0x1f, 0xff, + 0xfa, 0xb7, 0x3e, 0xef, 0x4f, 0xa8, 0xba, 0x88, 0xce, 0x47, 0x98, 0x07, 0xf6, 0x85, 0x27, 0x2f, + 0x28, 0xe6, 0x22, 0xd4, 0xef, 0x81, 0x8c, 0xa6, 0xf6, 0x9c, 0xc7, 0xe1, 0xbc, 0x15, 0x3f, 0x0a, + 0xfb, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x5a, 0xb9, 0x1f, 0x6c, 0x3e, 0x06, 0x00, 0x00, +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn @@ -1093,8 +1153,20 @@ func (m *ConfigureRequest) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintProvider(dAtA, i, uint64(len(m.ClusterId))) i += copy(dAtA[i:], m.ClusterId) } + if len(m.DatacenterName) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintProvider(dAtA, i, uint64(len(m.DatacenterName))) + i += copy(dAtA[i:], m.DatacenterName) + } + if len(m.DnsDomain) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintProvider(dAtA, i, uint64(len(m.DnsDomain))) + i += copy(dAtA[i:], m.DnsDomain) + } if m.IsRoot { - dAtA[i] = 0x10 + dAtA[i] = 0x20 i++ if m.IsRoot { dAtA[i] = 1 @@ -1104,7 +1176,7 @@ func (m *ConfigureRequest) MarshalTo(dAtA []byte) (int, error) { i++ } if len(m.Config) > 0 { - dAtA[i] = 0x1a + dAtA[i] = 0x2a i++ i = encodeVarintProvider(dAtA, i, uint64(len(m.Config))) i += copy(dAtA[i:], m.Config) @@ -1458,6 +1530,14 @@ func (m *ConfigureRequest) Size() (n int) { if l > 0 { n += 1 + l + sovProvider(uint64(l)) } + l = len(m.DatacenterName) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } + l = len(m.DnsDomain) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } if m.IsRoot { n += 2 } @@ -1691,7 +1771,7 @@ func (m *ConfigureRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1719,7 +1799,7 @@ func (m *ConfigureRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1729,12 +1809,79 @@ func (m *ConfigureRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthProvider } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } if postIndex > l { return io.ErrUnexpectedEOF } m.ClusterId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DatacenterName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DatacenterName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DnsDomain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DnsDomain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field IsRoot", wireType) } @@ -1748,13 +1895,13 @@ func (m *ConfigureRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } m.IsRoot = bool(v != 0) - case 3: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) } @@ -1768,7 +1915,7 @@ func (m *ConfigureRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1777,6 +1924,9 @@ func (m *ConfigureRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthProvider } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1794,6 +1944,9 @@ func (m *ConfigureRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthProvider } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthProvider + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -1822,7 +1975,7 @@ func (m *SetIntermediateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1850,7 +2003,7 @@ func (m *SetIntermediateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1860,6 +2013,9 @@ func (m *SetIntermediateRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthProvider } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1879,7 +2035,7 @@ func (m *SetIntermediateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1889,6 +2045,9 @@ func (m *SetIntermediateRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthProvider } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1903,6 +2062,9 @@ func (m *SetIntermediateRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthProvider } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthProvider + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -1931,7 +2093,7 @@ func (m *SignRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1959,7 +2121,7 @@ func (m *SignRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1968,6 +2130,9 @@ func (m *SignRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthProvider } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1985,6 +2150,9 @@ func (m *SignRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthProvider } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthProvider + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2013,7 +2181,7 @@ func (m *SignIntermediateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2041,7 +2209,7 @@ func (m *SignIntermediateRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2050,6 +2218,9 @@ func (m *SignIntermediateRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthProvider } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2067,6 +2238,9 @@ func (m *SignIntermediateRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthProvider } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthProvider + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2095,7 +2269,7 @@ func (m *CrossSignCARequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2123,7 +2297,7 @@ func (m *CrossSignCARequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2132,6 +2306,9 @@ func (m *CrossSignCARequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthProvider } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2149,6 +2326,9 @@ func (m *CrossSignCARequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthProvider } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthProvider + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2177,7 +2357,7 @@ func (m *ActiveRootResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2205,7 +2385,7 @@ func (m *ActiveRootResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2215,6 +2395,9 @@ func (m *ActiveRootResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthProvider } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2229,6 +2412,9 @@ func (m *ActiveRootResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthProvider } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthProvider + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2257,7 +2443,7 @@ func (m *GenerateIntermediateCSRResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2285,7 +2471,7 @@ func (m *GenerateIntermediateCSRResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2295,6 +2481,9 @@ func (m *GenerateIntermediateCSRResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthProvider } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2309,6 +2498,9 @@ func (m *GenerateIntermediateCSRResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthProvider } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthProvider + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2337,7 +2529,7 @@ func (m *ActiveIntermediateResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2365,7 +2557,7 @@ func (m *ActiveIntermediateResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2375,6 +2567,9 @@ func (m *ActiveIntermediateResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthProvider } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2389,6 +2584,9 @@ func (m *ActiveIntermediateResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthProvider } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthProvider + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2417,7 +2615,7 @@ func (m *GenerateIntermediateResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2445,7 +2643,7 @@ func (m *GenerateIntermediateResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2455,6 +2653,9 @@ func (m *GenerateIntermediateResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthProvider } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2469,6 +2670,9 @@ func (m *GenerateIntermediateResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthProvider } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthProvider + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2497,7 +2701,7 @@ func (m *SignResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2525,7 +2729,7 @@ func (m *SignResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2535,6 +2739,9 @@ func (m *SignResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthProvider } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2549,6 +2756,9 @@ func (m *SignResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthProvider } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthProvider + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2577,7 +2787,7 @@ func (m *SignIntermediateResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2605,7 +2815,7 @@ func (m *SignIntermediateResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2615,6 +2825,9 @@ func (m *SignIntermediateResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthProvider } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2629,6 +2842,9 @@ func (m *SignIntermediateResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthProvider } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthProvider + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2657,7 +2873,7 @@ func (m *CrossSignCAResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2685,7 +2901,7 @@ func (m *CrossSignCAResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2695,6 +2911,9 @@ func (m *CrossSignCAResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthProvider } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2709,6 +2928,9 @@ func (m *CrossSignCAResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthProvider } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthProvider + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2737,7 +2959,7 @@ func (m *Empty) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2760,6 +2982,9 @@ func (m *Empty) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthProvider } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthProvider + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2827,10 +3052,13 @@ func skipProvider(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthProvider } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthProvider + } return iNdEx, nil case 3: for { @@ -2859,6 +3087,9 @@ func skipProvider(dAtA []byte) (n int, err error) { return 0, err } iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthProvider + } } return iNdEx, nil case 4: @@ -2877,47 +3108,3 @@ var ( ErrInvalidLengthProvider = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowProvider = fmt.Errorf("proto: integer overflow") ) - -func init() { - proto.RegisterFile("agent/connect/ca/plugin/provider.proto", fileDescriptor_provider_8ff2d2670790989c) -} - -var fileDescriptor_provider_8ff2d2670790989c = []byte{ - // 566 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xdf, 0x6e, 0xd3, 0x3e, - 0x18, 0xfd, 0xa5, 0xfb, 0xad, 0x5d, 0xbf, 0x15, 0xad, 0xf2, 0xa6, 0xb5, 0x14,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58, 0xb0, 0xff, 0x8f, 0xd0, - 0xda, 0xb1, 0xe6, 0xbc, 0xca, 0x20, 0x3e, 0x96, 0xd9, 0xe2, 0x2d, 0x1c, 0xe5, 0xae, 0x0f, 0xea, - 0xc6, 0xdc, 0xe2, 0x7b, 0x95, 0xef, 0xe6, 0x32, 0xb6, 0x6a, 0x46, 0x24, 0x57, 0x8f, 0x9e, 0xed, - 0xaa, 0x70, 0xa7, 0x1f, 0xe0, 0xa4, 0xa8, 0xda, 0xbc, 0xd4, 0xe3, 0xbb, 0x5a, 0x4b, 0xc4, 0x5e, - 0xc0, 0xff, 0xca, 0x02, 0xe8, 0x38, 0x69, 0xe6, 0xf6, 0x12, 0x77, 0x4e, 0xb2, 0xc1, 0x88, 0xf2, - 0x09, 0x9a, 0x79, 0xbf, 0xa1, 0x5e, 0x1a, 0x59, 0x34, 0x8c, 0xfe, 0x6e, 0x40, 0x24, 0xfb, 0x1e, - 0x0e, 0x53, 0x8e, 0x44, 0xc9, 0x7e, 0xb7, 0xdf, 0x81, 0xce, 0x83, 0xc2, 0x7f, 0x91, 0xce, 0x00, - 0x6a, 0xe6, 0x8a, 0xd8, 0x5e, 0xe0, 0xdf, 0x6d, 0xaf, 0x77, 0x17, 0xbf, 0xd6, 0x5d, 0xed, 0xf7, - 0xba, 0xab, 0xfd, 0x59, 0x77, 0xb5, 0x1f, 0x7f, 0xbb, 0xff, 0x7d, 0x1e, 0x3b, 0x54, 0x2e, 0x83, - 0xf9, 0x08, 0x33, 0xd7, 0x58, 0xda, 0x62, 0x49, 0x31, 0xe3, 0xbe, 0x7a, 0xc6, 0x45, 0xb0, 0x32, - 0x76, 0xbc, 0xe9, 0xf3, 0x6a, 0xf8, 0x96, 0x8f, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x7b, 0x20, - 0xb4, 0xe4, 0xf5, 0x05, 0x00, 0x00, -} diff --git a/agent/connect/ca/plugin/provider.proto b/agent/connect/ca/plugin/provider.proto index 6ca9cf88f..f6d61c217 100644 --- a/agent/connect/ca/plugin/provider.proto +++ b/agent/connect/ca/plugin/provider.proto @@ -30,8 +30,10 @@ service CA { message ConfigureRequest { string cluster_id = 1; - bool is_root = 2; - bytes config = 3; // JSON-encoded structure + string datacenter_name = 2; + string dns_domain = 3; + bool is_root = 4; + bytes config = 5; // JSON-encoded structure } message SetIntermediateRequest { diff --git a/agent/connect/ca/plugin/transport_grpc.go b/agent/connect/ca/plugin/transport_grpc.go index cb21e559c..0c8bc41aa 100644 --- a/agent/connect/ca/plugin/transport_grpc.go +++ b/agent/connect/ca/plugin/transport_grpc.go @@ -20,7 +20,7 @@ func (p *providerPluginGRPCServer) Configure(_ context.Context, req *ConfigureRe return nil, err } - return &Empty{}, p.impl.Configure(req.ClusterId, req.IsRoot, rawConfig) + return &Empty{}, p.impl.Configure(req.ClusterId, req.DatacenterName, req.DnsDomain, req.IsRoot, rawConfig) } func (p *providerPluginGRPCServer) GenerateRoot(context.Context, *Empty) (*Empty, error) { @@ -95,6 +95,8 @@ type providerPluginGRPCClient struct { func (p *providerPluginGRPCClient) Configure( clusterId string, + datacenterName string, + dnsDomain string, isRoot bool, rawConfig map[string]interface{}) error { config, err := json.Marshal(rawConfig) @@ -103,9 +105,11 @@ func (p *providerPluginGRPCClient) Configure( } _, err = p.client.Configure(p.doneCtx, &ConfigureRequest{ - ClusterId: clusterId, - IsRoot: isRoot, - Config: config, + ClusterId: clusterId, + DatacenterName: datacenterName, + DnsDomain: dnsDomain, + IsRoot: isRoot, + Config: config, }) return p.err(err) } diff --git a/agent/connect/ca/plugin/transport_netrpc.go b/agent/connect/ca/plugin/transport_netrpc.go index 8186e1d00..06115e6c7 100644 --- a/agent/connect/ca/plugin/transport_netrpc.go +++ b/agent/connect/ca/plugin/transport_netrpc.go @@ -15,7 +15,7 @@ type providerPluginRPCServer struct { } func (p *providerPluginRPCServer) Configure(args *ConfigureRPCRequest, _ *struct{}) error { - return p.impl.Configure(args.ClusterId, args.IsRoot, args.RawConfig) + return p.impl.Configure(args.ClusterId, args.DatacenterName, args.DNSDomain, args.IsRoot, args.RawConfig) } func (p *providerPluginRPCServer) GenerateRoot(struct{}, *struct{}) error { @@ -95,12 +95,16 @@ type providerPluginRPCClient struct { func (p *providerPluginRPCClient) Configure( clusterId string, + datacenterName string, + dnsDomain string, isRoot bool, rawConfig map[string]interface{}) error { return p.client.Call("Plugin.Configure", &ConfigureRPCRequest{ - ClusterId: clusterId, - IsRoot: isRoot, - RawConfig: rawConfig, + ClusterId: clusterId, + DatacenterName: datacenterName, + DNSDomain: dnsDomain, + IsRoot: isRoot, + RawConfig: rawConfig, }, &struct{}{}) } @@ -174,9 +178,11 @@ var _ ca.Provider = &providerPluginRPCClient{} // Structs for net/rpc request and response type ConfigureRPCRequest struct { - ClusterId string - IsRoot bool - RawConfig map[string]interface{} + ClusterId string + DatacenterName string + DNSDomain string + IsRoot bool + RawConfig map[string]interface{} } type SetIntermediateRPCRequest struct { diff --git a/agent/connect/ca/provider.go b/agent/connect/ca/provider.go index 1a89d6492..bd3547475 100644 --- a/agent/connect/ca/provider.go +++ b/agent/connect/ca/provider.go @@ -12,7 +12,8 @@ import ( type Provider interface { // Configure initializes the provider based on the given cluster ID, root status // and configuration values. - Configure(clusterId string, isRoot bool, rawConfig map[string]interface{}) error + Configure(clusterId string, datacenterName string, dnsDomain string, + isRoot bool, rawConfig map[string]interface{}) error // GenerateRoot causes the creation of a new root certificate for this provider. // This can also be a no-op if a root certificate already exists for the given