diff --git a/cqproto/grpc.go b/cqproto/grpc.go index a1f4bd8b..627a275c 100644 --- a/cqproto/grpc.go +++ b/cqproto/grpc.go @@ -58,6 +58,19 @@ func (g GRPCClient) GetProviderConfig(ctx context.Context, request *GetProviderC }, nil } +func (g GRPCClient) ValidateProviderConfig(ctx context.Context, request *ValidateProviderConfigRequest) (*ValidateProviderConfigResponse, error) { + res, err := g.client.ValidateProviderConfig(ctx, &internal.ValidateProviderConfig_Request{ + Config: request.Config, + }) + if err != nil { + return nil, err + } + + return &ValidateProviderConfigResponse{ + Diagnostics: diagnosticsFromProto("", res.Diagnostics), + }, nil +} + func (g GRPCClient) ConfigureProvider(ctx context.Context, request *ConfigureProviderRequest) (*ConfigureProviderResponse, error) { res, err := g.client.ConfigureProvider(ctx, &internal.ConfigureProvider_Request{ CloudqueryVersion: request.CloudQueryVersion, diff --git a/cqproto/internal/plugin.pb.go b/cqproto/internal/plugin.pb.go index 109e1d0b..605920ab 100644 --- a/cqproto/internal/plugin.pb.go +++ b/cqproto/internal/plugin.pb.go @@ -771,6 +771,44 @@ func (*GetProviderConfig) Descriptor() ([]byte, []int) { return file_internal_plugin_proto_rawDescGZIP(), []int{6} } +type ValidateProviderConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ValidateProviderConfig) Reset() { + *x = ValidateProviderConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_plugin_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateProviderConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateProviderConfig) ProtoMessage() {} + +func (x *ValidateProviderConfig) ProtoReflect() protoreflect.Message { + mi := &file_internal_plugin_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateProviderConfig.ProtoReflect.Descriptor instead. +func (*ValidateProviderConfig) Descriptor() ([]byte, []int) { + return file_internal_plugin_proto_rawDescGZIP(), []int{7} +} + type GetModuleInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -780,7 +818,7 @@ type GetModuleInfo struct { func (x *GetModuleInfo) Reset() { *x = GetModuleInfo{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[7] + mi := &file_internal_plugin_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -793,7 +831,7 @@ func (x *GetModuleInfo) String() string { func (*GetModuleInfo) ProtoMessage() {} func (x *GetModuleInfo) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[7] + mi := &file_internal_plugin_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -806,7 +844,7 @@ func (x *GetModuleInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use GetModuleInfo.ProtoReflect.Descriptor instead. func (*GetModuleInfo) Descriptor() ([]byte, []int) { - return file_internal_plugin_proto_rawDescGZIP(), []int{7} + return file_internal_plugin_proto_rawDescGZIP(), []int{8} } // Table is the definition of how a table is defined in a provider @@ -826,7 +864,7 @@ type Table struct { func (x *Table) Reset() { *x = Table{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[8] + mi := &file_internal_plugin_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -839,7 +877,7 @@ func (x *Table) String() string { func (*Table) ProtoMessage() {} func (x *Table) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[8] + mi := &file_internal_plugin_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -852,7 +890,7 @@ func (x *Table) ProtoReflect() protoreflect.Message { // Deprecated: Use Table.ProtoReflect.Descriptor instead. func (*Table) Descriptor() ([]byte, []int) { - return file_internal_plugin_proto_rawDescGZIP(), []int{8} + return file_internal_plugin_proto_rawDescGZIP(), []int{9} } func (x *Table) GetName() string { @@ -911,7 +949,7 @@ type Column struct { func (x *Column) Reset() { *x = Column{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[9] + mi := &file_internal_plugin_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -924,7 +962,7 @@ func (x *Column) String() string { func (*Column) ProtoMessage() {} func (x *Column) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[9] + mi := &file_internal_plugin_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -937,7 +975,7 @@ func (x *Column) ProtoReflect() protoreflect.Message { // Deprecated: Use Column.ProtoReflect.Descriptor instead. func (*Column) Descriptor() ([]byte, []int) { - return file_internal_plugin_proto_rawDescGZIP(), []int{9} + return file_internal_plugin_proto_rawDescGZIP(), []int{10} } func (x *Column) GetName() string { @@ -980,7 +1018,7 @@ type ColumnMeta struct { func (x *ColumnMeta) Reset() { *x = ColumnMeta{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[10] + mi := &file_internal_plugin_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -993,7 +1031,7 @@ func (x *ColumnMeta) String() string { func (*ColumnMeta) ProtoMessage() {} func (x *ColumnMeta) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[10] + mi := &file_internal_plugin_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1006,7 +1044,7 @@ func (x *ColumnMeta) ProtoReflect() protoreflect.Message { // Deprecated: Use ColumnMeta.ProtoReflect.Descriptor instead. func (*ColumnMeta) Descriptor() ([]byte, []int) { - return file_internal_plugin_proto_rawDescGZIP(), []int{10} + return file_internal_plugin_proto_rawDescGZIP(), []int{11} } func (x *ColumnMeta) GetResolver() *ResolverMeta { @@ -1035,7 +1073,7 @@ type ResolverMeta struct { func (x *ResolverMeta) Reset() { *x = ResolverMeta{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[11] + mi := &file_internal_plugin_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1048,7 +1086,7 @@ func (x *ResolverMeta) String() string { func (*ResolverMeta) ProtoMessage() {} func (x *ResolverMeta) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[11] + mi := &file_internal_plugin_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1061,7 +1099,7 @@ func (x *ResolverMeta) ProtoReflect() protoreflect.Message { // Deprecated: Use ResolverMeta.ProtoReflect.Descriptor instead. func (*ResolverMeta) Descriptor() ([]byte, []int) { - return file_internal_plugin_proto_rawDescGZIP(), []int{11} + return file_internal_plugin_proto_rawDescGZIP(), []int{12} } func (x *ResolverMeta) GetName() string { @@ -1089,7 +1127,7 @@ type TableCreationOptions struct { func (x *TableCreationOptions) Reset() { *x = TableCreationOptions{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[12] + mi := &file_internal_plugin_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1102,7 +1140,7 @@ func (x *TableCreationOptions) String() string { func (*TableCreationOptions) ProtoMessage() {} func (x *TableCreationOptions) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[12] + mi := &file_internal_plugin_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1115,7 +1153,7 @@ func (x *TableCreationOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use TableCreationOptions.ProtoReflect.Descriptor instead. func (*TableCreationOptions) Descriptor() ([]byte, []int) { - return file_internal_plugin_proto_rawDescGZIP(), []int{12} + return file_internal_plugin_proto_rawDescGZIP(), []int{13} } func (x *TableCreationOptions) GetPrimaryKeys() []string { @@ -1137,7 +1175,7 @@ type ConnectionDetails struct { func (x *ConnectionDetails) Reset() { *x = ConnectionDetails{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[13] + mi := &file_internal_plugin_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1150,7 +1188,7 @@ func (x *ConnectionDetails) String() string { func (*ConnectionDetails) ProtoMessage() {} func (x *ConnectionDetails) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[13] + mi := &file_internal_plugin_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1163,7 +1201,7 @@ func (x *ConnectionDetails) ProtoReflect() protoreflect.Message { // Deprecated: Use ConnectionDetails.ProtoReflect.Descriptor instead. func (*ConnectionDetails) Descriptor() ([]byte, []int) { - return file_internal_plugin_proto_rawDescGZIP(), []int{13} + return file_internal_plugin_proto_rawDescGZIP(), []int{14} } func (x *ConnectionDetails) GetType() ConnectionType { @@ -1200,7 +1238,7 @@ type ConfigureProvider_Request struct { func (x *ConfigureProvider_Request) Reset() { *x = ConfigureProvider_Request{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[14] + mi := &file_internal_plugin_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1213,7 +1251,7 @@ func (x *ConfigureProvider_Request) String() string { func (*ConfigureProvider_Request) ProtoMessage() {} func (x *ConfigureProvider_Request) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[14] + mi := &file_internal_plugin_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1270,7 +1308,7 @@ type ConfigureProvider_Response struct { func (x *ConfigureProvider_Response) Reset() { *x = ConfigureProvider_Response{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[15] + mi := &file_internal_plugin_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1283,7 +1321,7 @@ func (x *ConfigureProvider_Response) String() string { func (*ConfigureProvider_Response) ProtoMessage() {} func (x *ConfigureProvider_Response) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[15] + mi := &file_internal_plugin_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1335,7 +1373,7 @@ type FetchResources_Request struct { func (x *FetchResources_Request) Reset() { *x = FetchResources_Request{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[16] + mi := &file_internal_plugin_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1348,7 +1386,7 @@ func (x *FetchResources_Request) String() string { func (*FetchResources_Request) ProtoMessage() {} func (x *FetchResources_Request) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[16] + mi := &file_internal_plugin_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1428,7 +1466,7 @@ type FetchResources_Response struct { func (x *FetchResources_Response) Reset() { *x = FetchResources_Response{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[17] + mi := &file_internal_plugin_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1441,7 +1479,7 @@ func (x *FetchResources_Response) String() string { func (*FetchResources_Response) ProtoMessage() {} func (x *FetchResources_Response) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[17] + mi := &file_internal_plugin_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1508,7 +1546,7 @@ type GetProviderSchema_Request struct { func (x *GetProviderSchema_Request) Reset() { *x = GetProviderSchema_Request{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[19] + mi := &file_internal_plugin_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1521,7 +1559,7 @@ func (x *GetProviderSchema_Request) String() string { func (*GetProviderSchema_Request) ProtoMessage() {} func (x *GetProviderSchema_Request) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[19] + mi := &file_internal_plugin_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1550,7 +1588,7 @@ type GetProviderSchema_Response struct { func (x *GetProviderSchema_Response) Reset() { *x = GetProviderSchema_Response{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[20] + mi := &file_internal_plugin_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1563,7 +1601,7 @@ func (x *GetProviderSchema_Response) String() string { func (*GetProviderSchema_Response) ProtoMessage() {} func (x *GetProviderSchema_Response) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[20] + mi := &file_internal_plugin_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1612,7 +1650,7 @@ type GetProviderConfig_Request struct { func (x *GetProviderConfig_Request) Reset() { *x = GetProviderConfig_Request{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[22] + mi := &file_internal_plugin_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1625,7 +1663,7 @@ func (x *GetProviderConfig_Request) String() string { func (*GetProviderConfig_Request) ProtoMessage() {} func (x *GetProviderConfig_Request) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[22] + mi := &file_internal_plugin_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1665,7 +1703,7 @@ type GetProviderConfig_Response struct { func (x *GetProviderConfig_Response) Reset() { *x = GetProviderConfig_Response{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[23] + mi := &file_internal_plugin_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1678,7 +1716,7 @@ func (x *GetProviderConfig_Response) String() string { func (*GetProviderConfig_Response) ProtoMessage() {} func (x *GetProviderConfig_Response) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[23] + mi := &file_internal_plugin_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1723,6 +1761,100 @@ func (x *GetProviderConfig_Response) GetFormat() ConfigFormat { return ConfigFormat_Invalid } +type ValidateProviderConfig_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Config []byte `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *ValidateProviderConfig_Request) Reset() { + *x = ValidateProviderConfig_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_plugin_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateProviderConfig_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateProviderConfig_Request) ProtoMessage() {} + +func (x *ValidateProviderConfig_Request) ProtoReflect() protoreflect.Message { + mi := &file_internal_plugin_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateProviderConfig_Request.ProtoReflect.Descriptor instead. +func (*ValidateProviderConfig_Request) Descriptor() ([]byte, []int) { + return file_internal_plugin_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *ValidateProviderConfig_Request) GetConfig() []byte { + if x != nil { + return x.Config + } + return nil +} + +type ValidateProviderConfig_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Diagnostics []*Diagnostic `protobuf:"bytes,1,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` +} + +func (x *ValidateProviderConfig_Response) Reset() { + *x = ValidateProviderConfig_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_plugin_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateProviderConfig_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateProviderConfig_Response) ProtoMessage() {} + +func (x *ValidateProviderConfig_Response) ProtoReflect() protoreflect.Message { + mi := &file_internal_plugin_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateProviderConfig_Response.ProtoReflect.Descriptor instead. +func (*ValidateProviderConfig_Response) Descriptor() ([]byte, []int) { + return file_internal_plugin_proto_rawDescGZIP(), []int{7, 1} +} + +func (x *ValidateProviderConfig_Response) GetDiagnostics() []*Diagnostic { + if x != nil { + return x.Diagnostics + } + return nil +} + type GetModuleInfo_Request struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1735,7 +1867,7 @@ type GetModuleInfo_Request struct { func (x *GetModuleInfo_Request) Reset() { *x = GetModuleInfo_Request{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[24] + mi := &file_internal_plugin_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1748,7 +1880,7 @@ func (x *GetModuleInfo_Request) String() string { func (*GetModuleInfo_Request) ProtoMessage() {} func (x *GetModuleInfo_Request) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[24] + mi := &file_internal_plugin_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1761,7 +1893,7 @@ func (x *GetModuleInfo_Request) ProtoReflect() protoreflect.Message { // Deprecated: Use GetModuleInfo_Request.ProtoReflect.Descriptor instead. func (*GetModuleInfo_Request) Descriptor() ([]byte, []int) { - return file_internal_plugin_proto_rawDescGZIP(), []int{7, 0} + return file_internal_plugin_proto_rawDescGZIP(), []int{8, 0} } func (x *GetModuleInfo_Request) GetModule() string { @@ -1791,7 +1923,7 @@ type GetModuleInfo_Response struct { func (x *GetModuleInfo_Response) Reset() { *x = GetModuleInfo_Response{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[25] + mi := &file_internal_plugin_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1804,7 +1936,7 @@ func (x *GetModuleInfo_Response) String() string { func (*GetModuleInfo_Response) ProtoMessage() {} func (x *GetModuleInfo_Response) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[25] + mi := &file_internal_plugin_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1817,7 +1949,7 @@ func (x *GetModuleInfo_Response) ProtoReflect() protoreflect.Message { // Deprecated: Use GetModuleInfo_Response.ProtoReflect.Descriptor instead. func (*GetModuleInfo_Response) Descriptor() ([]byte, []int) { - return file_internal_plugin_proto_rawDescGZIP(), []int{7, 1} + return file_internal_plugin_proto_rawDescGZIP(), []int{8, 1} } func (x *GetModuleInfo_Response) GetData() map[uint32]*GetModuleInfo_Response_ModuleInfo { @@ -1853,7 +1985,7 @@ type GetModuleInfo_Response_ModuleInfo struct { func (x *GetModuleInfo_Response_ModuleInfo) Reset() { *x = GetModuleInfo_Response_ModuleInfo{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[27] + mi := &file_internal_plugin_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1866,7 +1998,7 @@ func (x *GetModuleInfo_Response_ModuleInfo) String() string { func (*GetModuleInfo_Response_ModuleInfo) ProtoMessage() {} func (x *GetModuleInfo_Response_ModuleInfo) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[27] + mi := &file_internal_plugin_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1879,7 +2011,7 @@ func (x *GetModuleInfo_Response_ModuleInfo) ProtoReflect() protoreflect.Message // Deprecated: Use GetModuleInfo_Response_ModuleInfo.ProtoReflect.Descriptor instead. func (*GetModuleInfo_Response_ModuleInfo) Descriptor() ([]byte, []int) { - return file_internal_plugin_proto_rawDescGZIP(), []int{7, 1, 1} + return file_internal_plugin_proto_rawDescGZIP(), []int{8, 1, 1} } func (x *GetModuleInfo_Response_ModuleInfo) GetFiles() []*GetModuleInfo_Response_ModuleInfo_ModuleFile { @@ -1908,7 +2040,7 @@ type GetModuleInfo_Response_ModuleInfo_ModuleFile struct { func (x *GetModuleInfo_Response_ModuleInfo_ModuleFile) Reset() { *x = GetModuleInfo_Response_ModuleInfo_ModuleFile{} if protoimpl.UnsafeEnabled { - mi := &file_internal_plugin_proto_msgTypes[29] + mi := &file_internal_plugin_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1921,7 +2053,7 @@ func (x *GetModuleInfo_Response_ModuleInfo_ModuleFile) String() string { func (*GetModuleInfo_Response_ModuleInfo_ModuleFile) ProtoMessage() {} func (x *GetModuleInfo_Response_ModuleInfo_ModuleFile) ProtoReflect() protoreflect.Message { - mi := &file_internal_plugin_proto_msgTypes[29] + mi := &file_internal_plugin_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1934,7 +2066,7 @@ func (x *GetModuleInfo_Response_ModuleInfo_ModuleFile) ProtoReflect() protorefle // Deprecated: Use GetModuleInfo_Response_ModuleInfo_ModuleFile.ProtoReflect.Descriptor instead. func (*GetModuleInfo_Response_ModuleInfo_ModuleFile) Descriptor() ([]byte, []int) { - return file_internal_plugin_proto_rawDescGZIP(), []int{7, 1, 1, 1} + return file_internal_plugin_proto_rawDescGZIP(), []int{8, 1, 1, 1} } func (x *GetModuleInfo_Response_ModuleInfo_ModuleFile) GetName() string { @@ -2103,142 +2235,157 @@ var file_internal_plugin_proto_rawDesc = []byte{ 0x67, 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x42, 0x02, 0x18, 0x01, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, - 0x61, 0x74, 0x22, 0x93, 0x05, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x50, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, 0x65, 0x66, 0x65, - 0x72, 0x72, 0x65, 0x64, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0d, 0x52, 0x11, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xaf, 0x04, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x2d, 0x0a, 0x12, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x11, 0x61, 0x76, - 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x33, 0x0a, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, - 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, - 0x74, 0x69, 0x63, 0x73, 0x1a, 0x61, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x3e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x9e, 0x02, 0x0a, 0x0a, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x49, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, - 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x12, 0x4c, 0x0a, 0x06, 0x65, 0x78, 0x74, 0x72, 0x61, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x34, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x78, 0x74, 0x72, - 0x61, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x65, 0x78, 0x74, 0x72, 0x61, 0x73, 0x1a, - 0x39, 0x0a, 0x0b, 0x45, 0x78, 0x74, 0x72, 0x61, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3c, 0x0a, 0x0a, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xf2, 0x01, 0x0a, 0x05, 0x54, 0x61, 0x62, - 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, - 0x6d, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x73, 0x12, 0x2a, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x61, 0x62, - 0x6c, 0x65, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3a, 0x0a, - 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x07, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x72, - 0x69, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x72, 0x69, 0x61, - 0x6c, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x8c, 0x01, - 0x0a, 0x06, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, - 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6c, 0x75, - 0x6d, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x61, 0x0a, 0x0a, - 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x08, 0x72, 0x65, - 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x74, - 0x61, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x49, - 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0c, 0x49, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, - 0x3c, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x22, 0x38, 0x0a, - 0x14, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, - 0x4b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x50, 0x72, 0x69, 0x6d, - 0x61, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x50, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x29, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x2a, 0x29, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x0f, 0x0a, 0x07, 0x49, 0x6e, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x10, 0x00, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x59, 0x41, - 0x4d, 0x4c, 0x10, 0x01, 0x2a, 0x97, 0x02, 0x0a, 0x0a, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, - 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x4d, - 0x41, 0x4c, 0x4c, 0x49, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x49, 0x4e, 0x54, 0x10, - 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x42, 0x49, 0x47, 0x49, 0x4e, 0x54, 0x10, 0x04, 0x12, 0x09, 0x0a, - 0x05, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x05, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x55, 0x49, 0x44, - 0x10, 0x06, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x07, 0x12, 0x0e, - 0x0a, 0x0a, 0x42, 0x59, 0x54, 0x45, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x08, 0x12, 0x10, - 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x09, - 0x12, 0x0d, 0x0a, 0x09, 0x49, 0x4e, 0x54, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x0a, 0x12, - 0x0d, 0x0a, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x0b, 0x12, 0x08, - 0x0a, 0x04, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x0c, 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x55, 0x49, 0x44, - 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x0d, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x45, 0x54, - 0x10, 0x0e, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x4e, 0x45, 0x54, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, - 0x10, 0x0f, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x49, 0x44, 0x52, 0x10, 0x10, 0x12, 0x0e, 0x0a, 0x0a, - 0x43, 0x49, 0x44, 0x52, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x11, 0x12, 0x0c, 0x0a, 0x08, - 0x4d, 0x41, 0x43, 0x5f, 0x41, 0x44, 0x44, 0x52, 0x10, 0x12, 0x12, 0x12, 0x0a, 0x0e, 0x4d, 0x41, - 0x43, 0x5f, 0x41, 0x44, 0x44, 0x52, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x13, 0x2a, 0x1e, - 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x4f, 0x53, 0x54, 0x47, 0x52, 0x45, 0x53, 0x10, 0x00, 0x32, 0xb9, - 0x03, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x58, 0x0a, 0x11, 0x47, - 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x12, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x20, 0x2e, 0x70, 0x72, 0x6f, + 0x61, 0x74, 0x22, 0x7c, 0x0a, 0x16, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x21, 0x0a, 0x07, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, + 0x3f, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x0b, 0x64, + 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, + 0x74, 0x69, 0x63, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, + 0x22, 0x93, 0x05, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x1a, 0x50, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, + 0x65, 0x64, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0d, 0x52, 0x11, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xaf, 0x04, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2d, + 0x0a, 0x12, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x11, 0x61, 0x76, 0x61, 0x69, + 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, 0x0a, + 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, + 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, + 0x63, 0x73, 0x1a, 0x61, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x3e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x28, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x9e, 0x02, 0x0a, 0x0a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x49, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, + 0x4c, 0x0a, 0x06, 0x65, 0x78, 0x74, 0x72, 0x61, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x34, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x65, 0x78, 0x74, 0x72, 0x61, 0x73, 0x1a, 0x39, 0x0a, + 0x0b, 0x45, 0x78, 0x74, 0x72, 0x61, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3c, 0x0a, 0x0a, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xf2, 0x01, 0x0a, 0x05, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, + 0x2a, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x42, + 0x0a, 0x0a, 0x08, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x06, + 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x61, 0x0a, 0x0a, 0x43, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, + 0x6c, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x52, + 0x08, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x49, 0x67, 0x6e, + 0x6f, 0x72, 0x65, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0c, 0x49, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x3c, 0x0a, + 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x22, 0x38, 0x0a, 0x14, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x4b, 0x65, + 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, + 0x79, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x50, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x2a, 0x29, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x0f, 0x0a, 0x07, 0x49, 0x6e, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x10, 0x00, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x59, 0x41, 0x4d, 0x4c, + 0x10, 0x01, 0x2a, 0x97, 0x02, 0x0a, 0x0a, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x08, + 0x0a, 0x04, 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x4d, 0x41, 0x4c, + 0x4c, 0x49, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x49, 0x4e, 0x54, 0x10, 0x03, 0x12, + 0x0a, 0x0a, 0x06, 0x42, 0x49, 0x47, 0x49, 0x4e, 0x54, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x46, + 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x05, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x55, 0x49, 0x44, 0x10, 0x06, + 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x07, 0x12, 0x0e, 0x0a, 0x0a, + 0x42, 0x59, 0x54, 0x45, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x08, 0x12, 0x10, 0x0a, 0x0c, + 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x09, 0x12, 0x0d, + 0x0a, 0x09, 0x49, 0x4e, 0x54, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x0a, 0x12, 0x0d, 0x0a, + 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x0b, 0x12, 0x08, 0x0a, 0x04, + 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x0c, 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x55, 0x49, 0x44, 0x5f, 0x41, + 0x52, 0x52, 0x41, 0x59, 0x10, 0x0d, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x45, 0x54, 0x10, 0x0e, + 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x4e, 0x45, 0x54, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x0f, + 0x12, 0x08, 0x0a, 0x04, 0x43, 0x49, 0x44, 0x52, 0x10, 0x10, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x49, + 0x44, 0x52, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x11, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x41, + 0x43, 0x5f, 0x41, 0x44, 0x44, 0x52, 0x10, 0x12, 0x12, 0x12, 0x0a, 0x0e, 0x4d, 0x41, 0x43, 0x5f, + 0x41, 0x44, 0x44, 0x52, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x13, 0x2a, 0x1e, 0x0a, 0x0e, + 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, + 0x0a, 0x08, 0x50, 0x4f, 0x53, 0x54, 0x47, 0x52, 0x45, 0x53, 0x10, 0x00, 0x32, 0xa2, 0x04, 0x0a, + 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x20, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x58, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x12, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0e, 0x46, 0x65, 0x74, - 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x4c, 0x0a, 0x0d, - 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0b, 0x5a, 0x09, 0x2f, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, + 0x16, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x20, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x51, 0x0a, 0x0e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x30, 0x01, 0x12, 0x4c, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0x0b, 0x5a, 0x09, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2254,7 +2401,7 @@ func file_internal_plugin_proto_rawDescGZIP() []byte { } var file_internal_plugin_proto_enumTypes = make([]protoimpl.EnumInfo, 6) -var file_internal_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 30) +var file_internal_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 33) var file_internal_plugin_proto_goTypes = []interface{}{ (ConfigFormat)(0), // 0: proto.ConfigFormat (ColumnType)(0), // 1: proto.ColumnType @@ -2269,29 +2416,32 @@ var file_internal_plugin_proto_goTypes = []interface{}{ (*Diagnostic)(nil), // 10: proto.Diagnostic (*GetProviderSchema)(nil), // 11: proto.GetProviderSchema (*GetProviderConfig)(nil), // 12: proto.GetProviderConfig - (*GetModuleInfo)(nil), // 13: proto.GetModuleInfo - (*Table)(nil), // 14: proto.Table - (*Column)(nil), // 15: proto.Column - (*ColumnMeta)(nil), // 16: proto.ColumnMeta - (*ResolverMeta)(nil), // 17: proto.ResolverMeta - (*TableCreationOptions)(nil), // 18: proto.TableCreationOptions - (*ConnectionDetails)(nil), // 19: proto.ConnectionDetails - (*ConfigureProvider_Request)(nil), // 20: proto.ConfigureProvider.Request - (*ConfigureProvider_Response)(nil), // 21: proto.ConfigureProvider.Response - (*FetchResources_Request)(nil), // 22: proto.FetchResources.Request - (*FetchResources_Response)(nil), // 23: proto.FetchResources.Response - nil, // 24: proto.FetchResources.Response.FinishedResourcesEntry - (*GetProviderSchema_Request)(nil), // 25: proto.GetProviderSchema.Request - (*GetProviderSchema_Response)(nil), // 26: proto.GetProviderSchema.Response - nil, // 27: proto.GetProviderSchema.Response.ResourceTablesEntry - (*GetProviderConfig_Request)(nil), // 28: proto.GetProviderConfig.Request - (*GetProviderConfig_Response)(nil), // 29: proto.GetProviderConfig.Response - (*GetModuleInfo_Request)(nil), // 30: proto.GetModuleInfo.Request - (*GetModuleInfo_Response)(nil), // 31: proto.GetModuleInfo.Response - nil, // 32: proto.GetModuleInfo.Response.DataEntry - (*GetModuleInfo_Response_ModuleInfo)(nil), // 33: proto.GetModuleInfo.Response.ModuleInfo - nil, // 34: proto.GetModuleInfo.Response.ModuleInfo.ExtrasEntry - (*GetModuleInfo_Response_ModuleInfo_ModuleFile)(nil), // 35: proto.GetModuleInfo.Response.ModuleInfo.ModuleFile + (*ValidateProviderConfig)(nil), // 13: proto.ValidateProviderConfig + (*GetModuleInfo)(nil), // 14: proto.GetModuleInfo + (*Table)(nil), // 15: proto.Table + (*Column)(nil), // 16: proto.Column + (*ColumnMeta)(nil), // 17: proto.ColumnMeta + (*ResolverMeta)(nil), // 18: proto.ResolverMeta + (*TableCreationOptions)(nil), // 19: proto.TableCreationOptions + (*ConnectionDetails)(nil), // 20: proto.ConnectionDetails + (*ConfigureProvider_Request)(nil), // 21: proto.ConfigureProvider.Request + (*ConfigureProvider_Response)(nil), // 22: proto.ConfigureProvider.Response + (*FetchResources_Request)(nil), // 23: proto.FetchResources.Request + (*FetchResources_Response)(nil), // 24: proto.FetchResources.Response + nil, // 25: proto.FetchResources.Response.FinishedResourcesEntry + (*GetProviderSchema_Request)(nil), // 26: proto.GetProviderSchema.Request + (*GetProviderSchema_Response)(nil), // 27: proto.GetProviderSchema.Response + nil, // 28: proto.GetProviderSchema.Response.ResourceTablesEntry + (*GetProviderConfig_Request)(nil), // 29: proto.GetProviderConfig.Request + (*GetProviderConfig_Response)(nil), // 30: proto.GetProviderConfig.Response + (*ValidateProviderConfig_Request)(nil), // 31: proto.ValidateProviderConfig.Request + (*ValidateProviderConfig_Response)(nil), // 32: proto.ValidateProviderConfig.Response + (*GetModuleInfo_Request)(nil), // 33: proto.GetModuleInfo.Request + (*GetModuleInfo_Response)(nil), // 34: proto.GetModuleInfo.Response + nil, // 35: proto.GetModuleInfo.Response.DataEntry + (*GetModuleInfo_Response_ModuleInfo)(nil), // 36: proto.GetModuleInfo.Response.ModuleInfo + nil, // 37: proto.GetModuleInfo.Response.ModuleInfo.ExtrasEntry + (*GetModuleInfo_Response_ModuleInfo_ModuleFile)(nil), // 38: proto.GetModuleInfo.Response.ModuleInfo.ModuleFile } var file_internal_plugin_proto_depIdxs = []int32{ 3, // 0: proto.ResourceFetchSummary.status:type_name -> proto.ResourceFetchSummary.Status @@ -2299,43 +2449,46 @@ var file_internal_plugin_proto_depIdxs = []int32{ 4, // 2: proto.Diagnostic.type:type_name -> proto.Diagnostic.Type 5, // 3: proto.Diagnostic.severity:type_name -> proto.Diagnostic.Severity 10, // 4: proto.Diagnostic.redacted:type_name -> proto.Diagnostic - 15, // 5: proto.Table.columns:type_name -> proto.Column - 14, // 6: proto.Table.relations:type_name -> proto.Table - 18, // 7: proto.Table.options:type_name -> proto.TableCreationOptions + 16, // 5: proto.Table.columns:type_name -> proto.Column + 15, // 6: proto.Table.relations:type_name -> proto.Table + 19, // 7: proto.Table.options:type_name -> proto.TableCreationOptions 1, // 8: proto.Column.type:type_name -> proto.ColumnType - 16, // 9: proto.Column.meta:type_name -> proto.ColumnMeta - 17, // 10: proto.ColumnMeta.resolver:type_name -> proto.ResolverMeta + 17, // 9: proto.Column.meta:type_name -> proto.ColumnMeta + 18, // 10: proto.ColumnMeta.resolver:type_name -> proto.ResolverMeta 2, // 11: proto.ConnectionDetails.type:type_name -> proto.ConnectionType - 19, // 12: proto.ConfigureProvider.Request.connection:type_name -> proto.ConnectionDetails + 20, // 12: proto.ConfigureProvider.Request.connection:type_name -> proto.ConnectionDetails 0, // 13: proto.ConfigureProvider.Request.format:type_name -> proto.ConfigFormat 10, // 14: proto.ConfigureProvider.Response.diagnostics:type_name -> proto.Diagnostic - 24, // 15: proto.FetchResources.Response.finished_resources:type_name -> proto.FetchResources.Response.FinishedResourcesEntry + 25, // 15: proto.FetchResources.Response.finished_resources:type_name -> proto.FetchResources.Response.FinishedResourcesEntry 9, // 16: proto.FetchResources.Response.partial_fetch_failed_resources:type_name -> proto.PartialFetchFailedResource 8, // 17: proto.FetchResources.Response.summary:type_name -> proto.ResourceFetchSummary - 27, // 18: proto.GetProviderSchema.Response.resource_tables:type_name -> proto.GetProviderSchema.Response.ResourceTablesEntry - 14, // 19: proto.GetProviderSchema.Response.ResourceTablesEntry.value:type_name -> proto.Table + 28, // 18: proto.GetProviderSchema.Response.resource_tables:type_name -> proto.GetProviderSchema.Response.ResourceTablesEntry + 15, // 19: proto.GetProviderSchema.Response.ResourceTablesEntry.value:type_name -> proto.Table 0, // 20: proto.GetProviderConfig.Request.format:type_name -> proto.ConfigFormat 0, // 21: proto.GetProviderConfig.Response.format:type_name -> proto.ConfigFormat - 32, // 22: proto.GetModuleInfo.Response.data:type_name -> proto.GetModuleInfo.Response.DataEntry - 10, // 23: proto.GetModuleInfo.Response.diagnostics:type_name -> proto.Diagnostic - 33, // 24: proto.GetModuleInfo.Response.DataEntry.value:type_name -> proto.GetModuleInfo.Response.ModuleInfo - 35, // 25: proto.GetModuleInfo.Response.ModuleInfo.files:type_name -> proto.GetModuleInfo.Response.ModuleInfo.ModuleFile - 34, // 26: proto.GetModuleInfo.Response.ModuleInfo.extras:type_name -> proto.GetModuleInfo.Response.ModuleInfo.ExtrasEntry - 25, // 27: proto.Provider.GetProviderSchema:input_type -> proto.GetProviderSchema.Request - 28, // 28: proto.Provider.GetProviderConfig:input_type -> proto.GetProviderConfig.Request - 20, // 29: proto.Provider.ConfigureProvider:input_type -> proto.ConfigureProvider.Request - 22, // 30: proto.Provider.FetchResources:input_type -> proto.FetchResources.Request - 30, // 31: proto.Provider.GetModuleInfo:input_type -> proto.GetModuleInfo.Request - 26, // 32: proto.Provider.GetProviderSchema:output_type -> proto.GetProviderSchema.Response - 29, // 33: proto.Provider.GetProviderConfig:output_type -> proto.GetProviderConfig.Response - 21, // 34: proto.Provider.ConfigureProvider:output_type -> proto.ConfigureProvider.Response - 23, // 35: proto.Provider.FetchResources:output_type -> proto.FetchResources.Response - 31, // 36: proto.Provider.GetModuleInfo:output_type -> proto.GetModuleInfo.Response - 32, // [32:37] is the sub-list for method output_type - 27, // [27:32] is the sub-list for method input_type - 27, // [27:27] is the sub-list for extension type_name - 27, // [27:27] is the sub-list for extension extendee - 0, // [0:27] is the sub-list for field type_name + 10, // 22: proto.ValidateProviderConfig.Response.diagnostics:type_name -> proto.Diagnostic + 35, // 23: proto.GetModuleInfo.Response.data:type_name -> proto.GetModuleInfo.Response.DataEntry + 10, // 24: proto.GetModuleInfo.Response.diagnostics:type_name -> proto.Diagnostic + 36, // 25: proto.GetModuleInfo.Response.DataEntry.value:type_name -> proto.GetModuleInfo.Response.ModuleInfo + 38, // 26: proto.GetModuleInfo.Response.ModuleInfo.files:type_name -> proto.GetModuleInfo.Response.ModuleInfo.ModuleFile + 37, // 27: proto.GetModuleInfo.Response.ModuleInfo.extras:type_name -> proto.GetModuleInfo.Response.ModuleInfo.ExtrasEntry + 26, // 28: proto.Provider.GetProviderSchema:input_type -> proto.GetProviderSchema.Request + 29, // 29: proto.Provider.GetProviderConfig:input_type -> proto.GetProviderConfig.Request + 31, // 30: proto.Provider.ValidateProviderConfig:input_type -> proto.ValidateProviderConfig.Request + 21, // 31: proto.Provider.ConfigureProvider:input_type -> proto.ConfigureProvider.Request + 23, // 32: proto.Provider.FetchResources:input_type -> proto.FetchResources.Request + 33, // 33: proto.Provider.GetModuleInfo:input_type -> proto.GetModuleInfo.Request + 27, // 34: proto.Provider.GetProviderSchema:output_type -> proto.GetProviderSchema.Response + 30, // 35: proto.Provider.GetProviderConfig:output_type -> proto.GetProviderConfig.Response + 32, // 36: proto.Provider.ValidateProviderConfig:output_type -> proto.ValidateProviderConfig.Response + 22, // 37: proto.Provider.ConfigureProvider:output_type -> proto.ConfigureProvider.Response + 24, // 38: proto.Provider.FetchResources:output_type -> proto.FetchResources.Response + 34, // 39: proto.Provider.GetModuleInfo:output_type -> proto.GetModuleInfo.Response + 34, // [34:40] is the sub-list for method output_type + 28, // [28:34] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name } func init() { file_internal_plugin_proto_init() } @@ -2429,7 +2582,7 @@ func file_internal_plugin_proto_init() { } } file_internal_plugin_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetModuleInfo); i { + switch v := v.(*ValidateProviderConfig); i { case 0: return &v.state case 1: @@ -2441,7 +2594,7 @@ func file_internal_plugin_proto_init() { } } file_internal_plugin_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Table); i { + switch v := v.(*GetModuleInfo); i { case 0: return &v.state case 1: @@ -2453,7 +2606,7 @@ func file_internal_plugin_proto_init() { } } file_internal_plugin_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Column); i { + switch v := v.(*Table); i { case 0: return &v.state case 1: @@ -2465,7 +2618,7 @@ func file_internal_plugin_proto_init() { } } file_internal_plugin_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ColumnMeta); i { + switch v := v.(*Column); i { case 0: return &v.state case 1: @@ -2477,7 +2630,7 @@ func file_internal_plugin_proto_init() { } } file_internal_plugin_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResolverMeta); i { + switch v := v.(*ColumnMeta); i { case 0: return &v.state case 1: @@ -2489,7 +2642,7 @@ func file_internal_plugin_proto_init() { } } file_internal_plugin_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TableCreationOptions); i { + switch v := v.(*ResolverMeta); i { case 0: return &v.state case 1: @@ -2501,7 +2654,7 @@ func file_internal_plugin_proto_init() { } } file_internal_plugin_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConnectionDetails); i { + switch v := v.(*TableCreationOptions); i { case 0: return &v.state case 1: @@ -2513,7 +2666,7 @@ func file_internal_plugin_proto_init() { } } file_internal_plugin_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigureProvider_Request); i { + switch v := v.(*ConnectionDetails); i { case 0: return &v.state case 1: @@ -2525,7 +2678,7 @@ func file_internal_plugin_proto_init() { } } file_internal_plugin_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigureProvider_Response); i { + switch v := v.(*ConfigureProvider_Request); i { case 0: return &v.state case 1: @@ -2537,7 +2690,7 @@ func file_internal_plugin_proto_init() { } } file_internal_plugin_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FetchResources_Request); i { + switch v := v.(*ConfigureProvider_Response); i { case 0: return &v.state case 1: @@ -2549,6 +2702,18 @@ func file_internal_plugin_proto_init() { } } file_internal_plugin_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchResources_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_plugin_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FetchResources_Response); i { case 0: return &v.state @@ -2560,7 +2725,7 @@ func file_internal_plugin_proto_init() { return nil } } - file_internal_plugin_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_internal_plugin_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetProviderSchema_Request); i { case 0: return &v.state @@ -2572,7 +2737,7 @@ func file_internal_plugin_proto_init() { return nil } } - file_internal_plugin_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_internal_plugin_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetProviderSchema_Response); i { case 0: return &v.state @@ -2584,7 +2749,7 @@ func file_internal_plugin_proto_init() { return nil } } - file_internal_plugin_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_internal_plugin_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetProviderConfig_Request); i { case 0: return &v.state @@ -2596,7 +2761,7 @@ func file_internal_plugin_proto_init() { return nil } } - file_internal_plugin_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_internal_plugin_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetProviderConfig_Response); i { case 0: return &v.state @@ -2608,7 +2773,31 @@ func file_internal_plugin_proto_init() { return nil } } - file_internal_plugin_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_internal_plugin_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateProviderConfig_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_plugin_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateProviderConfig_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_plugin_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetModuleInfo_Request); i { case 0: return &v.state @@ -2620,7 +2809,7 @@ func file_internal_plugin_proto_init() { return nil } } - file_internal_plugin_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_internal_plugin_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetModuleInfo_Response); i { case 0: return &v.state @@ -2632,7 +2821,7 @@ func file_internal_plugin_proto_init() { return nil } } - file_internal_plugin_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_internal_plugin_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetModuleInfo_Response_ModuleInfo); i { case 0: return &v.state @@ -2644,7 +2833,7 @@ func file_internal_plugin_proto_init() { return nil } } - file_internal_plugin_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_internal_plugin_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetModuleInfo_Response_ModuleInfo_ModuleFile); i { case 0: return &v.state @@ -2657,14 +2846,14 @@ func file_internal_plugin_proto_init() { } } } - file_internal_plugin_proto_msgTypes[8].OneofWrappers = []interface{}{} + file_internal_plugin_proto_msgTypes[9].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_internal_plugin_proto_rawDesc, NumEnums: 6, - NumMessages: 30, + NumMessages: 33, NumExtensions: 0, NumServices: 1, }, diff --git a/cqproto/internal/plugin.proto b/cqproto/internal/plugin.proto index 1adc0cb2..81bff48a 100644 --- a/cqproto/internal/plugin.proto +++ b/cqproto/internal/plugin.proto @@ -7,6 +7,8 @@ service Provider { rpc GetProviderSchema(GetProviderSchema.Request) returns (GetProviderSchema.Response); // Gets a provider's configuration example rpc GetProviderConfig(GetProviderConfig.Request) returns (GetProviderConfig.Response); + // Validates a config for the provider + rpc ValidateProviderConfig(ValidateProviderConfig.Request) returns (ValidateProviderConfig.Response); // One-time initialization, called before other functions below rpc ConfigureProvider(ConfigureProvider.Request) returns (ConfigureProvider.Response); // Fetch Provider Resources @@ -34,7 +36,6 @@ message ConfigureProvider { } } - message FetchResources { message Request { // list of resources provider is requested to fetch @@ -155,6 +156,15 @@ message GetProviderConfig { } } +message ValidateProviderConfig { + message Request { + bytes config = 1; + } + message Response { + repeated Diagnostic diagnostics = 1; + } +} + message GetModuleInfo { message Request { string module = 1; diff --git a/cqproto/internal/plugin_grpc.pb.go b/cqproto/internal/plugin_grpc.pb.go index 8b0a228a..95bea7d5 100644 --- a/cqproto/internal/plugin_grpc.pb.go +++ b/cqproto/internal/plugin_grpc.pb.go @@ -22,6 +22,8 @@ type ProviderClient interface { GetProviderSchema(ctx context.Context, in *GetProviderSchema_Request, opts ...grpc.CallOption) (*GetProviderSchema_Response, error) // Gets a provider's configuration example GetProviderConfig(ctx context.Context, in *GetProviderConfig_Request, opts ...grpc.CallOption) (*GetProviderConfig_Response, error) + // Validates a config for the provider + ValidateProviderConfig(ctx context.Context, in *ValidateProviderConfig_Request, opts ...grpc.CallOption) (*ValidateProviderConfig_Response, error) // One-time initialization, called before other functions below ConfigureProvider(ctx context.Context, in *ConfigureProvider_Request, opts ...grpc.CallOption) (*ConfigureProvider_Response, error) // Fetch Provider Resources @@ -56,6 +58,15 @@ func (c *providerClient) GetProviderConfig(ctx context.Context, in *GetProviderC return out, nil } +func (c *providerClient) ValidateProviderConfig(ctx context.Context, in *ValidateProviderConfig_Request, opts ...grpc.CallOption) (*ValidateProviderConfig_Response, error) { + out := new(ValidateProviderConfig_Response) + err := c.cc.Invoke(ctx, "/proto.Provider/ValidateProviderConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *providerClient) ConfigureProvider(ctx context.Context, in *ConfigureProvider_Request, opts ...grpc.CallOption) (*ConfigureProvider_Response, error) { out := new(ConfigureProvider_Response) err := c.cc.Invoke(ctx, "/proto.Provider/ConfigureProvider", in, out, opts...) @@ -114,6 +125,8 @@ type ProviderServer interface { GetProviderSchema(context.Context, *GetProviderSchema_Request) (*GetProviderSchema_Response, error) // Gets a provider's configuration example GetProviderConfig(context.Context, *GetProviderConfig_Request) (*GetProviderConfig_Response, error) + // Validates a config for the provider + ValidateProviderConfig(context.Context, *ValidateProviderConfig_Request) (*ValidateProviderConfig_Response, error) // One-time initialization, called before other functions below ConfigureProvider(context.Context, *ConfigureProvider_Request) (*ConfigureProvider_Response, error) // Fetch Provider Resources @@ -133,6 +146,9 @@ func (UnimplementedProviderServer) GetProviderSchema(context.Context, *GetProvid func (UnimplementedProviderServer) GetProviderConfig(context.Context, *GetProviderConfig_Request) (*GetProviderConfig_Response, error) { return nil, status.Errorf(codes.Unimplemented, "method GetProviderConfig not implemented") } +func (UnimplementedProviderServer) ValidateProviderConfig(context.Context, *ValidateProviderConfig_Request) (*ValidateProviderConfig_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateProviderConfig not implemented") +} func (UnimplementedProviderServer) ConfigureProvider(context.Context, *ConfigureProvider_Request) (*ConfigureProvider_Response, error) { return nil, status.Errorf(codes.Unimplemented, "method ConfigureProvider not implemented") } @@ -191,6 +207,24 @@ func _Provider_GetProviderConfig_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } +func _Provider_ValidateProviderConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidateProviderConfig_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProviderServer).ValidateProviderConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.Provider/ValidateProviderConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProviderServer).ValidateProviderConfig(ctx, req.(*ValidateProviderConfig_Request)) + } + return interceptor(ctx, in, info, handler) +} + func _Provider_ConfigureProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ConfigureProvider_Request) if err := dec(in); err != nil { @@ -263,6 +297,10 @@ var Provider_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetProviderConfig", Handler: _Provider_GetProviderConfig_Handler, }, + { + MethodName: "ValidateProviderConfig", + Handler: _Provider_ValidateProviderConfig_Handler, + }, { MethodName: "ConfigureProvider", Handler: _Provider_ConfigureProvider_Handler, diff --git a/cqproto/provider.go b/cqproto/provider.go index 57670081..bd5794b6 100644 --- a/cqproto/provider.go +++ b/cqproto/provider.go @@ -73,6 +73,15 @@ type GetProviderConfigResponse struct { Format internal.ConfigFormat // Deprecated } +type ValidateProviderConfigRequest struct { + // Config is the configuration the user supplied for the provider + Config []byte +} + +type ValidateProviderConfigResponse struct { + Diagnostics diag.Diagnostics +} + type ConfigureProviderRequest struct { // CloudQueryVersion is the version of CloudQuery executing the request. CloudQueryVersion string diff --git a/go.mod b/go.mod index b925df87..b6ab5e64 100644 --- a/go.mod +++ b/go.mod @@ -70,6 +70,9 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/objx v0.4.0 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect + github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect + github.com/xeipuuv/gojsonschema v1.2.0 // indirect github.com/zclconf/go-cty v1.9.1 // indirect go.uber.org/atomic v1.7.0 // indirect golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 // indirect diff --git a/go.sum b/go.sum index 2613c8e7..f1464bf9 100644 --- a/go.sum +++ b/go.sum @@ -1187,9 +1187,13 @@ github.com/xanzy/go-gitlab v0.15.0/go.mod h1:8zdQa/ri1dfn8eS3Ir1SyfvOKlw7WBJ8DVT github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xo/dburl v0.11.0 h1:AVtiIKI5VpKdfuEBvTEMsLoY3MW6+uHTm5Eeuvt6Olo= github.com/xo/dburl v0.11.0/go.mod h1:3i+BAX1bQngTMtk8dtGUTTUviVymLIViDtYHDP5NTMU= diff --git a/provider/provider.go b/provider/provider.go index 78908f3e..1529f810 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -1,7 +1,9 @@ package provider import ( + "bytes" "context" + "errors" "fmt" "os" "sort" @@ -21,6 +23,7 @@ import ( "github.com/creasty/defaults" "github.com/hashicorp/go-hclog" "github.com/thoas/go-funk" + "github.com/xeipuuv/gojsonschema" "golang.org/x/sync/errgroup" "golang.org/x/sync/semaphore" "gopkg.in/yaml.v3" @@ -44,6 +47,8 @@ type Provider struct { ResourceMap map[string]*schema.Table // Configuration decoded from configure request Config func() Config + // ConfigSchema returns the JSON schema for the config + ConfigSchema string // Logger to call, this logger is passed to the serve.Serve Client, if not define Serve will create one instead. Logger hclog.Logger // ErrorClassifier allows the provider to classify errors it produces during table execution, and return them as diagnostics to the user. @@ -120,7 +125,64 @@ func (p *Provider) GetProviderConfig(_ context.Context, req *cqproto.GetProvider }, nil } -func (p *Provider) ConfigureProvider(_ context.Context, request *cqproto.ConfigureProviderRequest) (*cqproto.ConfigureProviderResponse, error) { +func (p *Provider) ValidateProviderConfig(_ context.Context, request *cqproto.ValidateProviderConfigRequest) (*cqproto.ValidateProviderConfigResponse, error) { + if len(request.Config) == 0 { + return &cqproto.ValidateProviderConfigResponse{}, nil + } + + providerConfig := p.Config() + if err := defaults.Set(providerConfig); err != nil { + return &cqproto.ValidateProviderConfigResponse{ + Diagnostics: diag.FromError(err, diag.INTERNAL), + }, nil + } + + d := yaml.NewDecoder(bytes.NewReader(request.Config)) + d.KnownFields(true) + if err := d.Decode(providerConfig); err != nil { + p.Logger.Error("Failed to load configuration.", "error", err) + return &cqproto.ValidateProviderConfigResponse{ + Diagnostics: diag.FromError(err, diag.USER), + }, nil + } + + if p.ConfigSchema == "" { + // no schema: Everything is valid. Parse config succeeded, assume success + return &cqproto.ValidateProviderConfigResponse{}, nil + } + + // Validate using given schema + schemaLoader := gojsonschema.NewStringLoader(p.ConfigSchema) + documentLoader := gojsonschema.NewGoLoader(providerConfig) + result, err := gojsonschema.Validate(schemaLoader, documentLoader) + if err != nil { + return &cqproto.ValidateProviderConfigResponse{ + Diagnostics: diag.FromError(err, diag.USER, diag.WithSummary("Failed to validate config")), + }, nil + } + if !result.Valid() { + errs := result.Errors() + if len(errs) == 0 { + return &cqproto.ValidateProviderConfigResponse{ + Diagnostics: diag.FromError(errors.New("Failed to validate config with schema"), diag.USER, diag.WithSummary("Invalid configuration")), + }, nil + } + var diags diag.Diagnostics + for _, e := range errs { + diags = diags.Add( + diag.FromError(errors.New(e.String()), diag.USER, diag.WithDetails("%s", e.Description()), diag.WithSummary("Config field %q has error of type %s", e.Field(), e.Type())), + ) + } + return &cqproto.ValidateProviderConfigResponse{ + Diagnostics: diags, + }, nil + } + + // success + return &cqproto.ValidateProviderConfigResponse{}, nil +} + +func (p *Provider) ConfigureProvider(ctx context.Context, request *cqproto.ConfigureProviderRequest) (*cqproto.ConfigureProviderResponse, error) { if p.Logger == nil { return &cqproto.ConfigureProviderResponse{ Diagnostics: diag.FromError(fmt.Errorf("provider %s logger not defined, make sure to run it with serve", p.Name), diag.INTERNAL), @@ -145,12 +207,29 @@ func (p *Provider) ConfigureProvider(_ context.Context, request *cqproto.Configu } } + var diags diag.Diagnostics + + // validate provider configuration before proceeding + validateResponse, err := p.ValidateProviderConfig(ctx, &cqproto.ValidateProviderConfigRequest{Config: request.Config}) + if err != nil { + return &cqproto.ConfigureProviderResponse{ + Diagnostics: diag.FromError(err, diag.INTERNAL, diag.WithSummary("ValidateProviderConfig failed")), + }, nil + } else if validateResponse != nil { + diags = diags.Add(validateResponse.Diagnostics) + } + if diags.HasErrors() { + return &cqproto.ConfigureProviderResponse{ + Diagnostics: diags, + }, nil + } + p.dbURL = request.Connection.DSN providerConfig := p.Config() if err := defaults.Set(providerConfig); err != nil { return &cqproto.ConfigureProviderResponse{ - Diagnostics: diag.FromError(err, diag.INTERNAL), + Diagnostics: diags.Add(diag.FromError(err, diag.INTERNAL)), }, nil } @@ -158,15 +237,18 @@ func (p *Provider) ConfigureProvider(_ context.Context, request *cqproto.Configu if len(request.Config) == 0 { p.Logger.Info("Received empty configuration, using only defaults") } else { - if err := yaml.Unmarshal(request.Config, providerConfig); err != nil { + d := yaml.NewDecoder(bytes.NewReader(request.Config)) + d.KnownFields(true) + if err := d.Decode(providerConfig); err != nil { p.Logger.Error("Failed to load configuration.", "error", err) return &cqproto.ConfigureProviderResponse{ - Diagnostics: diag.FromError(err, diag.USER), + Diagnostics: diags.Add(diag.FromError(err, diag.USER)), }, nil } } - client, diags := p.Configure(p.Logger, providerConfig) + client, moreDiags := p.Configure(p.Logger, providerConfig) + diags = diags.Add(moreDiags) if diags.HasErrors() { return &cqproto.ConfigureProviderResponse{ Diagnostics: diags,