diff --git a/generated/scanner/api/v1/component.pb.go b/generated/scanner/api/v1/component.pb.go index 69e01489f..7d769b3e5 100644 --- a/generated/scanner/api/v1/component.pb.go +++ b/generated/scanner/api/v1/component.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.36.0 // protoc v3.21.4 // source: scanner/api/v1/component.proto @@ -79,24 +79,21 @@ func (SourceType) EnumDescriptor() ([]byte, []int) { } type Components struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` - OsComponents []*OSComponent `protobuf:"bytes,1,rep,name=os_components,json=osComponents,proto3" json:"os_components,omitempty"` - RhelComponents []*RHELComponent `protobuf:"bytes,2,rep,name=rhel_components,json=rhelComponents,proto3" json:"rhel_components,omitempty"` - LanguageComponents []*LanguageComponent `protobuf:"bytes,3,rep,name=language_components,json=languageComponents,proto3" json:"language_components,omitempty"` - RhelContentSets []string `protobuf:"bytes,5,rep,name=rhel_content_sets,json=rhelContentSets,proto3" json:"rhel_content_sets,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` + OsComponents []*OSComponent `protobuf:"bytes,1,rep,name=os_components,json=osComponents,proto3" json:"os_components,omitempty"` + RhelComponents []*RHELComponent `protobuf:"bytes,2,rep,name=rhel_components,json=rhelComponents,proto3" json:"rhel_components,omitempty"` + LanguageComponents []*LanguageComponent `protobuf:"bytes,3,rep,name=language_components,json=languageComponents,proto3" json:"language_components,omitempty"` + RhelContentSets []string `protobuf:"bytes,5,rep,name=rhel_content_sets,json=rhelContentSets,proto3" json:"rhel_content_sets,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Components) Reset() { *x = Components{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_component_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_component_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Components) String() string { @@ -107,7 +104,7 @@ func (*Components) ProtoMessage() {} func (x *Components) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_component_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -158,24 +155,21 @@ func (x *Components) GetRhelContentSets() []string { } type OSComponent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + AddedBy string `protobuf:"bytes,4,opt,name=added_by,json=addedBy,proto3" json:"added_by,omitempty"` + Executables []*Executable `protobuf:"bytes,5,rep,name=executables,proto3" json:"executables,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - AddedBy string `protobuf:"bytes,4,opt,name=added_by,json=addedBy,proto3" json:"added_by,omitempty"` - Executables []*Executable `protobuf:"bytes,5,rep,name=executables,proto3" json:"executables,omitempty"` + sizeCache protoimpl.SizeCache } func (x *OSComponent) Reset() { *x = OSComponent{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_component_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_component_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *OSComponent) String() string { @@ -186,7 +180,7 @@ func (*OSComponent) ProtoMessage() {} func (x *OSComponent) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_component_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -237,28 +231,25 @@ func (x *OSComponent) GetExecutables() []*Executable { } type RHELComponent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + Arch string `protobuf:"bytes,5,opt,name=arch,proto3" json:"arch,omitempty"` + Module string `protobuf:"bytes,6,opt,name=module,proto3" json:"module,omitempty"` + Cpes []string `protobuf:"bytes,7,rep,name=cpes,proto3" json:"cpes,omitempty"` + AddedBy string `protobuf:"bytes,8,opt,name=added_by,json=addedBy,proto3" json:"added_by,omitempty"` + Executables []*Executable `protobuf:"bytes,9,rep,name=executables,proto3" json:"executables,omitempty"` unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` - Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - Arch string `protobuf:"bytes,5,opt,name=arch,proto3" json:"arch,omitempty"` - Module string `protobuf:"bytes,6,opt,name=module,proto3" json:"module,omitempty"` - Cpes []string `protobuf:"bytes,7,rep,name=cpes,proto3" json:"cpes,omitempty"` - AddedBy string `protobuf:"bytes,8,opt,name=added_by,json=addedBy,proto3" json:"added_by,omitempty"` - Executables []*Executable `protobuf:"bytes,9,rep,name=executables,proto3" json:"executables,omitempty"` + sizeCache protoimpl.SizeCache } func (x *RHELComponent) Reset() { *x = RHELComponent{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_component_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_component_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RHELComponent) String() string { @@ -269,7 +260,7 @@ func (*RHELComponent) ProtoMessage() {} func (x *RHELComponent) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_component_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -348,29 +339,26 @@ func (x *RHELComponent) GetExecutables() []*Executable { } type LanguageComponent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type SourceType `protobuf:"varint,1,opt,name=type,proto3,enum=scannerV1.SourceType" json:"type,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - Location string `protobuf:"bytes,4,opt,name=location,proto3" json:"location,omitempty"` - // Types that are assignable to Language: + state protoimpl.MessageState `protogen:"open.v1"` + Type SourceType `protobuf:"varint,1,opt,name=type,proto3,enum=scannerV1.SourceType" json:"type,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + Location string `protobuf:"bytes,4,opt,name=location,proto3" json:"location,omitempty"` + // Types that are valid to be assigned to Language: // // *LanguageComponent_Java // *LanguageComponent_Python - Language isLanguageComponent_Language `protobuf_oneof:"language"` - AddedBy string `protobuf:"bytes,7,opt,name=added_by,json=addedBy,proto3" json:"added_by,omitempty"` + Language isLanguageComponent_Language `protobuf_oneof:"language"` + AddedBy string `protobuf:"bytes,7,opt,name=added_by,json=addedBy,proto3" json:"added_by,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *LanguageComponent) Reset() { *x = LanguageComponent{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_component_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_component_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *LanguageComponent) String() string { @@ -381,7 +369,7 @@ func (*LanguageComponent) ProtoMessage() {} func (x *LanguageComponent) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_component_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -424,23 +412,27 @@ func (x *LanguageComponent) GetLocation() string { return "" } -func (m *LanguageComponent) GetLanguage() isLanguageComponent_Language { - if m != nil { - return m.Language +func (x *LanguageComponent) GetLanguage() isLanguageComponent_Language { + if x != nil { + return x.Language } return nil } func (x *LanguageComponent) GetJava() *JavaComponent { - if x, ok := x.GetLanguage().(*LanguageComponent_Java); ok { - return x.Java + if x != nil { + if x, ok := x.Language.(*LanguageComponent_Java); ok { + return x.Java + } } return nil } func (x *LanguageComponent) GetPython() *PythonComponent { - if x, ok := x.GetLanguage().(*LanguageComponent_Python); ok { - return x.Python + if x != nil { + if x, ok := x.Language.(*LanguageComponent_Python); ok { + return x.Python + } } return nil } @@ -469,24 +461,21 @@ func (*LanguageComponent_Java) isLanguageComponent_Language() {} func (*LanguageComponent_Python) isLanguageComponent_Language() {} type JavaComponent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ImplementationVersion string `protobuf:"bytes,1,opt,name=implementation_version,json=implementationVersion,proto3" json:"implementation_version,omitempty"` - MavenVersion string `protobuf:"bytes,2,opt,name=maven_version,json=mavenVersion,proto3" json:"maven_version,omitempty"` - Origins []string `protobuf:"bytes,3,rep,name=origins,proto3" json:"origins,omitempty"` - SpecificationVersion string `protobuf:"bytes,4,opt,name=specification_version,json=specificationVersion,proto3" json:"specification_version,omitempty"` - BundleName string `protobuf:"bytes,5,opt,name=bundle_name,json=bundleName,proto3" json:"bundle_name,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ImplementationVersion string `protobuf:"bytes,1,opt,name=implementation_version,json=implementationVersion,proto3" json:"implementation_version,omitempty"` + MavenVersion string `protobuf:"bytes,2,opt,name=maven_version,json=mavenVersion,proto3" json:"maven_version,omitempty"` + Origins []string `protobuf:"bytes,3,rep,name=origins,proto3" json:"origins,omitempty"` + SpecificationVersion string `protobuf:"bytes,4,opt,name=specification_version,json=specificationVersion,proto3" json:"specification_version,omitempty"` + BundleName string `protobuf:"bytes,5,opt,name=bundle_name,json=bundleName,proto3" json:"bundle_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *JavaComponent) Reset() { *x = JavaComponent{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_component_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_component_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *JavaComponent) String() string { @@ -497,7 +486,7 @@ func (*JavaComponent) ProtoMessage() {} func (x *JavaComponent) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_component_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -548,24 +537,21 @@ func (x *JavaComponent) GetBundleName() string { } type PythonComponent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Homepage string `protobuf:"bytes,1,opt,name=homepage,proto3" json:"homepage,omitempty"` + AuthorEmail string `protobuf:"bytes,2,opt,name=author_email,json=authorEmail,proto3" json:"author_email,omitempty"` + DownloadUrl string `protobuf:"bytes,3,opt,name=download_url,json=downloadUrl,proto3" json:"download_url,omitempty"` + Summary string `protobuf:"bytes,4,opt,name=summary,proto3" json:"summary,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` unknownFields protoimpl.UnknownFields - - Homepage string `protobuf:"bytes,1,opt,name=homepage,proto3" json:"homepage,omitempty"` - AuthorEmail string `protobuf:"bytes,2,opt,name=author_email,json=authorEmail,proto3" json:"author_email,omitempty"` - DownloadUrl string `protobuf:"bytes,3,opt,name=download_url,json=downloadUrl,proto3" json:"download_url,omitempty"` - Summary string `protobuf:"bytes,4,opt,name=summary,proto3" json:"summary,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + sizeCache protoimpl.SizeCache } func (x *PythonComponent) Reset() { *x = PythonComponent{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_component_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_component_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PythonComponent) String() string { @@ -576,7 +562,7 @@ func (*PythonComponent) ProtoMessage() {} func (x *PythonComponent) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_component_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -780,80 +766,6 @@ func file_scanner_api_v1_component_proto_init() { return } file_scanner_api_v1_vulnerability_proto_init() - if !protoimpl.UnsafeEnabled { - file_scanner_api_v1_component_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Components); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_component_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*OSComponent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_component_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*RHELComponent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_component_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*LanguageComponent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_component_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*JavaComponent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_component_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*PythonComponent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_scanner_api_v1_component_proto_msgTypes[3].OneofWrappers = []any{ (*LanguageComponent_Java)(nil), (*LanguageComponent_Python)(nil), diff --git a/generated/scanner/api/v1/component_vtproto.pb.go b/generated/scanner/api/v1/component_vtproto.pb.go index 7321b8c95..08cc1888d 100644 --- a/generated/scanner/api/v1/component_vtproto.pb.go +++ b/generated/scanner/api/v1/component_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.6.0 +// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10 // source: scanner/api/v1/component.proto package scannerV1 @@ -912,6 +912,10 @@ func (m *LanguageComponent_Java) MarshalToSizedBufferVT(dAtA []byte) (int, error i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x2a } return len(dAtA) - i, nil } @@ -931,6 +935,10 @@ func (m *LanguageComponent_Python) MarshalToSizedBufferVT(dAtA []byte) (int, err i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x32 + } else { + i = protohelpers.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x32 } return len(dAtA) - i, nil } @@ -1232,6 +1240,8 @@ func (m *LanguageComponent_Java) SizeVT() (n int) { if m.Java != nil { l = m.Java.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 3 } return n } @@ -1244,6 +1254,8 @@ func (m *LanguageComponent_Python) SizeVT() (n int) { if m.Python != nil { l = m.Python.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } else { + n += 3 } return n } diff --git a/generated/scanner/api/v1/empty.pb.go b/generated/scanner/api/v1/empty.pb.go index efa661f4c..149ec8b3e 100644 --- a/generated/scanner/api/v1/empty.pb.go +++ b/generated/scanner/api/v1/empty.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.36.0 // protoc v3.21.4 // source: scanner/api/v1/empty.proto @@ -21,18 +21,16 @@ const ( ) type Empty struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Empty) Reset() { *x = Empty{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_empty_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_empty_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Empty) String() string { @@ -43,7 +41,7 @@ func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_empty_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -99,20 +97,6 @@ func file_scanner_api_v1_empty_proto_init() { if File_scanner_api_v1_empty_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_scanner_api_v1_empty_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Empty); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/generated/scanner/api/v1/empty_vtproto.pb.go b/generated/scanner/api/v1/empty_vtproto.pb.go index 1796491fa..41979ae8b 100644 --- a/generated/scanner/api/v1/empty_vtproto.pb.go +++ b/generated/scanner/api/v1/empty_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.6.0 +// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10 // source: scanner/api/v1/empty.proto package scannerV1 diff --git a/generated/scanner/api/v1/image.pb.go b/generated/scanner/api/v1/image.pb.go index 977c07538..aff251d52 100644 --- a/generated/scanner/api/v1/image.pb.go +++ b/generated/scanner/api/v1/image.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.36.0 // protoc v3.21.4 // source: scanner/api/v1/image.proto @@ -21,21 +21,18 @@ const ( ) type Image struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Features []*Feature `protobuf:"bytes,1,rep,name=features,proto3" json:"features,omitempty"` unknownFields protoimpl.UnknownFields - - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - Features []*Feature `protobuf:"bytes,1,rep,name=features,proto3" json:"features,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Image) Reset() { *x = Image{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Image) String() string { @@ -46,7 +43,7 @@ func (*Image) ProtoMessage() {} func (x *Image) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -126,20 +123,6 @@ func file_scanner_api_v1_image_proto_init() { return } file_scanner_api_v1_vulnerability_proto_init() - if !protoimpl.UnsafeEnabled { - file_scanner_api_v1_image_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Image); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/generated/scanner/api/v1/image_scan_service.pb.go b/generated/scanner/api/v1/image_scan_service.pb.go index 248c4e50f..8b153bad6 100644 --- a/generated/scanner/api/v1/image_scan_service.pb.go +++ b/generated/scanner/api/v1/image_scan_service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.36.0 // protoc v3.21.4 // source: scanner/api/v1/image_scan_service.proto @@ -73,24 +73,21 @@ func (ScanStatus) EnumDescriptor() ([]byte, []int) { } type ScanImageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` - Registry *RegistryData `protobuf:"bytes,2,opt,name=registry,proto3" json:"registry,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` + Registry *RegistryData `protobuf:"bytes,2,opt,name=registry,proto3" json:"registry,omitempty"` // uncertifiedRHEL tells the Scanner to scan the image // in an uncertified manner, if the image is RHEL-based. UncertifiedRHEL bool `protobuf:"varint,3,opt,name=uncertifiedRHEL,proto3" json:"uncertifiedRHEL,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ScanImageRequest) Reset() { *x = ScanImageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ScanImageRequest) String() string { @@ -101,7 +98,7 @@ func (*ScanImageRequest) ProtoMessage() {} func (x *ScanImageRequest) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -138,22 +135,19 @@ func (x *ScanImageRequest) GetUncertifiedRHEL() bool { } type ScanImageResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ScannerVersion string `protobuf:"bytes,3,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` - Status ScanStatus `protobuf:"varint,1,opt,name=status,proto3,enum=scannerV1.ScanStatus" json:"status,omitempty"` - Image *ImageSpec `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ScannerVersion string `protobuf:"bytes,3,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` + Status ScanStatus `protobuf:"varint,1,opt,name=status,proto3,enum=scannerV1.ScanStatus" json:"status,omitempty"` + Image *ImageSpec `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ScanImageResponse) Reset() { *x = ScanImageResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ScanImageResponse) String() string { @@ -164,7 +158,7 @@ func (*ScanImageResponse) ProtoMessage() {} func (x *ScanImageResponse) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -201,10 +195,7 @@ func (x *ScanImageResponse) GetImage() *ImageSpec { } type GetImageScanRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Only one of the fields in ImageSpec needs to be set for the request to be properly formed // If both are set, then digest is used ImageSpec *ImageSpec `protobuf:"bytes,1,opt,name=image_spec,json=imageSpec,proto3" json:"image_spec,omitempty"` @@ -212,15 +203,15 @@ type GetImageScanRequest struct { // return uncertified scan results for the given RHEL-based image // (if the image is RHEL-based). UncertifiedRHEL bool `protobuf:"varint,2,opt,name=uncertifiedRHEL,proto3" json:"uncertifiedRHEL,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetImageScanRequest) Reset() { *x = GetImageScanRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetImageScanRequest) String() string { @@ -231,7 +222,7 @@ func (*GetImageScanRequest) ProtoMessage() {} func (x *GetImageScanRequest) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -262,23 +253,20 @@ func (x *GetImageScanRequest) GetUncertifiedRHEL() bool { // Next tag: 5 type GetImageScanResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ScannerVersion string `protobuf:"bytes,4,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` - Status ScanStatus `protobuf:"varint,1,opt,name=status,proto3,enum=scannerV1.ScanStatus" json:"status,omitempty"` - Image *Image `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` - Notes []Note `protobuf:"varint,3,rep,packed,name=notes,proto3,enum=scannerV1.Note" json:"notes,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ScannerVersion string `protobuf:"bytes,4,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` + Status ScanStatus `protobuf:"varint,1,opt,name=status,proto3,enum=scannerV1.ScanStatus" json:"status,omitempty"` + Image *Image `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + Notes []Note `protobuf:"varint,3,rep,packed,name=notes,proto3,enum=scannerV1.Note" json:"notes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetImageScanResponse) Reset() { *x = GetImageScanResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetImageScanResponse) String() string { @@ -289,7 +277,7 @@ func (*GetImageScanResponse) ProtoMessage() {} func (x *GetImageScanResponse) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -333,21 +321,18 @@ func (x *GetImageScanResponse) GetNotes() []Note { } type GetImageComponentsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` + Registry *RegistryData `protobuf:"bytes,2,opt,name=registry,proto3" json:"registry,omitempty"` unknownFields protoimpl.UnknownFields - - Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` - Registry *RegistryData `protobuf:"bytes,2,opt,name=registry,proto3" json:"registry,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetImageComponentsRequest) Reset() { *x = GetImageComponentsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetImageComponentsRequest) String() string { @@ -358,7 +343,7 @@ func (*GetImageComponentsRequest) ProtoMessage() {} func (x *GetImageComponentsRequest) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -389,23 +374,20 @@ func (x *GetImageComponentsRequest) GetRegistry() *RegistryData { // Next tag: 5 type GetImageComponentsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ScannerVersion string `protobuf:"bytes,4,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` - Status ScanStatus `protobuf:"varint,1,opt,name=status,proto3,enum=scannerV1.ScanStatus" json:"status,omitempty"` - Components *Components `protobuf:"bytes,2,opt,name=components,proto3" json:"components,omitempty"` - Notes []Note `protobuf:"varint,3,rep,packed,name=notes,proto3,enum=scannerV1.Note" json:"notes,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ScannerVersion string `protobuf:"bytes,4,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` + Status ScanStatus `protobuf:"varint,1,opt,name=status,proto3,enum=scannerV1.ScanStatus" json:"status,omitempty"` + Components *Components `protobuf:"bytes,2,opt,name=components,proto3" json:"components,omitempty"` + Notes []Note `protobuf:"varint,3,rep,packed,name=notes,proto3,enum=scannerV1.Note" json:"notes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetImageComponentsResponse) Reset() { *x = GetImageComponentsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetImageComponentsResponse) String() string { @@ -416,7 +398,7 @@ func (*GetImageComponentsResponse) ProtoMessage() {} func (x *GetImageComponentsResponse) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -461,22 +443,19 @@ func (x *GetImageComponentsResponse) GetNotes() []Note { // Next tag: 4 type GetImageVulnerabilitiesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` + Components *Components `protobuf:"bytes,1,opt,name=components,proto3" json:"components,omitempty"` + Notes []Note `protobuf:"varint,2,rep,packed,name=notes,proto3,enum=scannerV1.Note" json:"notes,omitempty"` unknownFields protoimpl.UnknownFields - - Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` - Components *Components `protobuf:"bytes,1,opt,name=components,proto3" json:"components,omitempty"` - Notes []Note `protobuf:"varint,2,rep,packed,name=notes,proto3,enum=scannerV1.Note" json:"notes,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetImageVulnerabilitiesRequest) Reset() { *x = GetImageVulnerabilitiesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetImageVulnerabilitiesRequest) String() string { @@ -487,7 +466,7 @@ func (*GetImageVulnerabilitiesRequest) ProtoMessage() {} func (x *GetImageVulnerabilitiesRequest) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -524,22 +503,19 @@ func (x *GetImageVulnerabilitiesRequest) GetNotes() []Note { } type GetImageVulnerabilitiesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ScannerVersion string `protobuf:"bytes,3,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` - Status ScanStatus `protobuf:"varint,1,opt,name=status,proto3,enum=scannerV1.ScanStatus" json:"status,omitempty"` - Image *Image `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ScannerVersion string `protobuf:"bytes,3,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` + Status ScanStatus `protobuf:"varint,1,opt,name=status,proto3,enum=scannerV1.ScanStatus" json:"status,omitempty"` + Image *Image `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetImageVulnerabilitiesResponse) Reset() { *x = GetImageVulnerabilitiesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetImageVulnerabilitiesResponse) String() string { @@ -550,7 +526,7 @@ func (*GetImageVulnerabilitiesResponse) ProtoMessage() {} func (x *GetImageVulnerabilitiesResponse) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -587,10 +563,7 @@ func (x *GetImageVulnerabilitiesResponse) GetImage() *Image { } type GetLanguageLevelComponentsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Only one of the fields in ImageSpec needs to be set for the request to be properly formed // If both are set, then digest is used ImageSpec *ImageSpec `protobuf:"bytes,1,opt,name=image_spec,json=imageSpec,proto3" json:"image_spec,omitempty"` @@ -598,15 +571,15 @@ type GetLanguageLevelComponentsRequest struct { // return uncertified scan results for the given RHEL-based image // (if the image is RHEL-based). UncertifiedRHEL bool `protobuf:"varint,2,opt,name=uncertifiedRHEL,proto3" json:"uncertifiedRHEL,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetLanguageLevelComponentsRequest) Reset() { *x = GetLanguageLevelComponentsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetLanguageLevelComponentsRequest) String() string { @@ -617,7 +590,7 @@ func (*GetLanguageLevelComponentsRequest) ProtoMessage() {} func (x *GetLanguageLevelComponentsRequest) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -647,21 +620,18 @@ func (x *GetLanguageLevelComponentsRequest) GetUncertifiedRHEL() bool { } type GetLanguageLevelComponentsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` ScannerVersion string `protobuf:"bytes,2,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` - LayerToComponents map[string]*LanguageLevelComponents `protobuf:"bytes,1,rep,name=layer_to_components,json=layerToComponents,proto3" json:"layer_to_components,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + LayerToComponents map[string]*LanguageLevelComponents `protobuf:"bytes,1,rep,name=layer_to_components,json=layerToComponents,proto3" json:"layer_to_components,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetLanguageLevelComponentsResponse) Reset() { *x = GetLanguageLevelComponentsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetLanguageLevelComponentsResponse) String() string { @@ -672,7 +642,7 @@ func (*GetLanguageLevelComponentsResponse) ProtoMessage() {} func (x *GetLanguageLevelComponentsResponse) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -702,21 +672,18 @@ func (x *GetLanguageLevelComponentsResponse) GetLayerToComponents() map[string]* } type ImageSpec struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` + Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` unknownFields protoimpl.UnknownFields - - Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` - Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ImageSpec) Reset() { *x = ImageSpec{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ImageSpec) String() string { @@ -727,7 +694,7 @@ func (*ImageSpec) ProtoMessage() {} func (x *ImageSpec) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -757,23 +724,20 @@ func (x *ImageSpec) GetImage() string { } type RegistryData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` + Insecure bool `protobuf:"varint,4,opt,name=insecure,proto3" json:"insecure,omitempty"` unknownFields protoimpl.UnknownFields - - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` - Insecure bool `protobuf:"varint,4,opt,name=insecure,proto3" json:"insecure,omitempty"` + sizeCache protoimpl.SizeCache } func (x *RegistryData) Reset() { *x = RegistryData{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RegistryData) String() string { @@ -784,7 +748,7 @@ func (*RegistryData) ProtoMessage() {} func (x *RegistryData) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -828,20 +792,17 @@ func (x *RegistryData) GetInsecure() bool { } type LanguageLevelComponents struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Components []*LanguageLevelComponent `protobuf:"bytes,1,rep,name=components,proto3" json:"components,omitempty"` unknownFields protoimpl.UnknownFields - - Components []*LanguageLevelComponent `protobuf:"bytes,1,rep,name=components,proto3" json:"components,omitempty"` + sizeCache protoimpl.SizeCache } func (x *LanguageLevelComponents) Reset() { *x = LanguageLevelComponents{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *LanguageLevelComponents) String() string { @@ -852,7 +813,7 @@ func (*LanguageLevelComponents) ProtoMessage() {} func (x *LanguageLevelComponents) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -875,23 +836,20 @@ func (x *LanguageLevelComponents) GetComponents() []*LanguageLevelComponent { } type LanguageLevelComponent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + SourceType SourceType `protobuf:"varint,1,opt,name=source_type,json=sourceType,proto3,enum=scannerV1.SourceType" json:"source_type,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + Location string `protobuf:"bytes,4,opt,name=location,proto3" json:"location,omitempty"` unknownFields protoimpl.UnknownFields - - SourceType SourceType `protobuf:"varint,1,opt,name=source_type,json=sourceType,proto3,enum=scannerV1.SourceType" json:"source_type,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - Location string `protobuf:"bytes,4,opt,name=location,proto3" json:"location,omitempty"` + sizeCache protoimpl.SizeCache } func (x *LanguageLevelComponent) Reset() { *x = LanguageLevelComponent{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *LanguageLevelComponent) String() string { @@ -902,7 +860,7 @@ func (*LanguageLevelComponent) ProtoMessage() {} func (x *LanguageLevelComponent) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_image_scan_service_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1220,176 +1178,6 @@ func file_scanner_api_v1_image_scan_service_proto_init() { file_scanner_api_v1_component_proto_init() file_scanner_api_v1_image_proto_init() file_scanner_api_v1_note_proto_init() - if !protoimpl.UnsafeEnabled { - file_scanner_api_v1_image_scan_service_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*ScanImageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_image_scan_service_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ScanImageResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_image_scan_service_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*GetImageScanRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_image_scan_service_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*GetImageScanResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_image_scan_service_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*GetImageComponentsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_image_scan_service_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*GetImageComponentsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_image_scan_service_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*GetImageVulnerabilitiesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_image_scan_service_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*GetImageVulnerabilitiesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_image_scan_service_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*GetLanguageLevelComponentsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_image_scan_service_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*GetLanguageLevelComponentsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_image_scan_service_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*ImageSpec); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_image_scan_service_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*RegistryData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_image_scan_service_proto_msgTypes[12].Exporter = func(v any, i int) any { - switch v := v.(*LanguageLevelComponents); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_image_scan_service_proto_msgTypes[13].Exporter = func(v any, i int) any { - switch v := v.(*LanguageLevelComponent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/generated/scanner/api/v1/image_scan_service.pb.gw.go b/generated/scanner/api/v1/image_scan_service.pb.gw.go index a85e18a67..cf1986019 100644 --- a/generated/scanner/api/v1/image_scan_service.pb.gw.go +++ b/generated/scanner/api/v1/image_scan_service.pb.gw.go @@ -10,6 +10,7 @@ package scannerV1 import ( "context" + "errors" "io" "net/http" @@ -24,178 +25,165 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_ImageScanService_ScanImage_0(ctx context.Context, marshaler runtime.Marshaler, client ImageScanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ScanImageRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq ScanImageRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.ScanImage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ImageScanService_ScanImage_0(ctx context.Context, marshaler runtime.Marshaler, server ImageScanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ScanImageRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq ScanImageRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ScanImage(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_ImageScanService_GetImageScan_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) +var filter_ImageScanService_GetImageScan_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} func request_ImageScanService_GetImageScan_0(ctx context.Context, marshaler runtime.Marshaler, client ImageScanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetImageScanRequest - var metadata runtime.ServerMetadata - + var ( + protoReq GetImageScanRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ImageScanService_GetImageScan_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetImageScan(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ImageScanService_GetImageScan_0(ctx context.Context, marshaler runtime.Marshaler, server ImageScanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetImageScanRequest - var metadata runtime.ServerMetadata - + var ( + protoReq GetImageScanRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ImageScanService_GetImageScan_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetImageScan(ctx, &protoReq) return msg, metadata, err - } func request_ImageScanService_GetImageComponents_0(ctx context.Context, marshaler runtime.Marshaler, client ImageScanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetImageComponentsRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq GetImageComponentsRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetImageComponents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ImageScanService_GetImageComponents_0(ctx context.Context, marshaler runtime.Marshaler, server ImageScanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetImageComponentsRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq GetImageComponentsRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetImageComponents(ctx, &protoReq) return msg, metadata, err - } func request_ImageScanService_GetImageVulnerabilities_0(ctx context.Context, marshaler runtime.Marshaler, client ImageScanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetImageVulnerabilitiesRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq GetImageVulnerabilitiesRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetImageVulnerabilities(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ImageScanService_GetImageVulnerabilities_0(ctx context.Context, marshaler runtime.Marshaler, server ImageScanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetImageVulnerabilitiesRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq GetImageVulnerabilitiesRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetImageVulnerabilities(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_ImageScanService_GetLanguageLevelComponents_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) +var filter_ImageScanService_GetLanguageLevelComponents_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} func request_ImageScanService_GetLanguageLevelComponents_0(ctx context.Context, marshaler runtime.Marshaler, client ImageScanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetLanguageLevelComponentsRequest - var metadata runtime.ServerMetadata - + var ( + protoReq GetLanguageLevelComponentsRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ImageScanService_GetLanguageLevelComponents_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetLanguageLevelComponents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ImageScanService_GetLanguageLevelComponents_0(ctx context.Context, marshaler runtime.Marshaler, server ImageScanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetLanguageLevelComponentsRequest - var metadata runtime.ServerMetadata - + var ( + protoReq GetLanguageLevelComponentsRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ImageScanService_GetLanguageLevelComponents_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetLanguageLevelComponents(ctx, &protoReq) return msg, metadata, err - } // RegisterImageScanServiceHandlerServer registers the http handlers for service ImageScanService to "mux". // UnaryRPC :call ImageScanServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterImageScanServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterImageScanServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ImageScanServiceServer) error { - - mux.Handle("POST", pattern_ImageScanService_ScanImage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ImageScanService_ScanImage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.ImageScanService/ScanImage", runtime.WithHTTPPathPattern("/v1/images/scan")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.ImageScanService/ScanImage", runtime.WithHTTPPathPattern("/v1/images/scan")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -207,20 +195,15 @@ func RegisterImageScanServiceHandlerServer(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ImageScanService_ScanImage_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_ImageScanService_GetImageScan_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ImageScanService_GetImageScan_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.ImageScanService/GetImageScan", runtime.WithHTTPPathPattern("/v1/images/scan")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.ImageScanService/GetImageScan", runtime.WithHTTPPathPattern("/v1/images/scan")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -232,20 +215,15 @@ func RegisterImageScanServiceHandlerServer(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ImageScanService_GetImageScan_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ImageScanService_GetImageComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ImageScanService_GetImageComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.ImageScanService/GetImageComponents", runtime.WithHTTPPathPattern("/scannerV1.ImageScanService/GetImageComponents")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.ImageScanService/GetImageComponents", runtime.WithHTTPPathPattern("/scannerV1.ImageScanService/GetImageComponents")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -257,20 +235,15 @@ func RegisterImageScanServiceHandlerServer(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ImageScanService_GetImageComponents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ImageScanService_GetImageVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ImageScanService_GetImageVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.ImageScanService/GetImageVulnerabilities", runtime.WithHTTPPathPattern("/scannerV1.ImageScanService/GetImageVulnerabilities")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.ImageScanService/GetImageVulnerabilities", runtime.WithHTTPPathPattern("/scannerV1.ImageScanService/GetImageVulnerabilities")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -282,20 +255,15 @@ func RegisterImageScanServiceHandlerServer(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ImageScanService_GetImageVulnerabilities_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_ImageScanService_GetLanguageLevelComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ImageScanService_GetLanguageLevelComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.ImageScanService/GetLanguageLevelComponents", runtime.WithHTTPPathPattern("/v1/images/languagecomponents")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.ImageScanService/GetLanguageLevelComponents", runtime.WithHTTPPathPattern("/v1/images/languagecomponents")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -307,9 +275,7 @@ func RegisterImageScanServiceHandlerServer(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ImageScanService_GetLanguageLevelComponents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -318,25 +284,24 @@ func RegisterImageScanServiceHandlerServer(ctx context.Context, mux *runtime.Ser // RegisterImageScanServiceHandlerFromEndpoint is same as RegisterImageScanServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterImageScanServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterImageScanServiceHandler(ctx, mux, conn) } @@ -350,16 +315,13 @@ func RegisterImageScanServiceHandler(ctx context.Context, mux *runtime.ServeMux, // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ImageScanServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ImageScanServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ImageScanServiceClient" to call the correct interceptors. +// "ImageScanServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterImageScanServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ImageScanServiceClient) error { - - mux.Handle("POST", pattern_ImageScanService_ScanImage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ImageScanService_ScanImage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/scannerV1.ImageScanService/ScanImage", runtime.WithHTTPPathPattern("/v1/images/scan")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scannerV1.ImageScanService/ScanImage", runtime.WithHTTPPathPattern("/v1/images/scan")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -370,18 +332,13 @@ func RegisterImageScanServiceHandlerClient(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ImageScanService_ScanImage_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_ImageScanService_GetImageScan_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ImageScanService_GetImageScan_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/scannerV1.ImageScanService/GetImageScan", runtime.WithHTTPPathPattern("/v1/images/scan")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scannerV1.ImageScanService/GetImageScan", runtime.WithHTTPPathPattern("/v1/images/scan")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -392,18 +349,13 @@ func RegisterImageScanServiceHandlerClient(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ImageScanService_GetImageScan_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ImageScanService_GetImageComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ImageScanService_GetImageComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/scannerV1.ImageScanService/GetImageComponents", runtime.WithHTTPPathPattern("/scannerV1.ImageScanService/GetImageComponents")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scannerV1.ImageScanService/GetImageComponents", runtime.WithHTTPPathPattern("/scannerV1.ImageScanService/GetImageComponents")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -414,18 +366,13 @@ func RegisterImageScanServiceHandlerClient(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ImageScanService_GetImageComponents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ImageScanService_GetImageVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ImageScanService_GetImageVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/scannerV1.ImageScanService/GetImageVulnerabilities", runtime.WithHTTPPathPattern("/scannerV1.ImageScanService/GetImageVulnerabilities")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scannerV1.ImageScanService/GetImageVulnerabilities", runtime.WithHTTPPathPattern("/scannerV1.ImageScanService/GetImageVulnerabilities")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -436,18 +383,13 @@ func RegisterImageScanServiceHandlerClient(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ImageScanService_GetImageVulnerabilities_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_ImageScanService_GetLanguageLevelComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_ImageScanService_GetLanguageLevelComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/scannerV1.ImageScanService/GetLanguageLevelComponents", runtime.WithHTTPPathPattern("/v1/images/languagecomponents")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scannerV1.ImageScanService/GetLanguageLevelComponents", runtime.WithHTTPPathPattern("/v1/images/languagecomponents")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -458,34 +400,23 @@ func RegisterImageScanServiceHandlerClient(ctx context.Context, mux *runtime.Ser runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ImageScanService_GetLanguageLevelComponents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } var ( - pattern_ImageScanService_ScanImage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "images", "scan"}, "")) - - pattern_ImageScanService_GetImageScan_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "images", "scan"}, "")) - - pattern_ImageScanService_GetImageComponents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"scannerV1.ImageScanService", "GetImageComponents"}, "")) - - pattern_ImageScanService_GetImageVulnerabilities_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"scannerV1.ImageScanService", "GetImageVulnerabilities"}, "")) - + pattern_ImageScanService_ScanImage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "images", "scan"}, "")) + pattern_ImageScanService_GetImageScan_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "images", "scan"}, "")) + pattern_ImageScanService_GetImageComponents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"scannerV1.ImageScanService", "GetImageComponents"}, "")) + pattern_ImageScanService_GetImageVulnerabilities_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"scannerV1.ImageScanService", "GetImageVulnerabilities"}, "")) pattern_ImageScanService_GetLanguageLevelComponents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "images", "languagecomponents"}, "")) ) var ( - forward_ImageScanService_ScanImage_0 = runtime.ForwardResponseMessage - - forward_ImageScanService_GetImageScan_0 = runtime.ForwardResponseMessage - - forward_ImageScanService_GetImageComponents_0 = runtime.ForwardResponseMessage - - forward_ImageScanService_GetImageVulnerabilities_0 = runtime.ForwardResponseMessage - + forward_ImageScanService_ScanImage_0 = runtime.ForwardResponseMessage + forward_ImageScanService_GetImageScan_0 = runtime.ForwardResponseMessage + forward_ImageScanService_GetImageComponents_0 = runtime.ForwardResponseMessage + forward_ImageScanService_GetImageVulnerabilities_0 = runtime.ForwardResponseMessage forward_ImageScanService_GetLanguageLevelComponents_0 = runtime.ForwardResponseMessage ) diff --git a/generated/scanner/api/v1/image_scan_service_grpc.pb.go b/generated/scanner/api/v1/image_scan_service_grpc.pb.go index 4b2767b08..e2ea5e97e 100644 --- a/generated/scanner/api/v1/image_scan_service_grpc.pb.go +++ b/generated/scanner/api/v1/image_scan_service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc v3.21.4 // source: scanner/api/v1/image_scan_service.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ImageScanService_ScanImage_FullMethodName = "/scannerV1.ImageScanService/ScanImage" @@ -99,7 +99,7 @@ func (c *imageScanServiceClient) GetLanguageLevelComponents(ctx context.Context, // ImageScanServiceServer is the server API for ImageScanService service. // All implementations should embed UnimplementedImageScanServiceServer -// for forward compatibility +// for forward compatibility. // // ImageScanService APIs can be used to scan images. type ImageScanServiceServer interface { @@ -110,9 +110,12 @@ type ImageScanServiceServer interface { GetLanguageLevelComponents(context.Context, *GetLanguageLevelComponentsRequest) (*GetLanguageLevelComponentsResponse, error) } -// UnimplementedImageScanServiceServer should be embedded to have forward compatible implementations. -type UnimplementedImageScanServiceServer struct { -} +// UnimplementedImageScanServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedImageScanServiceServer struct{} func (UnimplementedImageScanServiceServer) ScanImage(context.Context, *ScanImageRequest) (*ScanImageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ScanImage not implemented") @@ -129,6 +132,7 @@ func (UnimplementedImageScanServiceServer) GetImageVulnerabilities(context.Conte func (UnimplementedImageScanServiceServer) GetLanguageLevelComponents(context.Context, *GetLanguageLevelComponentsRequest) (*GetLanguageLevelComponentsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLanguageLevelComponents not implemented") } +func (UnimplementedImageScanServiceServer) testEmbeddedByValue() {} // UnsafeImageScanServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ImageScanServiceServer will @@ -138,6 +142,13 @@ type UnsafeImageScanServiceServer interface { } func RegisterImageScanServiceServer(s grpc.ServiceRegistrar, srv ImageScanServiceServer) { + // If the following call pancis, it indicates UnimplementedImageScanServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&ImageScanService_ServiceDesc, srv) } diff --git a/generated/scanner/api/v1/image_scan_service_vtproto.pb.go b/generated/scanner/api/v1/image_scan_service_vtproto.pb.go index cf5b5a8c6..9c9d415ef 100644 --- a/generated/scanner/api/v1/image_scan_service_vtproto.pb.go +++ b/generated/scanner/api/v1/image_scan_service_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.6.0 +// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10 // source: scanner/api/v1/image_scan_service.proto package scannerV1 diff --git a/generated/scanner/api/v1/image_vtproto.pb.go b/generated/scanner/api/v1/image_vtproto.pb.go index 260e5d0be..b4b3c8c85 100644 --- a/generated/scanner/api/v1/image_vtproto.pb.go +++ b/generated/scanner/api/v1/image_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.6.0 +// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10 // source: scanner/api/v1/image.proto package scannerV1 diff --git a/generated/scanner/api/v1/metadata_service.pb.go b/generated/scanner/api/v1/metadata_service.pb.go index 9ec97aa7f..fbdb7878b 100644 --- a/generated/scanner/api/v1/metadata_service.pb.go +++ b/generated/scanner/api/v1/metadata_service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.36.0 // protoc v3.21.4 // source: scanner/api/v1/metadata_service.proto @@ -22,20 +22,17 @@ const ( ) type VulnDefsMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` LastUpdatedTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=last_updated_time,json=lastUpdatedTime,proto3" json:"last_updated_time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *VulnDefsMetadata) Reset() { *x = VulnDefsMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_metadata_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_metadata_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *VulnDefsMetadata) String() string { @@ -46,7 +43,7 @@ func (*VulnDefsMetadata) ProtoMessage() {} func (x *VulnDefsMetadata) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_metadata_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -134,20 +131,6 @@ func file_scanner_api_v1_metadata_service_proto_init() { return } file_scanner_api_v1_empty_proto_init() - if !protoimpl.UnsafeEnabled { - file_scanner_api_v1_metadata_service_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*VulnDefsMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/generated/scanner/api/v1/metadata_service.pb.gw.go b/generated/scanner/api/v1/metadata_service.pb.gw.go index 0d27e5bdb..e00909826 100644 --- a/generated/scanner/api/v1/metadata_service.pb.gw.go +++ b/generated/scanner/api/v1/metadata_service.pb.gw.go @@ -10,6 +10,7 @@ package scannerV1 import ( "context" + "errors" "io" "net/http" @@ -24,46 +25,47 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_VulnDefsService_GetVulnDefsMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client VulnDefsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Empty - var metadata runtime.ServerMetadata - + var ( + protoReq Empty + metadata runtime.ServerMetadata + ) msg, err := client.GetVulnDefsMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_VulnDefsService_GetVulnDefsMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server VulnDefsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Empty - var metadata runtime.ServerMetadata - + var ( + protoReq Empty + metadata runtime.ServerMetadata + ) msg, err := server.GetVulnDefsMetadata(ctx, &protoReq) return msg, metadata, err - } // RegisterVulnDefsServiceHandlerServer registers the http handlers for service VulnDefsService to "mux". // UnaryRPC :call VulnDefsServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterVulnDefsServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterVulnDefsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server VulnDefsServiceServer) error { - - mux.Handle("GET", pattern_VulnDefsService_GetVulnDefsMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_VulnDefsService_GetVulnDefsMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.VulnDefsService/GetVulnDefsMetadata", runtime.WithHTTPPathPattern("/v1/vulndefs/metadata")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.VulnDefsService/GetVulnDefsMetadata", runtime.WithHTTPPathPattern("/v1/vulndefs/metadata")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -75,9 +77,7 @@ func RegisterVulnDefsServiceHandlerServer(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_VulnDefsService_GetVulnDefsMetadata_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -86,25 +86,24 @@ func RegisterVulnDefsServiceHandlerServer(ctx context.Context, mux *runtime.Serv // RegisterVulnDefsServiceHandlerFromEndpoint is same as RegisterVulnDefsServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterVulnDefsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterVulnDefsServiceHandler(ctx, mux, conn) } @@ -118,16 +117,13 @@ func RegisterVulnDefsServiceHandler(ctx context.Context, mux *runtime.ServeMux, // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "VulnDefsServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "VulnDefsServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "VulnDefsServiceClient" to call the correct interceptors. +// "VulnDefsServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterVulnDefsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client VulnDefsServiceClient) error { - - mux.Handle("GET", pattern_VulnDefsService_GetVulnDefsMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_VulnDefsService_GetVulnDefsMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/scannerV1.VulnDefsService/GetVulnDefsMetadata", runtime.WithHTTPPathPattern("/v1/vulndefs/metadata")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scannerV1.VulnDefsService/GetVulnDefsMetadata", runtime.WithHTTPPathPattern("/v1/vulndefs/metadata")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -138,11 +134,8 @@ func RegisterVulnDefsServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_VulnDefsService_GetVulnDefsMetadata_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } diff --git a/generated/scanner/api/v1/metadata_service_grpc.pb.go b/generated/scanner/api/v1/metadata_service_grpc.pb.go index a68529a09..78df07779 100644 --- a/generated/scanner/api/v1/metadata_service_grpc.pb.go +++ b/generated/scanner/api/v1/metadata_service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc v3.21.4 // source: scanner/api/v1/metadata_service.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( VulnDefsService_GetVulnDefsMetadata_FullMethodName = "/scannerV1.VulnDefsService/GetVulnDefsMetadata" @@ -49,18 +49,22 @@ func (c *vulnDefsServiceClient) GetVulnDefsMetadata(ctx context.Context, in *Emp // VulnDefsServiceServer is the server API for VulnDefsService service. // All implementations should embed UnimplementedVulnDefsServiceServer -// for forward compatibility +// for forward compatibility. type VulnDefsServiceServer interface { GetVulnDefsMetadata(context.Context, *Empty) (*VulnDefsMetadata, error) } -// UnimplementedVulnDefsServiceServer should be embedded to have forward compatible implementations. -type UnimplementedVulnDefsServiceServer struct { -} +// UnimplementedVulnDefsServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedVulnDefsServiceServer struct{} func (UnimplementedVulnDefsServiceServer) GetVulnDefsMetadata(context.Context, *Empty) (*VulnDefsMetadata, error) { return nil, status.Errorf(codes.Unimplemented, "method GetVulnDefsMetadata not implemented") } +func (UnimplementedVulnDefsServiceServer) testEmbeddedByValue() {} // UnsafeVulnDefsServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to VulnDefsServiceServer will @@ -70,6 +74,13 @@ type UnsafeVulnDefsServiceServer interface { } func RegisterVulnDefsServiceServer(s grpc.ServiceRegistrar, srv VulnDefsServiceServer) { + // If the following call pancis, it indicates UnimplementedVulnDefsServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&VulnDefsService_ServiceDesc, srv) } diff --git a/generated/scanner/api/v1/metadata_service_vtproto.pb.go b/generated/scanner/api/v1/metadata_service_vtproto.pb.go index 361f09886..aefb57859 100644 --- a/generated/scanner/api/v1/metadata_service_vtproto.pb.go +++ b/generated/scanner/api/v1/metadata_service_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.6.0 +// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10 // source: scanner/api/v1/metadata_service.proto package scannerV1 diff --git a/generated/scanner/api/v1/node_inventory_service.pb.go b/generated/scanner/api/v1/node_inventory_service.pb.go index 9a0e9520c..2b95c6cc8 100644 --- a/generated/scanner/api/v1/node_inventory_service.pb.go +++ b/generated/scanner/api/v1/node_inventory_service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.36.0 // protoc v3.21.4 // source: scanner/api/v1/node_inventory_service.proto @@ -21,22 +21,19 @@ const ( ) type GetNodeInventoryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` + Components *Components `protobuf:"bytes,2,opt,name=components,proto3" json:"components,omitempty"` + Notes []Note `protobuf:"varint,3,rep,packed,name=notes,proto3,enum=scannerV1.Note" json:"notes,omitempty"` unknownFields protoimpl.UnknownFields - - NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - Components *Components `protobuf:"bytes,2,opt,name=components,proto3" json:"components,omitempty"` - Notes []Note `protobuf:"varint,3,rep,packed,name=notes,proto3,enum=scannerV1.Note" json:"notes,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetNodeInventoryResponse) Reset() { *x = GetNodeInventoryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_node_inventory_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_node_inventory_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetNodeInventoryResponse) String() string { @@ -47,7 +44,7 @@ func (*GetNodeInventoryResponse) ProtoMessage() {} func (x *GetNodeInventoryResponse) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_node_inventory_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -84,18 +81,16 @@ func (x *GetNodeInventoryResponse) GetNotes() []Note { } type GetNodeInventoryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetNodeInventoryRequest) Reset() { *x = GetNodeInventoryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_node_inventory_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_node_inventory_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetNodeInventoryRequest) String() string { @@ -106,7 +101,7 @@ func (*GetNodeInventoryRequest) ProtoMessage() {} func (x *GetNodeInventoryRequest) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_node_inventory_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -194,32 +189,6 @@ func file_scanner_api_v1_node_inventory_service_proto_init() { } file_scanner_api_v1_note_proto_init() file_scanner_api_v1_component_proto_init() - if !protoimpl.UnsafeEnabled { - file_scanner_api_v1_node_inventory_service_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*GetNodeInventoryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_node_inventory_service_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*GetNodeInventoryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/generated/scanner/api/v1/node_inventory_service.pb.gw.go b/generated/scanner/api/v1/node_inventory_service.pb.gw.go index 45f081fab..2e9e7c230 100644 --- a/generated/scanner/api/v1/node_inventory_service.pb.gw.go +++ b/generated/scanner/api/v1/node_inventory_service.pb.gw.go @@ -10,6 +10,7 @@ package scannerV1 import ( "context" + "errors" "io" "net/http" @@ -24,54 +25,53 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_NodeInventoryService_GetNodeInventory_0(ctx context.Context, marshaler runtime.Marshaler, client NodeInventoryServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetNodeInventoryRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq GetNodeInventoryRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetNodeInventory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_NodeInventoryService_GetNodeInventory_0(ctx context.Context, marshaler runtime.Marshaler, server NodeInventoryServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetNodeInventoryRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq GetNodeInventoryRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetNodeInventory(ctx, &protoReq) return msg, metadata, err - } // RegisterNodeInventoryServiceHandlerServer registers the http handlers for service NodeInventoryService to "mux". // UnaryRPC :call NodeInventoryServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterNodeInventoryServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterNodeInventoryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NodeInventoryServiceServer) error { - - mux.Handle("POST", pattern_NodeInventoryService_GetNodeInventory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_NodeInventoryService_GetNodeInventory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.NodeInventoryService/GetNodeInventory", runtime.WithHTTPPathPattern("/scannerV1.NodeInventoryService/GetNodeInventory")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.NodeInventoryService/GetNodeInventory", runtime.WithHTTPPathPattern("/scannerV1.NodeInventoryService/GetNodeInventory")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -83,9 +83,7 @@ func RegisterNodeInventoryServiceHandlerServer(ctx context.Context, mux *runtime runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_NodeInventoryService_GetNodeInventory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -94,25 +92,24 @@ func RegisterNodeInventoryServiceHandlerServer(ctx context.Context, mux *runtime // RegisterNodeInventoryServiceHandlerFromEndpoint is same as RegisterNodeInventoryServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterNodeInventoryServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterNodeInventoryServiceHandler(ctx, mux, conn) } @@ -126,16 +123,13 @@ func RegisterNodeInventoryServiceHandler(ctx context.Context, mux *runtime.Serve // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NodeInventoryServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NodeInventoryServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "NodeInventoryServiceClient" to call the correct interceptors. +// "NodeInventoryServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterNodeInventoryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NodeInventoryServiceClient) error { - - mux.Handle("POST", pattern_NodeInventoryService_GetNodeInventory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_NodeInventoryService_GetNodeInventory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/scannerV1.NodeInventoryService/GetNodeInventory", runtime.WithHTTPPathPattern("/scannerV1.NodeInventoryService/GetNodeInventory")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scannerV1.NodeInventoryService/GetNodeInventory", runtime.WithHTTPPathPattern("/scannerV1.NodeInventoryService/GetNodeInventory")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -146,11 +140,8 @@ func RegisterNodeInventoryServiceHandlerClient(ctx context.Context, mux *runtime runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_NodeInventoryService_GetNodeInventory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } diff --git a/generated/scanner/api/v1/node_inventory_service_grpc.pb.go b/generated/scanner/api/v1/node_inventory_service_grpc.pb.go index 47b252ee4..40a270644 100644 --- a/generated/scanner/api/v1/node_inventory_service_grpc.pb.go +++ b/generated/scanner/api/v1/node_inventory_service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc v3.21.4 // source: scanner/api/v1/node_inventory_service.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( NodeInventoryService_GetNodeInventory_FullMethodName = "/scannerV1.NodeInventoryService/GetNodeInventory" @@ -52,7 +52,7 @@ func (c *nodeInventoryServiceClient) GetNodeInventory(ctx context.Context, in *G // NodeInventoryServiceServer is the server API for NodeInventoryService service. // All implementations should embed UnimplementedNodeInventoryServiceServer -// for forward compatibility +// for forward compatibility. // // NodeInventoryService is used in Secured Clusters to fetch information from Nodes and communicate with other // Secured Cluster components, like the compliance container in Collector. @@ -60,13 +60,17 @@ type NodeInventoryServiceServer interface { GetNodeInventory(context.Context, *GetNodeInventoryRequest) (*GetNodeInventoryResponse, error) } -// UnimplementedNodeInventoryServiceServer should be embedded to have forward compatible implementations. -type UnimplementedNodeInventoryServiceServer struct { -} +// UnimplementedNodeInventoryServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedNodeInventoryServiceServer struct{} func (UnimplementedNodeInventoryServiceServer) GetNodeInventory(context.Context, *GetNodeInventoryRequest) (*GetNodeInventoryResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetNodeInventory not implemented") } +func (UnimplementedNodeInventoryServiceServer) testEmbeddedByValue() {} // UnsafeNodeInventoryServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to NodeInventoryServiceServer will @@ -76,6 +80,13 @@ type UnsafeNodeInventoryServiceServer interface { } func RegisterNodeInventoryServiceServer(s grpc.ServiceRegistrar, srv NodeInventoryServiceServer) { + // If the following call pancis, it indicates UnimplementedNodeInventoryServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&NodeInventoryService_ServiceDesc, srv) } diff --git a/generated/scanner/api/v1/node_inventory_service_vtproto.pb.go b/generated/scanner/api/v1/node_inventory_service_vtproto.pb.go index 48a12207e..a2419433b 100644 --- a/generated/scanner/api/v1/node_inventory_service_vtproto.pb.go +++ b/generated/scanner/api/v1/node_inventory_service_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.6.0 +// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10 // source: scanner/api/v1/node_inventory_service.proto package scannerV1 diff --git a/generated/scanner/api/v1/node_scan_service.pb.go b/generated/scanner/api/v1/node_scan_service.pb.go index 55a0f7556..48f881b6c 100644 --- a/generated/scanner/api/v1/node_scan_service.pb.go +++ b/generated/scanner/api/v1/node_scan_service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.36.0 // protoc v3.21.4 // source: scanner/api/v1/node_scan_service.proto @@ -21,10 +21,7 @@ const ( ) type GetNodeVulnerabilitiesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` OsImage string `protobuf:"bytes,1,opt,name=os_image,json=osImage,proto3" json:"os_image,omitempty"` KernelVersion string `protobuf:"bytes,2,opt,name=kernel_version,json=kernelVersion,proto3" json:"kernel_version,omitempty"` KubeletVersion string `protobuf:"bytes,3,opt,name=kubelet_version,json=kubeletVersion,proto3" json:"kubelet_version,omitempty"` @@ -32,15 +29,15 @@ type GetNodeVulnerabilitiesRequest struct { Runtime *GetNodeVulnerabilitiesRequest_ContainerRuntime `protobuf:"bytes,5,opt,name=runtime,proto3" json:"runtime,omitempty"` Components *Components `protobuf:"bytes,6,opt,name=components,proto3" json:"components,omitempty"` Notes []Note `protobuf:"varint,7,rep,packed,name=notes,proto3,enum=scannerV1.Note" json:"notes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetNodeVulnerabilitiesRequest) Reset() { *x = GetNodeVulnerabilitiesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_node_scan_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_node_scan_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetNodeVulnerabilitiesRequest) String() string { @@ -51,7 +48,7 @@ func (*GetNodeVulnerabilitiesRequest) ProtoMessage() {} func (x *GetNodeVulnerabilitiesRequest) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_node_scan_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -117,10 +114,7 @@ func (x *GetNodeVulnerabilitiesRequest) GetNotes() []Note { // Next tag: 10 type GetNodeVulnerabilitiesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` ScannerVersion string `protobuf:"bytes,7,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` OperatingSystem string `protobuf:"bytes,6,opt,name=operating_system,json=operatingSystem,proto3" json:"operating_system,omitempty"` KernelVulnerabilities []*Vulnerability `protobuf:"bytes,1,rep,name=kernel_vulnerabilities,json=kernelVulnerabilities,proto3" json:"kernel_vulnerabilities,omitempty"` @@ -130,15 +124,15 @@ type GetNodeVulnerabilitiesResponse struct { KernelComponent *GetNodeVulnerabilitiesResponse_KernelComponent `protobuf:"bytes,5,opt,name=kernel_component,json=kernelComponent,proto3" json:"kernel_component,omitempty"` NodeNotes []NodeNote `protobuf:"varint,8,rep,packed,name=node_notes,json=nodeNotes,proto3,enum=scannerV1.NodeNote" json:"node_notes,omitempty"` Features []*Feature `protobuf:"bytes,9,rep,name=features,proto3" json:"features,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetNodeVulnerabilitiesResponse) Reset() { *x = GetNodeVulnerabilitiesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_node_scan_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_node_scan_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetNodeVulnerabilitiesResponse) String() string { @@ -149,7 +143,7 @@ func (*GetNodeVulnerabilitiesResponse) ProtoMessage() {} func (x *GetNodeVulnerabilitiesResponse) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_node_scan_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -228,21 +222,18 @@ func (x *GetNodeVulnerabilitiesResponse) GetFeatures() []*Feature { } type GetNodeVulnerabilitiesRequest_ContainerRuntime struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetNodeVulnerabilitiesRequest_ContainerRuntime) Reset() { *x = GetNodeVulnerabilitiesRequest_ContainerRuntime{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_node_scan_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_node_scan_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetNodeVulnerabilitiesRequest_ContainerRuntime) String() string { @@ -253,7 +244,7 @@ func (*GetNodeVulnerabilitiesRequest_ContainerRuntime) ProtoMessage() {} func (x *GetNodeVulnerabilitiesRequest_ContainerRuntime) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_node_scan_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -283,21 +274,18 @@ func (x *GetNodeVulnerabilitiesRequest_ContainerRuntime) GetVersion() string { } type GetNodeVulnerabilitiesResponse_KernelComponent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetNodeVulnerabilitiesResponse_KernelComponent) Reset() { *x = GetNodeVulnerabilitiesResponse_KernelComponent{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_node_scan_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_node_scan_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetNodeVulnerabilitiesResponse_KernelComponent) String() string { @@ -308,7 +296,7 @@ func (*GetNodeVulnerabilitiesResponse_KernelComponent) ProtoMessage() {} func (x *GetNodeVulnerabilitiesResponse_KernelComponent) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_node_scan_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -491,56 +479,6 @@ func file_scanner_api_v1_node_scan_service_proto_init() { file_scanner_api_v1_note_proto_init() file_scanner_api_v1_vulnerability_proto_init() file_scanner_api_v1_component_proto_init() - if !protoimpl.UnsafeEnabled { - file_scanner_api_v1_node_scan_service_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*GetNodeVulnerabilitiesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_node_scan_service_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*GetNodeVulnerabilitiesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_node_scan_service_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*GetNodeVulnerabilitiesRequest_ContainerRuntime); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_node_scan_service_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*GetNodeVulnerabilitiesResponse_KernelComponent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/generated/scanner/api/v1/node_scan_service.pb.gw.go b/generated/scanner/api/v1/node_scan_service.pb.gw.go index b4c630370..dd22db4ed 100644 --- a/generated/scanner/api/v1/node_scan_service.pb.gw.go +++ b/generated/scanner/api/v1/node_scan_service.pb.gw.go @@ -10,6 +10,7 @@ package scannerV1 import ( "context" + "errors" "io" "net/http" @@ -24,64 +25,61 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join - var ( - filter_NodeScanService_GetNodeVulnerabilities_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join ) -func request_NodeScanService_GetNodeVulnerabilities_0(ctx context.Context, marshaler runtime.Marshaler, client NodeScanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetNodeVulnerabilitiesRequest - var metadata runtime.ServerMetadata +var filter_NodeScanService_GetNodeVulnerabilities_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +func request_NodeScanService_GetNodeVulnerabilities_0(ctx context.Context, marshaler runtime.Marshaler, client NodeScanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq GetNodeVulnerabilitiesRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_NodeScanService_GetNodeVulnerabilities_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetNodeVulnerabilities(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_NodeScanService_GetNodeVulnerabilities_0(ctx context.Context, marshaler runtime.Marshaler, server NodeScanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetNodeVulnerabilitiesRequest - var metadata runtime.ServerMetadata - + var ( + protoReq GetNodeVulnerabilitiesRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_NodeScanService_GetNodeVulnerabilities_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetNodeVulnerabilities(ctx, &protoReq) return msg, metadata, err - } // RegisterNodeScanServiceHandlerServer registers the http handlers for service NodeScanService to "mux". // UnaryRPC :call NodeScanServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterNodeScanServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterNodeScanServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NodeScanServiceServer) error { - - mux.Handle("GET", pattern_NodeScanService_GetNodeVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_NodeScanService_GetNodeVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.NodeScanService/GetNodeVulnerabilities", runtime.WithHTTPPathPattern("/v1/nodes/vulnerabilities")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.NodeScanService/GetNodeVulnerabilities", runtime.WithHTTPPathPattern("/v1/nodes/vulnerabilities")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -93,9 +91,7 @@ func RegisterNodeScanServiceHandlerServer(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_NodeScanService_GetNodeVulnerabilities_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -104,25 +100,24 @@ func RegisterNodeScanServiceHandlerServer(ctx context.Context, mux *runtime.Serv // RegisterNodeScanServiceHandlerFromEndpoint is same as RegisterNodeScanServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterNodeScanServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterNodeScanServiceHandler(ctx, mux, conn) } @@ -136,16 +131,13 @@ func RegisterNodeScanServiceHandler(ctx context.Context, mux *runtime.ServeMux, // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NodeScanServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NodeScanServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "NodeScanServiceClient" to call the correct interceptors. +// "NodeScanServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterNodeScanServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NodeScanServiceClient) error { - - mux.Handle("GET", pattern_NodeScanService_GetNodeVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_NodeScanService_GetNodeVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/scannerV1.NodeScanService/GetNodeVulnerabilities", runtime.WithHTTPPathPattern("/v1/nodes/vulnerabilities")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scannerV1.NodeScanService/GetNodeVulnerabilities", runtime.WithHTTPPathPattern("/v1/nodes/vulnerabilities")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -156,11 +148,8 @@ func RegisterNodeScanServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_NodeScanService_GetNodeVulnerabilities_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } diff --git a/generated/scanner/api/v1/node_scan_service_grpc.pb.go b/generated/scanner/api/v1/node_scan_service_grpc.pb.go index 4f4ecce84..af77c7e28 100644 --- a/generated/scanner/api/v1/node_scan_service_grpc.pb.go +++ b/generated/scanner/api/v1/node_scan_service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc v3.21.4 // source: scanner/api/v1/node_scan_service.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( NodeScanService_GetNodeVulnerabilities_FullMethodName = "/scannerV1.NodeScanService/GetNodeVulnerabilities" @@ -51,20 +51,24 @@ func (c *nodeScanServiceClient) GetNodeVulnerabilities(ctx context.Context, in * // NodeScanServiceServer is the server API for NodeScanService service. // All implementations should embed UnimplementedNodeScanServiceServer -// for forward compatibility +// for forward compatibility. // // NodeScanService APIs can be used to get vulnerabilities for nodes. type NodeScanServiceServer interface { GetNodeVulnerabilities(context.Context, *GetNodeVulnerabilitiesRequest) (*GetNodeVulnerabilitiesResponse, error) } -// UnimplementedNodeScanServiceServer should be embedded to have forward compatible implementations. -type UnimplementedNodeScanServiceServer struct { -} +// UnimplementedNodeScanServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedNodeScanServiceServer struct{} func (UnimplementedNodeScanServiceServer) GetNodeVulnerabilities(context.Context, *GetNodeVulnerabilitiesRequest) (*GetNodeVulnerabilitiesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetNodeVulnerabilities not implemented") } +func (UnimplementedNodeScanServiceServer) testEmbeddedByValue() {} // UnsafeNodeScanServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to NodeScanServiceServer will @@ -74,6 +78,13 @@ type UnsafeNodeScanServiceServer interface { } func RegisterNodeScanServiceServer(s grpc.ServiceRegistrar, srv NodeScanServiceServer) { + // If the following call pancis, it indicates UnimplementedNodeScanServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&NodeScanService_ServiceDesc, srv) } diff --git a/generated/scanner/api/v1/node_scan_service_vtproto.pb.go b/generated/scanner/api/v1/node_scan_service_vtproto.pb.go index 11fdfc821..9d4b6ea5f 100644 --- a/generated/scanner/api/v1/node_scan_service_vtproto.pb.go +++ b/generated/scanner/api/v1/node_scan_service_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.6.0 +// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10 // source: scanner/api/v1/node_scan_service.proto package scannerV1 diff --git a/generated/scanner/api/v1/note.pb.go b/generated/scanner/api/v1/note.pb.go index c6ea46664..d42af4f02 100644 --- a/generated/scanner/api/v1/note.pb.go +++ b/generated/scanner/api/v1/note.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.36.0 // protoc v3.21.4 // source: scanner/api/v1/note.proto diff --git a/generated/scanner/api/v1/orchestrator_scan_service.pb.go b/generated/scanner/api/v1/orchestrator_scan_service.pb.go index 3d17f369e..dc59b8af7 100644 --- a/generated/scanner/api/v1/orchestrator_scan_service.pb.go +++ b/generated/scanner/api/v1/orchestrator_scan_service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.36.0 // protoc v3.21.4 // source: scanner/api/v1/orchestrator_scan_service.proto @@ -21,20 +21,17 @@ const ( ) type GetKubeVulnerabilitiesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - KubernetesVersion string `protobuf:"bytes,1,opt,name=kubernetes_version,json=kubernetesVersion,proto3" json:"kubernetes_version,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + KubernetesVersion string `protobuf:"bytes,1,opt,name=kubernetes_version,json=kubernetesVersion,proto3" json:"kubernetes_version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetKubeVulnerabilitiesRequest) Reset() { *x = GetKubeVulnerabilitiesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetKubeVulnerabilitiesRequest) String() string { @@ -45,7 +42,7 @@ func (*GetKubeVulnerabilitiesRequest) ProtoMessage() {} func (x *GetKubeVulnerabilitiesRequest) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -69,25 +66,22 @@ func (x *GetKubeVulnerabilitiesRequest) GetKubernetesVersion() string { // Next tag: 7 type GetKubeVulnerabilitiesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ScannerVersion string `protobuf:"bytes,6,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` - AggregatorVulnerabilities []*Vulnerability `protobuf:"bytes,1,rep,name=aggregator_vulnerabilities,json=aggregatorVulnerabilities,proto3" json:"aggregator_vulnerabilities,omitempty"` - ApiserverVulnerabilities []*Vulnerability `protobuf:"bytes,2,rep,name=apiserver_vulnerabilities,json=apiserverVulnerabilities,proto3" json:"apiserver_vulnerabilities,omitempty"` - ControllerManagerVulnerabilities []*Vulnerability `protobuf:"bytes,3,rep,name=controller_manager_vulnerabilities,json=controllerManagerVulnerabilities,proto3" json:"controller_manager_vulnerabilities,omitempty"` - SchedulerVulnerabilities []*Vulnerability `protobuf:"bytes,4,rep,name=scheduler_vulnerabilities,json=schedulerVulnerabilities,proto3" json:"scheduler_vulnerabilities,omitempty"` - GenericVulnerabilities []*Vulnerability `protobuf:"bytes,5,rep,name=generic_vulnerabilities,json=genericVulnerabilities,proto3" json:"generic_vulnerabilities,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ScannerVersion string `protobuf:"bytes,6,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` + AggregatorVulnerabilities []*Vulnerability `protobuf:"bytes,1,rep,name=aggregator_vulnerabilities,json=aggregatorVulnerabilities,proto3" json:"aggregator_vulnerabilities,omitempty"` + ApiserverVulnerabilities []*Vulnerability `protobuf:"bytes,2,rep,name=apiserver_vulnerabilities,json=apiserverVulnerabilities,proto3" json:"apiserver_vulnerabilities,omitempty"` + ControllerManagerVulnerabilities []*Vulnerability `protobuf:"bytes,3,rep,name=controller_manager_vulnerabilities,json=controllerManagerVulnerabilities,proto3" json:"controller_manager_vulnerabilities,omitempty"` + SchedulerVulnerabilities []*Vulnerability `protobuf:"bytes,4,rep,name=scheduler_vulnerabilities,json=schedulerVulnerabilities,proto3" json:"scheduler_vulnerabilities,omitempty"` + GenericVulnerabilities []*Vulnerability `protobuf:"bytes,5,rep,name=generic_vulnerabilities,json=genericVulnerabilities,proto3" json:"generic_vulnerabilities,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetKubeVulnerabilitiesResponse) Reset() { *x = GetKubeVulnerabilitiesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetKubeVulnerabilitiesResponse) String() string { @@ -98,7 +92,7 @@ func (*GetKubeVulnerabilitiesResponse) ProtoMessage() {} func (x *GetKubeVulnerabilitiesResponse) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -156,20 +150,17 @@ func (x *GetKubeVulnerabilitiesResponse) GetGenericVulnerabilities() []*Vulnerab } type GetIstioVulnerabilitiesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + IstioVersion string `protobuf:"bytes,1,opt,name=istio_version,json=istioVersion,proto3" json:"istio_version,omitempty"` unknownFields protoimpl.UnknownFields - - IstioVersion string `protobuf:"bytes,1,opt,name=istio_version,json=istioVersion,proto3" json:"istio_version,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetIstioVulnerabilitiesRequest) Reset() { *x = GetIstioVulnerabilitiesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetIstioVulnerabilitiesRequest) String() string { @@ -180,7 +171,7 @@ func (*GetIstioVulnerabilitiesRequest) ProtoMessage() {} func (x *GetIstioVulnerabilitiesRequest) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -203,21 +194,18 @@ func (x *GetIstioVulnerabilitiesRequest) GetIstioVersion() string { } type GetIstioVulnerabilitiesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ScannerVersion string `protobuf:"bytes,1,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` - Vulnerabilities []*Vulnerability `protobuf:"bytes,2,rep,name=vulnerabilities,proto3" json:"vulnerabilities,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ScannerVersion string `protobuf:"bytes,1,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` + Vulnerabilities []*Vulnerability `protobuf:"bytes,2,rep,name=vulnerabilities,proto3" json:"vulnerabilities,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetIstioVulnerabilitiesResponse) Reset() { *x = GetIstioVulnerabilitiesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetIstioVulnerabilitiesResponse) String() string { @@ -228,7 +216,7 @@ func (*GetIstioVulnerabilitiesResponse) ProtoMessage() {} func (x *GetIstioVulnerabilitiesResponse) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -258,20 +246,17 @@ func (x *GetIstioVulnerabilitiesResponse) GetVulnerabilities() []*Vulnerability } type GetOpenShiftVulnerabilitiesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OpenShiftVersion string `protobuf:"bytes,1,opt,name=openShift_version,json=openShiftVersion,proto3" json:"openShift_version,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + OpenShiftVersion string `protobuf:"bytes,1,opt,name=openShift_version,json=openShiftVersion,proto3" json:"openShift_version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetOpenShiftVulnerabilitiesRequest) Reset() { *x = GetOpenShiftVulnerabilitiesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetOpenShiftVulnerabilitiesRequest) String() string { @@ -282,7 +267,7 @@ func (*GetOpenShiftVulnerabilitiesRequest) ProtoMessage() {} func (x *GetOpenShiftVulnerabilitiesRequest) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -305,21 +290,18 @@ func (x *GetOpenShiftVulnerabilitiesRequest) GetOpenShiftVersion() string { } type GetOpenShiftVulnerabilitiesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ScannerVersion string `protobuf:"bytes,2,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` - Vulnerabilities []*Vulnerability `protobuf:"bytes,1,rep,name=vulnerabilities,proto3" json:"vulnerabilities,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ScannerVersion string `protobuf:"bytes,2,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` + Vulnerabilities []*Vulnerability `protobuf:"bytes,1,rep,name=vulnerabilities,proto3" json:"vulnerabilities,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetOpenShiftVulnerabilitiesResponse) Reset() { *x = GetOpenShiftVulnerabilitiesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetOpenShiftVulnerabilitiesResponse) String() string { @@ -330,7 +312,7 @@ func (*GetOpenShiftVulnerabilitiesResponse) ProtoMessage() {} func (x *GetOpenShiftVulnerabilitiesResponse) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -525,80 +507,6 @@ func file_scanner_api_v1_orchestrator_scan_service_proto_init() { return } file_scanner_api_v1_vulnerability_proto_init() - if !protoimpl.UnsafeEnabled { - file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*GetKubeVulnerabilitiesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*GetKubeVulnerabilitiesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*GetIstioVulnerabilitiesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*GetIstioVulnerabilitiesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*GetOpenShiftVulnerabilitiesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_orchestrator_scan_service_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*GetOpenShiftVulnerabilitiesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/generated/scanner/api/v1/orchestrator_scan_service.pb.gw.go b/generated/scanner/api/v1/orchestrator_scan_service.pb.gw.go index 73ac334f5..974e8f444 100644 --- a/generated/scanner/api/v1/orchestrator_scan_service.pb.gw.go +++ b/generated/scanner/api/v1/orchestrator_scan_service.pb.gw.go @@ -10,6 +10,7 @@ package scannerV1 import ( "context" + "errors" "io" "net/http" @@ -24,152 +25,129 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join - var ( - filter_OrchestratorScanService_GetKubeVulnerabilities_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join ) -func request_OrchestratorScanService_GetKubeVulnerabilities_0(ctx context.Context, marshaler runtime.Marshaler, client OrchestratorScanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetKubeVulnerabilitiesRequest - var metadata runtime.ServerMetadata +var filter_OrchestratorScanService_GetKubeVulnerabilities_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +func request_OrchestratorScanService_GetKubeVulnerabilities_0(ctx context.Context, marshaler runtime.Marshaler, client OrchestratorScanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq GetKubeVulnerabilitiesRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrchestratorScanService_GetKubeVulnerabilities_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetKubeVulnerabilities(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_OrchestratorScanService_GetKubeVulnerabilities_0(ctx context.Context, marshaler runtime.Marshaler, server OrchestratorScanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetKubeVulnerabilitiesRequest - var metadata runtime.ServerMetadata - + var ( + protoReq GetKubeVulnerabilitiesRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrchestratorScanService_GetKubeVulnerabilities_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetKubeVulnerabilities(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_OrchestratorScanService_GetOpenShiftVulnerabilities_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) +var filter_OrchestratorScanService_GetOpenShiftVulnerabilities_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} func request_OrchestratorScanService_GetOpenShiftVulnerabilities_0(ctx context.Context, marshaler runtime.Marshaler, client OrchestratorScanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetOpenShiftVulnerabilitiesRequest - var metadata runtime.ServerMetadata - + var ( + protoReq GetOpenShiftVulnerabilitiesRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrchestratorScanService_GetOpenShiftVulnerabilities_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetOpenShiftVulnerabilities(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_OrchestratorScanService_GetOpenShiftVulnerabilities_0(ctx context.Context, marshaler runtime.Marshaler, server OrchestratorScanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetOpenShiftVulnerabilitiesRequest - var metadata runtime.ServerMetadata - + var ( + protoReq GetOpenShiftVulnerabilitiesRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrchestratorScanService_GetOpenShiftVulnerabilities_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetOpenShiftVulnerabilities(ctx, &protoReq) return msg, metadata, err - } func request_OrchestratorScanService_GetIstioVulnerabilities_0(ctx context.Context, marshaler runtime.Marshaler, client OrchestratorScanServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetIstioVulnerabilitiesRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq GetIstioVulnerabilitiesRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["istio_version"] + val, ok := pathParams["istio_version"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "istio_version") } - protoReq.IstioVersion, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "istio_version", err) } - msg, err := client.GetIstioVulnerabilities(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_OrchestratorScanService_GetIstioVulnerabilities_0(ctx context.Context, marshaler runtime.Marshaler, server OrchestratorScanServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetIstioVulnerabilitiesRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq GetIstioVulnerabilitiesRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["istio_version"] + val, ok := pathParams["istio_version"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "istio_version") } - protoReq.IstioVersion, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "istio_version", err) } - msg, err := server.GetIstioVulnerabilities(ctx, &protoReq) return msg, metadata, err - } // RegisterOrchestratorScanServiceHandlerServer registers the http handlers for service OrchestratorScanService to "mux". // UnaryRPC :call OrchestratorScanServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterOrchestratorScanServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterOrchestratorScanServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrchestratorScanServiceServer) error { - - mux.Handle("GET", pattern_OrchestratorScanService_GetKubeVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_OrchestratorScanService_GetKubeVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.OrchestratorScanService/GetKubeVulnerabilities", runtime.WithHTTPPathPattern("/v1/orchestrator/kube/vulnerabilities")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.OrchestratorScanService/GetKubeVulnerabilities", runtime.WithHTTPPathPattern("/v1/orchestrator/kube/vulnerabilities")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -181,20 +159,15 @@ func RegisterOrchestratorScanServiceHandlerServer(ctx context.Context, mux *runt runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OrchestratorScanService_GetKubeVulnerabilities_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_OrchestratorScanService_GetOpenShiftVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_OrchestratorScanService_GetOpenShiftVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.OrchestratorScanService/GetOpenShiftVulnerabilities", runtime.WithHTTPPathPattern("/v1/orchestrator/openshift/vulnerabilities")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.OrchestratorScanService/GetOpenShiftVulnerabilities", runtime.WithHTTPPathPattern("/v1/orchestrator/openshift/vulnerabilities")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -206,20 +179,15 @@ func RegisterOrchestratorScanServiceHandlerServer(ctx context.Context, mux *runt runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OrchestratorScanService_GetOpenShiftVulnerabilities_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_OrchestratorScanService_GetIstioVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_OrchestratorScanService_GetIstioVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.OrchestratorScanService/GetIstioVulnerabilities", runtime.WithHTTPPathPattern("/v1/orchestrator/istio/vulnerabilities/{istio_version}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.OrchestratorScanService/GetIstioVulnerabilities", runtime.WithHTTPPathPattern("/v1/orchestrator/istio/vulnerabilities/{istio_version}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -231,9 +199,7 @@ func RegisterOrchestratorScanServiceHandlerServer(ctx context.Context, mux *runt runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OrchestratorScanService_GetIstioVulnerabilities_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -242,25 +208,24 @@ func RegisterOrchestratorScanServiceHandlerServer(ctx context.Context, mux *runt // RegisterOrchestratorScanServiceHandlerFromEndpoint is same as RegisterOrchestratorScanServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterOrchestratorScanServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterOrchestratorScanServiceHandler(ctx, mux, conn) } @@ -274,16 +239,13 @@ func RegisterOrchestratorScanServiceHandler(ctx context.Context, mux *runtime.Se // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OrchestratorScanServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OrchestratorScanServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "OrchestratorScanServiceClient" to call the correct interceptors. +// "OrchestratorScanServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterOrchestratorScanServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrchestratorScanServiceClient) error { - - mux.Handle("GET", pattern_OrchestratorScanService_GetKubeVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_OrchestratorScanService_GetKubeVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/scannerV1.OrchestratorScanService/GetKubeVulnerabilities", runtime.WithHTTPPathPattern("/v1/orchestrator/kube/vulnerabilities")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scannerV1.OrchestratorScanService/GetKubeVulnerabilities", runtime.WithHTTPPathPattern("/v1/orchestrator/kube/vulnerabilities")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -294,18 +256,13 @@ func RegisterOrchestratorScanServiceHandlerClient(ctx context.Context, mux *runt runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OrchestratorScanService_GetKubeVulnerabilities_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_OrchestratorScanService_GetOpenShiftVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_OrchestratorScanService_GetOpenShiftVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/scannerV1.OrchestratorScanService/GetOpenShiftVulnerabilities", runtime.WithHTTPPathPattern("/v1/orchestrator/openshift/vulnerabilities")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scannerV1.OrchestratorScanService/GetOpenShiftVulnerabilities", runtime.WithHTTPPathPattern("/v1/orchestrator/openshift/vulnerabilities")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -316,18 +273,13 @@ func RegisterOrchestratorScanServiceHandlerClient(ctx context.Context, mux *runt runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OrchestratorScanService_GetOpenShiftVulnerabilities_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_OrchestratorScanService_GetIstioVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_OrchestratorScanService_GetIstioVulnerabilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/scannerV1.OrchestratorScanService/GetIstioVulnerabilities", runtime.WithHTTPPathPattern("/v1/orchestrator/istio/vulnerabilities/{istio_version}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scannerV1.OrchestratorScanService/GetIstioVulnerabilities", runtime.WithHTTPPathPattern("/v1/orchestrator/istio/vulnerabilities/{istio_version}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -338,26 +290,19 @@ func RegisterOrchestratorScanServiceHandlerClient(ctx context.Context, mux *runt runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OrchestratorScanService_GetIstioVulnerabilities_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } var ( - pattern_OrchestratorScanService_GetKubeVulnerabilities_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "orchestrator", "kube", "vulnerabilities"}, "")) - + pattern_OrchestratorScanService_GetKubeVulnerabilities_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "orchestrator", "kube", "vulnerabilities"}, "")) pattern_OrchestratorScanService_GetOpenShiftVulnerabilities_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "orchestrator", "openshift", "vulnerabilities"}, "")) - - pattern_OrchestratorScanService_GetIstioVulnerabilities_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "orchestrator", "istio", "vulnerabilities", "istio_version"}, "")) + pattern_OrchestratorScanService_GetIstioVulnerabilities_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "orchestrator", "istio", "vulnerabilities", "istio_version"}, "")) ) var ( - forward_OrchestratorScanService_GetKubeVulnerabilities_0 = runtime.ForwardResponseMessage - + forward_OrchestratorScanService_GetKubeVulnerabilities_0 = runtime.ForwardResponseMessage forward_OrchestratorScanService_GetOpenShiftVulnerabilities_0 = runtime.ForwardResponseMessage - - forward_OrchestratorScanService_GetIstioVulnerabilities_0 = runtime.ForwardResponseMessage + forward_OrchestratorScanService_GetIstioVulnerabilities_0 = runtime.ForwardResponseMessage ) diff --git a/generated/scanner/api/v1/orchestrator_scan_service_grpc.pb.go b/generated/scanner/api/v1/orchestrator_scan_service_grpc.pb.go index 1c1c23aeb..6e7c06738 100644 --- a/generated/scanner/api/v1/orchestrator_scan_service_grpc.pb.go +++ b/generated/scanner/api/v1/orchestrator_scan_service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc v3.21.4 // source: scanner/api/v1/orchestrator_scan_service.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( OrchestratorScanService_GetKubeVulnerabilities_FullMethodName = "/scannerV1.OrchestratorScanService/GetKubeVulnerabilities" @@ -75,7 +75,7 @@ func (c *orchestratorScanServiceClient) GetIstioVulnerabilities(ctx context.Cont // OrchestratorScanServiceServer is the server API for OrchestratorScanService service. // All implementations should embed UnimplementedOrchestratorScanServiceServer -// for forward compatibility +// for forward compatibility. // // OrchestratorScanService APIs can be used to get vulnerabilities for Kubernetes and Openshift components. type OrchestratorScanServiceServer interface { @@ -84,9 +84,12 @@ type OrchestratorScanServiceServer interface { GetIstioVulnerabilities(context.Context, *GetIstioVulnerabilitiesRequest) (*GetIstioVulnerabilitiesResponse, error) } -// UnimplementedOrchestratorScanServiceServer should be embedded to have forward compatible implementations. -type UnimplementedOrchestratorScanServiceServer struct { -} +// UnimplementedOrchestratorScanServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedOrchestratorScanServiceServer struct{} func (UnimplementedOrchestratorScanServiceServer) GetKubeVulnerabilities(context.Context, *GetKubeVulnerabilitiesRequest) (*GetKubeVulnerabilitiesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetKubeVulnerabilities not implemented") @@ -97,6 +100,7 @@ func (UnimplementedOrchestratorScanServiceServer) GetOpenShiftVulnerabilities(co func (UnimplementedOrchestratorScanServiceServer) GetIstioVulnerabilities(context.Context, *GetIstioVulnerabilitiesRequest) (*GetIstioVulnerabilitiesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetIstioVulnerabilities not implemented") } +func (UnimplementedOrchestratorScanServiceServer) testEmbeddedByValue() {} // UnsafeOrchestratorScanServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to OrchestratorScanServiceServer will @@ -106,6 +110,13 @@ type UnsafeOrchestratorScanServiceServer interface { } func RegisterOrchestratorScanServiceServer(s grpc.ServiceRegistrar, srv OrchestratorScanServiceServer) { + // If the following call pancis, it indicates UnimplementedOrchestratorScanServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&OrchestratorScanService_ServiceDesc, srv) } diff --git a/generated/scanner/api/v1/orchestrator_scan_service_vtproto.pb.go b/generated/scanner/api/v1/orchestrator_scan_service_vtproto.pb.go index 0f2f00ba7..0be5fd7f5 100644 --- a/generated/scanner/api/v1/orchestrator_scan_service_vtproto.pb.go +++ b/generated/scanner/api/v1/orchestrator_scan_service_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.6.0 +// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10 // source: scanner/api/v1/orchestrator_scan_service.proto package scannerV1 diff --git a/generated/scanner/api/v1/ping_service.pb.go b/generated/scanner/api/v1/ping_service.pb.go index 97ed956f8..f33895566 100644 --- a/generated/scanner/api/v1/ping_service.pb.go +++ b/generated/scanner/api/v1/ping_service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.36.0 // protoc v3.21.4 // source: scanner/api/v1/ping_service.proto @@ -21,21 +21,18 @@ const ( ) type PongMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ScannerVersion string `protobuf:"bytes,2,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + ScannerVersion string `protobuf:"bytes,2,opt,name=scanner_version,json=scannerVersion,proto3" json:"scanner_version,omitempty"` + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *PongMessage) Reset() { *x = PongMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_ping_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_ping_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PongMessage) String() string { @@ -46,7 +43,7 @@ func (*PongMessage) ProtoMessage() {} func (x *PongMessage) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_ping_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -134,20 +131,6 @@ func file_scanner_api_v1_ping_service_proto_init() { return } file_scanner_api_v1_empty_proto_init() - if !protoimpl.UnsafeEnabled { - file_scanner_api_v1_ping_service_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*PongMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/generated/scanner/api/v1/ping_service.pb.gw.go b/generated/scanner/api/v1/ping_service.pb.gw.go index 275e30de8..63778c2a2 100644 --- a/generated/scanner/api/v1/ping_service.pb.gw.go +++ b/generated/scanner/api/v1/ping_service.pb.gw.go @@ -10,6 +10,7 @@ package scannerV1 import ( "context" + "errors" "io" "net/http" @@ -24,46 +25,47 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_PingService_Ping_0(ctx context.Context, marshaler runtime.Marshaler, client PingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Empty - var metadata runtime.ServerMetadata - + var ( + protoReq Empty + metadata runtime.ServerMetadata + ) msg, err := client.Ping(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_PingService_Ping_0(ctx context.Context, marshaler runtime.Marshaler, server PingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Empty - var metadata runtime.ServerMetadata - + var ( + protoReq Empty + metadata runtime.ServerMetadata + ) msg, err := server.Ping(ctx, &protoReq) return msg, metadata, err - } // RegisterPingServiceHandlerServer registers the http handlers for service PingService to "mux". // UnaryRPC :call PingServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPingServiceHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterPingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PingServiceServer) error { - - mux.Handle("GET", pattern_PingService_Ping_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_PingService_Ping_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.PingService/Ping", runtime.WithHTTPPathPattern("/v1/ping")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/scannerV1.PingService/Ping", runtime.WithHTTPPathPattern("/v1/ping")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -75,9 +77,7 @@ func RegisterPingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_PingService_Ping_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -86,25 +86,24 @@ func RegisterPingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux // RegisterPingServiceHandlerFromEndpoint is same as RegisterPingServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterPingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterPingServiceHandler(ctx, mux, conn) } @@ -118,16 +117,13 @@ func RegisterPingServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PingServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PingServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "PingServiceClient" to call the correct interceptors. +// "PingServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterPingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PingServiceClient) error { - - mux.Handle("GET", pattern_PingService_Ping_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_PingService_Ping_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/scannerV1.PingService/Ping", runtime.WithHTTPPathPattern("/v1/ping")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/scannerV1.PingService/Ping", runtime.WithHTTPPathPattern("/v1/ping")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -138,11 +134,8 @@ func RegisterPingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_PingService_Ping_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } diff --git a/generated/scanner/api/v1/ping_service_grpc.pb.go b/generated/scanner/api/v1/ping_service_grpc.pb.go index 377732346..62b5ab5ea 100644 --- a/generated/scanner/api/v1/ping_service_grpc.pb.go +++ b/generated/scanner/api/v1/ping_service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc v3.21.4 // source: scanner/api/v1/ping_service.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( PingService_Ping_FullMethodName = "/scannerV1.PingService/Ping" @@ -49,18 +49,22 @@ func (c *pingServiceClient) Ping(ctx context.Context, in *Empty, opts ...grpc.Ca // PingServiceServer is the server API for PingService service. // All implementations should embed UnimplementedPingServiceServer -// for forward compatibility +// for forward compatibility. type PingServiceServer interface { Ping(context.Context, *Empty) (*PongMessage, error) } -// UnimplementedPingServiceServer should be embedded to have forward compatible implementations. -type UnimplementedPingServiceServer struct { -} +// UnimplementedPingServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedPingServiceServer struct{} func (UnimplementedPingServiceServer) Ping(context.Context, *Empty) (*PongMessage, error) { return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") } +func (UnimplementedPingServiceServer) testEmbeddedByValue() {} // UnsafePingServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to PingServiceServer will @@ -70,6 +74,13 @@ type UnsafePingServiceServer interface { } func RegisterPingServiceServer(s grpc.ServiceRegistrar, srv PingServiceServer) { + // If the following call pancis, it indicates UnimplementedPingServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&PingService_ServiceDesc, srv) } diff --git a/generated/scanner/api/v1/ping_service_vtproto.pb.go b/generated/scanner/api/v1/ping_service_vtproto.pb.go index 176b3664b..91b895a9d 100644 --- a/generated/scanner/api/v1/ping_service_vtproto.pb.go +++ b/generated/scanner/api/v1/ping_service_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.6.0 +// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10 // source: scanner/api/v1/ping_service.proto package scannerV1 diff --git a/generated/scanner/api/v1/vulnerability.pb.go b/generated/scanner/api/v1/vulnerability.pb.go index 63bdc668c..c2edfb13f 100644 --- a/generated/scanner/api/v1/vulnerability.pb.go +++ b/generated/scanner/api/v1/vulnerability.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.36.0 // protoc v3.21.4 // source: scanner/api/v1/vulnerability.proto @@ -22,27 +22,24 @@ const ( // Net tag: 9 type Feature struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - FeatureType string `protobuf:"bytes,4,opt,name=feature_type,json=featureType,proto3" json:"feature_type,omitempty"` - AddedByLayer string `protobuf:"bytes,5,opt,name=added_by_layer,json=addedByLayer,proto3" json:"added_by_layer,omitempty"` - Location string `protobuf:"bytes,6,opt,name=location,proto3" json:"location,omitempty"` - Vulnerabilities []*Vulnerability `protobuf:"bytes,3,rep,name=vulnerabilities,proto3" json:"vulnerabilities,omitempty"` - FixedBy string `protobuf:"bytes,8,opt,name=fixed_by,json=fixedBy,proto3" json:"fixed_by,omitempty"` - ProvidedExecutables []*Executable `protobuf:"bytes,7,rep,name=provided_executables,json=providedExecutables,proto3" json:"provided_executables,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + FeatureType string `protobuf:"bytes,4,opt,name=feature_type,json=featureType,proto3" json:"feature_type,omitempty"` + AddedByLayer string `protobuf:"bytes,5,opt,name=added_by_layer,json=addedByLayer,proto3" json:"added_by_layer,omitempty"` + Location string `protobuf:"bytes,6,opt,name=location,proto3" json:"location,omitempty"` + Vulnerabilities []*Vulnerability `protobuf:"bytes,3,rep,name=vulnerabilities,proto3" json:"vulnerabilities,omitempty"` + FixedBy string `protobuf:"bytes,8,opt,name=fixed_by,json=fixedBy,proto3" json:"fixed_by,omitempty"` + ProvidedExecutables []*Executable `protobuf:"bytes,7,rep,name=provided_executables,json=providedExecutables,proto3" json:"provided_executables,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Feature) Reset() { *x = Feature{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Feature) String() string { @@ -53,7 +50,7 @@ func (*Feature) ProtoMessage() {} func (x *Feature) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -125,21 +122,18 @@ func (x *Feature) GetProvidedExecutables() []*Executable { } type Executable struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - RequiredFeatures []*FeatureNameVersion `protobuf:"bytes,2,rep,name=required_features,json=requiredFeatures,proto3" json:"required_features,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + RequiredFeatures []*FeatureNameVersion `protobuf:"bytes,2,rep,name=required_features,json=requiredFeatures,proto3" json:"required_features,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Executable) Reset() { *x = Executable{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Executable) String() string { @@ -150,7 +144,7 @@ func (*Executable) ProtoMessage() {} func (x *Executable) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -180,21 +174,18 @@ func (x *Executable) GetRequiredFeatures() []*FeatureNameVersion { } type FeatureNameVersion struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + sizeCache protoimpl.SizeCache } func (x *FeatureNameVersion) Reset() { *x = FeatureNameVersion{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *FeatureNameVersion) String() string { @@ -205,7 +196,7 @@ func (*FeatureNameVersion) ProtoMessage() {} func (x *FeatureNameVersion) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -236,25 +227,22 @@ func (x *FeatureNameVersion) GetVersion() string { // Next tag: 7 type Vulnerability struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Link string `protobuf:"bytes,3,opt,name=link,proto3" json:"link,omitempty"` + MetadataV2 *Metadata `protobuf:"bytes,6,opt,name=metadata_v2,json=metadataV2,proto3" json:"metadata_v2,omitempty"` + FixedBy string `protobuf:"bytes,5,opt,name=fixed_by,json=fixedBy,proto3" json:"fixed_by,omitempty"` + Severity string `protobuf:"bytes,7,opt,name=severity,proto3" json:"severity,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Link string `protobuf:"bytes,3,opt,name=link,proto3" json:"link,omitempty"` - MetadataV2 *Metadata `protobuf:"bytes,6,opt,name=metadata_v2,json=metadataV2,proto3" json:"metadata_v2,omitempty"` - FixedBy string `protobuf:"bytes,5,opt,name=fixed_by,json=fixedBy,proto3" json:"fixed_by,omitempty"` - Severity string `protobuf:"bytes,7,opt,name=severity,proto3" json:"severity,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Vulnerability) Reset() { *x = Vulnerability{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Vulnerability) String() string { @@ -265,7 +253,7 @@ func (*Vulnerability) ProtoMessage() {} func (x *Vulnerability) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -323,23 +311,20 @@ func (x *Vulnerability) GetSeverity() string { } type Metadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PublishedDateTime string `protobuf:"bytes,1,opt,name=published_date_time,json=publishedDateTime,proto3" json:"published_date_time,omitempty"` - LastModifiedDateTime string `protobuf:"bytes,2,opt,name=last_modified_date_time,json=lastModifiedDateTime,proto3" json:"last_modified_date_time,omitempty"` - CvssV2 *CVSSMetadata `protobuf:"bytes,3,opt,name=cvss_v2,json=cvssV2,proto3" json:"cvss_v2,omitempty"` - CvssV3 *CVSSMetadata `protobuf:"bytes,4,opt,name=cvss_v3,json=cvssV3,proto3" json:"cvss_v3,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + PublishedDateTime string `protobuf:"bytes,1,opt,name=published_date_time,json=publishedDateTime,proto3" json:"published_date_time,omitempty"` + LastModifiedDateTime string `protobuf:"bytes,2,opt,name=last_modified_date_time,json=lastModifiedDateTime,proto3" json:"last_modified_date_time,omitempty"` + CvssV2 *CVSSMetadata `protobuf:"bytes,3,opt,name=cvss_v2,json=cvssV2,proto3" json:"cvss_v2,omitempty"` + CvssV3 *CVSSMetadata `protobuf:"bytes,4,opt,name=cvss_v3,json=cvssV3,proto3" json:"cvss_v3,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Metadata) Reset() { *x = Metadata{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Metadata) String() string { @@ -350,7 +335,7 @@ func (*Metadata) ProtoMessage() {} func (x *Metadata) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -394,23 +379,20 @@ func (x *Metadata) GetCvssV3() *CVSSMetadata { } type CVSSMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Vector string `protobuf:"bytes,1,opt,name=vector,proto3" json:"vector,omitempty"` - Score float32 `protobuf:"fixed32,2,opt,name=score,proto3" json:"score,omitempty"` - ExploitabilityScore float32 `protobuf:"fixed32,3,opt,name=exploitability_score,json=exploitabilityScore,proto3" json:"exploitability_score,omitempty"` - ImpactScore float32 `protobuf:"fixed32,4,opt,name=impact_score,json=impactScore,proto3" json:"impact_score,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Vector string `protobuf:"bytes,1,opt,name=vector,proto3" json:"vector,omitempty"` + Score float32 `protobuf:"fixed32,2,opt,name=score,proto3" json:"score,omitempty"` + ExploitabilityScore float32 `protobuf:"fixed32,3,opt,name=exploitability_score,json=exploitabilityScore,proto3" json:"exploitability_score,omitempty"` + ImpactScore float32 `protobuf:"fixed32,4,opt,name=impact_score,json=impactScore,proto3" json:"impact_score,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CVSSMetadata) Reset() { *x = CVSSMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CVSSMetadata) String() string { @@ -421,7 +403,7 @@ func (*CVSSMetadata) ProtoMessage() {} func (x *CVSSMetadata) ProtoReflect() protoreflect.Message { mi := &file_scanner_api_v1_vulnerability_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -583,80 +565,6 @@ func file_scanner_api_v1_vulnerability_proto_init() { if File_scanner_api_v1_vulnerability_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_scanner_api_v1_vulnerability_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Feature); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_vulnerability_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Executable); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_vulnerability_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*FeatureNameVersion); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_vulnerability_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*Vulnerability); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_vulnerability_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*Metadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_scanner_api_v1_vulnerability_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*CVSSMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/generated/scanner/api/v1/vulnerability_vtproto.pb.go b/generated/scanner/api/v1/vulnerability_vtproto.pb.go index 75f4ca0cb..b83aa7d11 100644 --- a/generated/scanner/api/v1/vulnerability_vtproto.pb.go +++ b/generated/scanner/api/v1/vulnerability_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.6.0 +// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10 // source: scanner/api/v1/vulnerability.proto package scannerV1 diff --git a/go.mod b/go.mod index 48ff6dc02..1798fb1fe 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/stackrox/scanner -go 1.22 +go 1.22.0 toolchain go1.22.5 @@ -20,7 +20,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.1-0.20210315223345-82c243799c99 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 github.com/guregu/null v4.0.0+incompatible github.com/hashicorp/go-version v1.7.0 github.com/heroku/docker-registry-client v0.0.0 @@ -50,14 +50,14 @@ require ( golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 golang.org/x/sys v0.28.0 google.golang.org/api v0.210.0 - google.golang.org/grpc v1.67.2 + google.golang.org/grpc v1.69.2 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 - google.golang.org/protobuf v1.35.2 + google.golang.org/protobuf v1.36.0 gopkg.in/yaml.v2 v2.4.0 ) require ( - cel.dev/expr v0.16.1 // indirect + cel.dev/expr v0.16.2 // indirect cloud.google.com/go v0.116.0 // indirect cloud.google.com/go/auth v0.11.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect @@ -65,7 +65,7 @@ require ( cloud.google.com/go/iam v1.2.2 // indirect cloud.google.com/go/monitoring v1.21.2 // indirect dario.cat/mergo v1.0.0 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.1 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.2 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect @@ -88,7 +88,7 @@ require ( github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/emirpasic/gods v1.18.1 // indirect - github.com/envoyproxy/go-control-plane v0.13.0 // indirect + github.com/envoyproxy/go-control-plane v0.13.1 // indirect github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect github.com/evanphx/json-patch v5.7.0+incompatible // indirect github.com/facebookincubator/flog v0.0.0-20190930132826-d2511d0ce33c // indirect @@ -151,14 +151,14 @@ require ( github.com/zmap/zcrypto v0.0.0-20230310154051-c8b263fd8300 // indirect github.com/zmap/zlint/v3 v3.5.0 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/detectors/gcp v1.29.0 // indirect + go.opentelemetry.io/contrib/detectors/gcp v1.31.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/mock v0.4.0 // indirect go.uber.org/multierr v1.11.0 // indirect @@ -172,9 +172,8 @@ require ( golang.org/x/time v0.8.0 // indirect golang.stackrox.io/grpc-http1 v0.3.12 // indirect google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697 // indirect - google.golang.org/grpc/stats/opentelemetry v0.0.0-20240907200651-3ffb98b2c93a // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241219192143-6b3ec007d9bb // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 79fc4d72c..0ea77dc17 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -cel.dev/expr v0.16.1 h1:NR0+oFYzR1CqLFhTAqg3ql59G9VfN8fKq1TCHJ6gq1g= -cel.dev/expr v0.16.1/go.mod h1:AsGA5zb3WruAEQeQng1RZdGEXmBj0jvMWh6l5SnNuC8= +cel.dev/expr v0.16.2 h1:RwRhoH17VhAu9U5CMvMhH1PDVgf0tuz9FT+24AfMLfU= +cel.dev/expr v0.16.2/go.mod h1:gXngZQMkWJoSbE8mOzehJlXQyubn/Vg0vR9/F3W7iw8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -77,8 +77,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.1 h1:pB2F2JKCj1Znmp2rwxxt1J0Fg0wezTMgWYk5Mpbi1kg= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.1/go.mod h1:itPGVDKf9cC/ov4MdvJ2QZ0khw4bfoo9jzwTJlaxy2k= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.2 h1:cZpsGsWTIFKymTA0je7IIvi1O7Es7apb9CF3EQlOcfE= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.2/go.mod h1:itPGVDKf9cC/ov4MdvJ2QZ0khw4bfoo9jzwTJlaxy2k= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 h1:UQ0AhxogsIRZDkElkblfnwjc3IaltCm2HUMvezQaL7s= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1/go.mod h1:jyqM3eLpJ3IbIFDTKVz2rF9T/xWGW0rIriGwnz8l9Tk= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.48.1 h1:oTX4vsorBZo/Zdum6OKPA4o7544hm6smoRv1QjpTwGo= @@ -210,8 +210,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= -github.com/envoyproxy/go-control-plane v0.13.0 h1:HzkeUz1Knt+3bK+8LG1bxOO/jzWZmdxpwC51i202les= -github.com/envoyproxy/go-control-plane v0.13.0/go.mod h1:GRaKG3dwvFoTg4nj7aXdZnvMg4d7nvT/wl9WgVXn3Q8= +github.com/envoyproxy/go-control-plane v0.13.1 h1:vPfJZCkob6yTMEgS+0TwfTUfbHjfy/6vOJ8hUWX/uXE= +github.com/envoyproxy/go-control-plane v0.13.1/go.mod h1:X45hY0mufo6Fd0KW3rqsGvQMw58jvjymeCzBU3mWyHw= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM= @@ -391,8 +391,8 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vb github.com/grpc-ecosystem/go-grpc-prometheus v1.2.1-0.20210315223345-82c243799c99 h1:JYghRBlGCZyCF2wNUJ8W0cwaQdtpcssJ4CgC406g+WU= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.1-0.20210315223345-82c243799c99/go.mod h1:3bDW6wMZJB7tiONtC/1Xpicra6Wp5GgbTbQWCbI5fkc= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 h1:ad0vkEBuk23VJzZR9nkLVG0YAoN9coASF1GusYX6AlU= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0/go.mod h1:igFoXX2ELCW06bol23DWPB5BEWfZISOzSP5K2sbLea0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ= github.com/guregu/null v4.0.0+incompatible h1:4zw0ckM7ECd6FNNddc3Fu4aty9nTlpkkzH7dPn4/4Gw= github.com/guregu/null v4.0.0+incompatible/go.mod h1:ePGpQaN9cw0tj45IR5E5ehMvsFlLlQZAkkOXZurJ3NM= github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= @@ -720,26 +720,26 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/detectors/gcp v1.29.0 h1:TiaiXB4DpGD3sdzNlYQxruQngn5Apwzi1X0DRhuGvDQ= -go.opentelemetry.io/contrib/detectors/gcp v1.29.0/go.mod h1:GW2aWZNwR2ZxDLdv8OyC2G8zkRoQBuURgV7RPQgcPoU= +go.opentelemetry.io/contrib/detectors/gcp v1.31.0 h1:G1JQOreVrfhRkner+l4mrGxmfqYCAuy76asTDAo0xsA= +go.opentelemetry.io/contrib/detectors/gcp v1.31.0/go.mod h1:tzQL6E1l+iV44YFTkcAeNQqzXUiekSYP9jjJjXwEd00= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= go.opentelemetry.io/otel v1.6.3/go.mod h1:7BgNga5fNlF/iZjG06hM3yofffp0ofKCDwSXx1GC4dI= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= -go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= go.opentelemetry.io/otel/trace v1.6.3/go.mod h1:GNJQusJlUgZl9/TQBPKU/Y/ty+0iVB5fjhKeJGZPGFs= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= @@ -1181,10 +1181,10 @@ google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= -google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f h1:M65LEviCfuZTfrfzwwEoxVtgvfkFkBUbFnRbxCXuXhU= -google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f/go.mod h1:Yo94eF2nj7igQt+TiJ49KxjIH8ndLYPZMIRSiRcEbg0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697 h1:LWZqQOEjDyONlF1H6afSWpAL/znlREo2tHfLoe+8LMA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/genproto/googleapis/api v0.0.0-20241219192143-6b3ec007d9bb h1:B7GIB7sr443wZ/EAEl7VZjmh1V6qzkt5V+RYcUYtS1U= +google.golang.org/genproto/googleapis/api v0.0.0-20241219192143-6b3ec007d9bb/go.mod h1:E5//3O5ZIG2l71Xnt+P/CYUY8Bxs8E7WMoZ9tlcMbAY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb h1:3oy2tynMOP1QbTC0MsNNAV+Se8M2Bd0A5+x1QHyw+pI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb/go.mod h1:lcTa1sDdWEIHMWlITnIczmw5w60CF9ffkb8Z+DVmmjA= google.golang.org/grpc v1.18.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1213,15 +1213,13 @@ google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.67.2 h1:Lq11HW1nr5m4OYV+ZVy2BjOK78/zqnTx24vyDBP1JcQ= -google.golang.org/grpc v1.67.2/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= +google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 h1:F29+wU6Ee6qgu9TddPgooOdaqsxTMunOoj8KA5yuS5A= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1/go.mod h1:5KF+wpkbTSbGcR9zteSqZV6fqFOWBl4Yde8En8MryZA= google.golang.org/grpc/examples v0.0.0-20210902184326-c93e472777b9 h1:nuV5/Eu1pLmXFqSuM5yYgg1z+m3f7+HC1HO1xsmCz9I= google.golang.org/grpc/examples v0.0.0-20210902184326-c93e472777b9/go.mod h1:gID3PKrg7pWKntu9Ss6zTLJ0ttC0X9IHgREOCZwbCVU= -google.golang.org/grpc/stats/opentelemetry v0.0.0-20240907200651-3ffb98b2c93a h1:UIpYSuWdWHSzjwcAFRLjKcPXFZVVLXGEM23W+NWqipw= -google.golang.org/grpc/stats/opentelemetry v0.0.0-20240907200651-3ffb98b2c93a/go.mod h1:9i1T9n4ZinTUZGgzENMi8MDDgbGC5mqTS75JAv6xN3A= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1237,8 +1235,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= -google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ= +google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=