diff --git a/CHANGELOG.md b/CHANGELOG.md index 50d7f25d..62180f9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Upcoming changes... +## [1.31.5] - 2025-08-27 +### Added +- Added jira markdown option for DT +- Added Dependency Track project link to markdown summary +- Updated protobuf client definitions +- Added date field to `scanoss-py comp versions` response + ## [1.31.4] - 2025-08-20 ### Added - Added support for empty dependency track project policy checks @@ -648,3 +655,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [1.31.2]: https://github.com/scanoss/scanoss.py/compare/v1.31.1...v1.31.2 [1.31.3]: https://github.com/scanoss/scanoss.py/compare/v1.31.2...v1.31.3 [1.31.4]: https://github.com/scanoss/scanoss.py/compare/v1.31.3...v1.31.4 +[1.31.5]: https://github.com/scanoss/scanoss.py/compare/v1.31.4...v1.31.5 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 0925b1e2..a3163499 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,4 +24,4 @@ line-ending = "auto" known-first-party = ["scanoss"] [tool.ruff.lint.pylint] -max-args = 5 +max-args = 6 diff --git a/requirements.txt b/requirements.txt index 4add4629..1d3fc07c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,5 +13,5 @@ packageurl-python pathspec jsonschema crc - +protoc-gen-openapiv2 cyclonedx-python-lib[validation] \ No newline at end of file diff --git a/scanoss.json b/scanoss.json index 37724c38..813b121a 100644 --- a/scanoss.json +++ b/scanoss.json @@ -1,7 +1,13 @@ { "settings": { "skip": { - "patterns": {}, + "patterns": { + "scanning": [ + "src/protoc_gen_swagger/", + "src/scanoss/api/", + "docs/make.bat" + ] + }, "sizes": {} } }, @@ -10,24 +16,6 @@ { "purl": "pkg:github/scanoss/scanoss.py" } - ], - "remove": [ - { - "path": "docs/make.bat", - "purl": "pkg:github/twilight-logic/ar488" - }, - { - "path": "src/protoc_gen_swagger/options/annotations_pb2_grpc.py", - "purl": "pkg:pypi/bauplan" - }, - { - "path": "src/protoc_gen_swagger/options/openapiv2_pb2_grpc.py", - "purl": "pkg:pypi/bauplan" - }, - { - "path": "src/scanoss/api/common/v2/scanoss_common_pb2_grpc.py", - "purl": "pkg:pypi/bauplan" - } ] } } \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 36e0d74b..cb37a860 100644 --- a/setup.cfg +++ b/setup.cfg @@ -39,9 +39,9 @@ install_requires = pathspec jsonschema crc + protoc-gen-openapiv2 cyclonedx-python-lib[validation] - [options.extras_require] fast_winnowing = scanoss_winnowing>=0.5.0 diff --git a/src/scanoss/__init__.py b/src/scanoss/__init__.py index 9287075b..d37886ff 100644 --- a/src/scanoss/__init__.py +++ b/src/scanoss/__init__.py @@ -22,4 +22,4 @@ THE SOFTWARE. """ -__version__ = '1.31.4' +__version__ = '1.31.5' diff --git a/src/scanoss/api/common/v2/scanoss_common_pb2.py b/src/scanoss/api/common/v2/scanoss_common_pb2.py index cbcd2e5b..a82eb997 100644 --- a/src/scanoss/api/common/v2/scanoss_common_pb2.py +++ b/src/scanoss/api/common/v2/scanoss_common_pb2.py @@ -1,38 +1,63 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: scanoss/api/common/v2/scanoss-common.proto +# Protobuf Python Version: 6.31.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 0, + '', + 'scanoss/api/common/v2/scanoss-common.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() +from protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*scanoss/api/common/v2/scanoss-common.proto\x12\x15scanoss.api.common.v2\"T\n\x0eStatusResponse\x12\x31\n\x06status\x18\x01 \x01(\x0e\x32!.scanoss.api.common.v2.StatusCode\x12\x0f\n\x07message\x18\x02 \x01(\t\"\x1e\n\x0b\x45\x63hoRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\"\x1f\n\x0c\x45\x63hoResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\"r\n\x0bPurlRequest\x12\x37\n\x05purls\x18\x01 \x03(\x0b\x32(.scanoss.api.common.v2.PurlRequest.Purls\x1a*\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x13\n\x0brequirement\x18\x02 \x01(\t\")\n\x04Purl\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x13\n\x0brequirement\x18\x02 \x01(\t*`\n\nStatusCode\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\x1b\n\x17SUCCEEDED_WITH_WARNINGS\x10\x02\x12\x0b\n\x07WARNING\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x42/Z-github.com/scanoss/papi/api/commonv2;commonv2b\x06proto3') - -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scanoss.api.common.v2.scanoss_common_pb2', globals()) -if _descriptor._USE_C_DESCRIPTORS == False: +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*scanoss/api/common/v2/scanoss-common.proto\x12\x15scanoss.api.common.v2\x1a.protoc-gen-openapiv2/options/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\"T\n\x0eStatusResponse\x12\x31\n\x06status\x18\x01 \x01(\x0e\x32!.scanoss.api.common.v2.StatusCode\x12\x0f\n\x07message\x18\x02 \x01(\t\"\x1e\n\x0b\x45\x63hoRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\"\x1f\n\x0c\x45\x63hoResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\"k\n\x10\x43omponentRequest\x12\x11\n\x04purl\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0brequirement\x18\x02 \x01(\t:/\x92\x41,2*{\"purl\":\"pkg:github/scanoss/engine@1.0.0\"}\"\xc8\x01\n\x11\x43omponentsRequest\x12@\n\ncomponents\x18\x01 \x03(\x0b\x32\'.scanoss.api.common.v2.ComponentRequestB\x03\xe0\x41\x02:q\x92\x41n2l{\"components\":[{\"purl\":\"pkg:github/scanoss/engine@1.0.0\"},{\"purl\":\"pkg:github/scanoss/scanoss.py@v1.30.0\"}]}\"r\n\x0bPurlRequest\x12\x37\n\x05purls\x18\x01 \x03(\x0b\x32(.scanoss.api.common.v2.PurlRequest.Purls\x1a*\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x13\n\x0brequirement\x18\x02 \x01(\t\")\n\x04Purl\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x13\n\x0brequirement\x18\x02 \x01(\t*`\n\nStatusCode\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\x1b\n\x17SUCCEEDED_WITH_WARNINGS\x10\x02\x12\x0b\n\x07WARNING\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x42/Z-github.com/scanoss/papi/api/commonv2;commonv2b\x06proto3') - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z-github.com/scanoss/papi/api/commonv2;commonv2' - _STATUSCODE._serialized_start=379 - _STATUSCODE._serialized_end=475 - _STATUSRESPONSE._serialized_start=69 - _STATUSRESPONSE._serialized_end=153 - _ECHOREQUEST._serialized_start=155 - _ECHOREQUEST._serialized_end=185 - _ECHORESPONSE._serialized_start=187 - _ECHORESPONSE._serialized_end=218 - _PURLREQUEST._serialized_start=220 - _PURLREQUEST._serialized_end=334 - _PURLREQUEST_PURLS._serialized_start=292 - _PURLREQUEST_PURLS._serialized_end=334 - _PURL._serialized_start=336 - _PURL._serialized_end=377 +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scanoss.api.common.v2.scanoss_common_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'Z-github.com/scanoss/papi/api/commonv2;commonv2' + _globals['_COMPONENTREQUEST'].fields_by_name['purl']._loaded_options = None + _globals['_COMPONENTREQUEST'].fields_by_name['purl']._serialized_options = b'\340A\002' + _globals['_COMPONENTREQUEST']._loaded_options = None + _globals['_COMPONENTREQUEST']._serialized_options = b'\222A,2*{\"purl\":\"pkg:github/scanoss/engine@1.0.0\"}' + _globals['_COMPONENTSREQUEST'].fields_by_name['components']._loaded_options = None + _globals['_COMPONENTSREQUEST'].fields_by_name['components']._serialized_options = b'\340A\002' + _globals['_COMPONENTSREQUEST']._loaded_options = None + _globals['_COMPONENTSREQUEST']._serialized_options = b'\222An2l{\"components\":[{\"purl\":\"pkg:github/scanoss/engine@1.0.0\"},{\"purl\":\"pkg:github/scanoss/scanoss.py@v1.30.0\"}]}' + _globals['_STATUSCODE']._serialized_start=772 + _globals['_STATUSCODE']._serialized_end=868 + _globals['_STATUSRESPONSE']._serialized_start=150 + _globals['_STATUSRESPONSE']._serialized_end=234 + _globals['_ECHOREQUEST']._serialized_start=236 + _globals['_ECHOREQUEST']._serialized_end=266 + _globals['_ECHORESPONSE']._serialized_start=268 + _globals['_ECHORESPONSE']._serialized_end=299 + _globals['_COMPONENTREQUEST']._serialized_start=301 + _globals['_COMPONENTREQUEST']._serialized_end=408 + _globals['_COMPONENTSREQUEST']._serialized_start=411 + _globals['_COMPONENTSREQUEST']._serialized_end=611 + _globals['_PURLREQUEST']._serialized_start=613 + _globals['_PURLREQUEST']._serialized_end=727 + _globals['_PURLREQUEST_PURLS']._serialized_start=685 + _globals['_PURLREQUEST_PURLS']._serialized_end=727 + _globals['_PURL']._serialized_start=729 + _globals['_PURL']._serialized_end=770 # @@protoc_insertion_point(module_scope) diff --git a/src/scanoss/api/common/v2/scanoss_common_pb2_grpc.py b/src/scanoss/api/common/v2/scanoss_common_pb2_grpc.py index 2daafffe..b5c3c03c 100644 --- a/src/scanoss/api/common/v2/scanoss_common_pb2_grpc.py +++ b/src/scanoss/api/common/v2/scanoss_common_pb2_grpc.py @@ -1,4 +1,24 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings + +GRPC_GENERATED_VERSION = '1.73.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in scanoss/api/common/v2/scanoss_common_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/src/scanoss/api/components/v2/scanoss_components_pb2.py b/src/scanoss/api/components/v2/scanoss_components_pb2.py index cf1290a9..3820ed92 100644 --- a/src/scanoss/api/components/v2/scanoss_components_pb2.py +++ b/src/scanoss/api/components/v2/scanoss_components_pb2.py @@ -1,11 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: scanoss/api/components/v2/scanoss-components.proto +# Protobuf Python Version: 6.31.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 0, + '', + 'scanoss/api/components/v2/scanoss-components.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -13,49 +24,49 @@ from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from protoc_gen_swagger.options import annotations_pb2 as protoc__gen__swagger_dot_options_dot_annotations__pb2 - +from protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n2scanoss/api/components/v2/scanoss-components.proto\x12\x19scanoss.api.components.v2\x1a*scanoss/api/common/v2/scanoss-common.proto\x1a\x1cgoogle/api/annotations.proto\x1a,protoc-gen-swagger/options/annotations.proto\"v\n\x11\x43ompSearchRequest\x12\x0e\n\x06search\x18\x01 \x01(\t\x12\x0e\n\x06vendor\x18\x02 \x01(\t\x12\x11\n\tcomponent\x18\x03 \x01(\t\x12\x0f\n\x07package\x18\x04 \x01(\t\x12\r\n\x05limit\x18\x06 \x01(\x05\x12\x0e\n\x06offset\x18\x07 \x01(\x05\"\xca\x01\n\rCompStatistic\x12\x1a\n\x12total_source_files\x18\x01 \x01(\x05\x12\x13\n\x0btotal_lines\x18\x02 \x01(\x05\x12\x19\n\x11total_blank_lines\x18\x03 \x01(\x05\x12\x44\n\tlanguages\x18\x04 \x03(\x0b\x32\x31.scanoss.api.components.v2.CompStatistic.Language\x1a\'\n\x08Language\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05\x66iles\x18\x02 \x01(\x05\"\xfb\x01\n\x15\x43ompStatisticResponse\x12\x45\n\x05purls\x18\x01 \x03(\x0b\x32\x36.scanoss.api.components.v2.CompStatisticResponse.Purls\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a\x64\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12<\n\nstatistics\x18\x03 \x01(\x0b\x32(.scanoss.api.components.v2.CompStatistic\"\xd3\x01\n\x12\x43ompSearchResponse\x12K\n\ncomponents\x18\x01 \x03(\x0b\x32\x37.scanoss.api.components.v2.CompSearchResponse.Component\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a\x39\n\tComponent\x12\x11\n\tcomponent\x18\x01 \x01(\t\x12\x0c\n\x04purl\x18\x02 \x01(\t\x12\x0b\n\x03url\x18\x03 \x01(\t\"1\n\x12\x43ompVersionRequest\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x05\"\xd6\x03\n\x13\x43ompVersionResponse\x12K\n\tcomponent\x18\x01 \x01(\x0b\x32\x38.scanoss.api.components.v2.CompVersionResponse.Component\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1aO\n\x07License\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07spdx_id\x18\x02 \x01(\t\x12\x18\n\x10is_spdx_approved\x18\x03 \x01(\x08\x12\x0b\n\x03url\x18\x04 \x01(\t\x1a\x64\n\x07Version\x12\x0f\n\x07version\x18\x01 \x01(\t\x12H\n\x08licenses\x18\x04 \x03(\x0b\x32\x36.scanoss.api.components.v2.CompVersionResponse.License\x1a\x83\x01\n\tComponent\x12\x11\n\tcomponent\x18\x01 \x01(\t\x12\x0c\n\x04purl\x18\x02 \x01(\t\x12\x0b\n\x03url\x18\x03 \x01(\t\x12H\n\x08versions\x18\x04 \x03(\x0b\x32\x36.scanoss.api.components.v2.CompVersionResponse.Version2\xd4\x04\n\nComponents\x12s\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"\"\x82\xd3\xe4\x93\x02\x1c\"\x17/api/v2/components/echo:\x01*\x12\x95\x01\n\x10SearchComponents\x12,.scanoss.api.components.v2.CompSearchRequest\x1a-.scanoss.api.components.v2.CompSearchResponse\"$\x82\xd3\xe4\x93\x02\x1e\"\x19/api/v2/components/search:\x01*\x12\x9d\x01\n\x14GetComponentVersions\x12-.scanoss.api.components.v2.CompVersionRequest\x1a..scanoss.api.components.v2.CompVersionResponse\"&\x82\xd3\xe4\x93\x02 \"\x1b/api/v2/components/versions:\x01*\x12\x98\x01\n\x16GetComponentStatistics\x12\".scanoss.api.common.v2.PurlRequest\x1a\x30.scanoss.api.components.v2.CompStatisticResponse\"(\x82\xd3\xe4\x93\x02\"\"\x1d/api/v2/components/statistics:\x01*B\x94\x02Z5github.com/scanoss/papi/api/componentsv2;componentsv2\x92\x41\xd9\x01\x12s\n\x1aSCANOSS Components Service\"P\n\x12scanoss-components\x12%https://github.com/scanoss/components\x1a\x13support@scanoss.com2\x03\x32.0*\x01\x01\x32\x10\x61pplication/json:\x10\x61pplication/jsonR;\n\x03\x34\x30\x34\x12\x34\n*Returned when the resource does not exist.\x12\x06\n\x04\x9a\x02\x01\x07\x62\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scanoss.api.components.v2.scanoss_components_pb2', globals()) -if _descriptor._USE_C_DESCRIPTORS == False: +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n2scanoss/api/components/v2/scanoss-components.proto\x12\x19scanoss.api.components.v2\x1a*scanoss/api/common/v2/scanoss-common.proto\x1a\x1cgoogle/api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\"v\n\x11\x43ompSearchRequest\x12\x0e\n\x06search\x18\x01 \x01(\t\x12\x0e\n\x06vendor\x18\x02 \x01(\t\x12\x11\n\tcomponent\x18\x03 \x01(\t\x12\x0f\n\x07package\x18\x04 \x01(\t\x12\r\n\x05limit\x18\x06 \x01(\x05\x12\x0e\n\x06offset\x18\x07 \x01(\x05\"\xca\x01\n\rCompStatistic\x12\x1a\n\x12total_source_files\x18\x01 \x01(\x05\x12\x13\n\x0btotal_lines\x18\x02 \x01(\x05\x12\x19\n\x11total_blank_lines\x18\x03 \x01(\x05\x12\x44\n\tlanguages\x18\x04 \x03(\x0b\x32\x31.scanoss.api.components.v2.CompStatistic.Language\x1a\'\n\x08Language\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05\x66iles\x18\x02 \x01(\x05\"\xfb\x01\n\x15\x43ompStatisticResponse\x12\x45\n\x05purls\x18\x01 \x03(\x0b\x32\x36.scanoss.api.components.v2.CompStatisticResponse.Purls\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a\x64\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12<\n\nstatistics\x18\x03 \x01(\x0b\x32(.scanoss.api.components.v2.CompStatistic\"\xd3\x01\n\x12\x43ompSearchResponse\x12K\n\ncomponents\x18\x01 \x03(\x0b\x32\x37.scanoss.api.components.v2.CompSearchResponse.Component\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a\x39\n\tComponent\x12\x11\n\tcomponent\x18\x01 \x01(\t\x12\x0c\n\x04purl\x18\x02 \x01(\t\x12\x0b\n\x03url\x18\x03 \x01(\t\"1\n\x12\x43ompVersionRequest\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x05\"\xe4\x03\n\x13\x43ompVersionResponse\x12K\n\tcomponent\x18\x01 \x01(\x0b\x32\x38.scanoss.api.components.v2.CompVersionResponse.Component\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1aO\n\x07License\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07spdx_id\x18\x02 \x01(\t\x12\x18\n\x10is_spdx_approved\x18\x03 \x01(\x08\x12\x0b\n\x03url\x18\x04 \x01(\t\x1ar\n\x07Version\x12\x0f\n\x07version\x18\x01 \x01(\t\x12H\n\x08licenses\x18\x04 \x03(\x0b\x32\x36.scanoss.api.components.v2.CompVersionResponse.License\x12\x0c\n\x04\x64\x61te\x18\x05 \x01(\t\x1a\x83\x01\n\tComponent\x12\x11\n\tcomponent\x18\x01 \x01(\t\x12\x0c\n\x04purl\x18\x02 \x01(\t\x12\x0b\n\x03url\x18\x03 \x01(\t\x12H\n\x08versions\x18\x04 \x03(\x0b\x32\x36.scanoss.api.components.v2.CompVersionResponse.Version2\xcb\x04\n\nComponents\x12p\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/api/v2/components/echo\x12\x92\x01\n\x10SearchComponents\x12,.scanoss.api.components.v2.CompSearchRequest\x1a-.scanoss.api.components.v2.CompSearchResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/api/v2/components/search\x12\x9a\x01\n\x14GetComponentVersions\x12-.scanoss.api.components.v2.CompVersionRequest\x1a..scanoss.api.components.v2.CompVersionResponse\"#\x82\xd3\xe4\x93\x02\x1d\x12\x1b/api/v2/components/versions\x12\x98\x01\n\x16GetComponentStatistics\x12\".scanoss.api.common.v2.PurlRequest\x1a\x30.scanoss.api.components.v2.CompStatisticResponse\"(\x82\xd3\xe4\x93\x02\"\"\x1d/api/v2/components/statistics:\x01*B\x9a\x03Z5github.com/scanoss/papi/api/componentsv2;componentsv2\x92\x41\xdf\x02\x12\x9d\x01\n\x1aSCANOSS Components Service\x12(Provides component intelligence services\"P\n\x12scanoss-components\x12%https://github.com/scanoss/components\x1a\x13support@scanoss.com2\x03\x32.0\x1a\x0f\x61pi.scanoss.com*\x02\x02\x01\x32\x10\x61pplication/json:\x10\x61pplication/jsonR;\n\x03\x34\x30\x34\x12\x34\n*Returned when the resource does not exist.\x12\x06\n\x04\x9a\x02\x01\x07Z8\n6\n\x07\x61pi_key\x12+\x08\x02\x12\x1a\x41PI key for authentication\x1a\tx-api-key \x02\x62\r\n\x0b\n\x07\x61pi_key\x12\x00\x62\x06proto3') - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z5github.com/scanoss/papi/api/componentsv2;componentsv2\222A\331\001\022s\n\032SCANOSS Components Service\"P\n\022scanoss-components\022%https://github.com/scanoss/components\032\023support@scanoss.com2\0032.0*\001\0012\020application/json:\020application/jsonR;\n\003404\0224\n*Returned when the resource does not exist.\022\006\n\004\232\002\001\007' - _COMPONENTS.methods_by_name['Echo']._options = None - _COMPONENTS.methods_by_name['Echo']._serialized_options = b'\202\323\344\223\002\034\"\027/api/v2/components/echo:\001*' - _COMPONENTS.methods_by_name['SearchComponents']._options = None - _COMPONENTS.methods_by_name['SearchComponents']._serialized_options = b'\202\323\344\223\002\036\"\031/api/v2/components/search:\001*' - _COMPONENTS.methods_by_name['GetComponentVersions']._options = None - _COMPONENTS.methods_by_name['GetComponentVersions']._serialized_options = b'\202\323\344\223\002 \"\033/api/v2/components/versions:\001*' - _COMPONENTS.methods_by_name['GetComponentStatistics']._options = None - _COMPONENTS.methods_by_name['GetComponentStatistics']._serialized_options = b'\202\323\344\223\002\"\"\035/api/v2/components/statistics:\001*' - _COMPSEARCHREQUEST._serialized_start=201 - _COMPSEARCHREQUEST._serialized_end=319 - _COMPSTATISTIC._serialized_start=322 - _COMPSTATISTIC._serialized_end=524 - _COMPSTATISTIC_LANGUAGE._serialized_start=485 - _COMPSTATISTIC_LANGUAGE._serialized_end=524 - _COMPSTATISTICRESPONSE._serialized_start=527 - _COMPSTATISTICRESPONSE._serialized_end=778 - _COMPSTATISTICRESPONSE_PURLS._serialized_start=678 - _COMPSTATISTICRESPONSE_PURLS._serialized_end=778 - _COMPSEARCHRESPONSE._serialized_start=781 - _COMPSEARCHRESPONSE._serialized_end=992 - _COMPSEARCHRESPONSE_COMPONENT._serialized_start=935 - _COMPSEARCHRESPONSE_COMPONENT._serialized_end=992 - _COMPVERSIONREQUEST._serialized_start=994 - _COMPVERSIONREQUEST._serialized_end=1043 - _COMPVERSIONRESPONSE._serialized_start=1046 - _COMPVERSIONRESPONSE._serialized_end=1516 - _COMPVERSIONRESPONSE_LICENSE._serialized_start=1201 - _COMPVERSIONRESPONSE_LICENSE._serialized_end=1280 - _COMPVERSIONRESPONSE_VERSION._serialized_start=1282 - _COMPVERSIONRESPONSE_VERSION._serialized_end=1382 - _COMPVERSIONRESPONSE_COMPONENT._serialized_start=1385 - _COMPVERSIONRESPONSE_COMPONENT._serialized_end=1516 - _COMPONENTS._serialized_start=1519 - _COMPONENTS._serialized_end=2115 +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scanoss.api.components.v2.scanoss_components_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'Z5github.com/scanoss/papi/api/componentsv2;componentsv2\222A\337\002\022\235\001\n\032SCANOSS Components Service\022(Provides component intelligence services\"P\n\022scanoss-components\022%https://github.com/scanoss/components\032\023support@scanoss.com2\0032.0\032\017api.scanoss.com*\002\002\0012\020application/json:\020application/jsonR;\n\003404\0224\n*Returned when the resource does not exist.\022\006\n\004\232\002\001\007Z8\n6\n\007api_key\022+\010\002\022\032API key for authentication\032\tx-api-key \002b\r\n\013\n\007api_key\022\000' + _globals['_COMPONENTS'].methods_by_name['Echo']._loaded_options = None + _globals['_COMPONENTS'].methods_by_name['Echo']._serialized_options = b'\202\323\344\223\002\031\022\027/api/v2/components/echo' + _globals['_COMPONENTS'].methods_by_name['SearchComponents']._loaded_options = None + _globals['_COMPONENTS'].methods_by_name['SearchComponents']._serialized_options = b'\202\323\344\223\002\033\022\031/api/v2/components/search' + _globals['_COMPONENTS'].methods_by_name['GetComponentVersions']._loaded_options = None + _globals['_COMPONENTS'].methods_by_name['GetComponentVersions']._serialized_options = b'\202\323\344\223\002\035\022\033/api/v2/components/versions' + _globals['_COMPONENTS'].methods_by_name['GetComponentStatistics']._loaded_options = None + _globals['_COMPONENTS'].methods_by_name['GetComponentStatistics']._serialized_options = b'\202\323\344\223\002\"\"\035/api/v2/components/statistics:\001*' + _globals['_COMPSEARCHREQUEST']._serialized_start=203 + _globals['_COMPSEARCHREQUEST']._serialized_end=321 + _globals['_COMPSTATISTIC']._serialized_start=324 + _globals['_COMPSTATISTIC']._serialized_end=526 + _globals['_COMPSTATISTIC_LANGUAGE']._serialized_start=487 + _globals['_COMPSTATISTIC_LANGUAGE']._serialized_end=526 + _globals['_COMPSTATISTICRESPONSE']._serialized_start=529 + _globals['_COMPSTATISTICRESPONSE']._serialized_end=780 + _globals['_COMPSTATISTICRESPONSE_PURLS']._serialized_start=680 + _globals['_COMPSTATISTICRESPONSE_PURLS']._serialized_end=780 + _globals['_COMPSEARCHRESPONSE']._serialized_start=783 + _globals['_COMPSEARCHRESPONSE']._serialized_end=994 + _globals['_COMPSEARCHRESPONSE_COMPONENT']._serialized_start=937 + _globals['_COMPSEARCHRESPONSE_COMPONENT']._serialized_end=994 + _globals['_COMPVERSIONREQUEST']._serialized_start=996 + _globals['_COMPVERSIONREQUEST']._serialized_end=1045 + _globals['_COMPVERSIONRESPONSE']._serialized_start=1048 + _globals['_COMPVERSIONRESPONSE']._serialized_end=1532 + _globals['_COMPVERSIONRESPONSE_LICENSE']._serialized_start=1203 + _globals['_COMPVERSIONRESPONSE_LICENSE']._serialized_end=1282 + _globals['_COMPVERSIONRESPONSE_VERSION']._serialized_start=1284 + _globals['_COMPVERSIONRESPONSE_VERSION']._serialized_end=1398 + _globals['_COMPVERSIONRESPONSE_COMPONENT']._serialized_start=1401 + _globals['_COMPVERSIONRESPONSE_COMPONENT']._serialized_end=1532 + _globals['_COMPONENTS']._serialized_start=1535 + _globals['_COMPONENTS']._serialized_end=2122 # @@protoc_insertion_point(module_scope) diff --git a/src/scanoss/api/components/v2/scanoss_components_pb2_grpc.py b/src/scanoss/api/components/v2/scanoss_components_pb2_grpc.py index 8ac7b92c..b80082b1 100644 --- a/src/scanoss/api/components/v2/scanoss_components_pb2_grpc.py +++ b/src/scanoss/api/components/v2/scanoss_components_pb2_grpc.py @@ -1,10 +1,30 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 from scanoss.api.components.v2 import scanoss_components_pb2 as scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2 +GRPC_GENERATED_VERSION = '1.73.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in scanoss/api/components/v2/scanoss_components_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + class ComponentsStub(object): """ @@ -21,22 +41,22 @@ def __init__(self, channel): '/scanoss.api.components.v2.Components/Echo', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, - ) + _registered_method=True) self.SearchComponents = channel.unary_unary( '/scanoss.api.components.v2.Components/SearchComponents', request_serializer=scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2.CompSearchRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2.CompSearchResponse.FromString, - ) + _registered_method=True) self.GetComponentVersions = channel.unary_unary( '/scanoss.api.components.v2.Components/GetComponentVersions', request_serializer=scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2.CompVersionRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2.CompVersionResponse.FromString, - ) + _registered_method=True) self.GetComponentStatistics = channel.unary_unary( '/scanoss.api.components.v2.Components/GetComponentStatistics', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2.CompStatisticResponse.FromString, - ) + _registered_method=True) class ComponentsServicer(object): @@ -99,6 +119,7 @@ def add_ComponentsServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'scanoss.api.components.v2.Components', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('scanoss.api.components.v2.Components', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -118,11 +139,21 @@ def Echo(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.components.v2.Components/Echo', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.components.v2.Components/Echo', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def SearchComponents(request, @@ -135,11 +166,21 @@ def SearchComponents(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.components.v2.Components/SearchComponents', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.components.v2.Components/SearchComponents', scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2.CompSearchRequest.SerializeToString, scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2.CompSearchResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetComponentVersions(request, @@ -152,11 +193,21 @@ def GetComponentVersions(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.components.v2.Components/GetComponentVersions', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.components.v2.Components/GetComponentVersions', scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2.CompVersionRequest.SerializeToString, scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2.CompVersionResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetComponentStatistics(request, @@ -169,8 +220,18 @@ def GetComponentStatistics(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.components.v2.Components/GetComponentStatistics', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.components.v2.Components/GetComponentStatistics', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2.CompStatisticResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2.py b/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2.py index f5af2f39..6d488e19 100644 --- a/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2.py +++ b/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2.py @@ -1,11 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: scanoss/api/cryptography/v2/scanoss-cryptography.proto +# Protobuf Python Version: 6.31.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 0, + '', + 'scanoss/api/cryptography/v2/scanoss-cryptography.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -13,53 +24,53 @@ from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from protoc_gen_swagger.options import annotations_pb2 as protoc__gen__swagger_dot_options_dot_annotations__pb2 - +from protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n6scanoss/api/cryptography/v2/scanoss-cryptography.proto\x12\x1bscanoss.api.cryptography.v2\x1a*scanoss/api/common/v2/scanoss-common.proto\x1a\x1cgoogle/api/annotations.proto\x1a,protoc-gen-swagger/options/annotations.proto\"0\n\tAlgorithm\x12\x11\n\talgorithm\x18\x01 \x01(\t\x12\x10\n\x08strength\x18\x02 \x01(\t\"\xf3\x01\n\x11\x41lgorithmResponse\x12\x43\n\x05purls\x18\x01 \x03(\x0b\x32\x34.scanoss.api.cryptography.v2.AlgorithmResponse.Purls\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a\x62\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12:\n\nalgorithms\x18\x03 \x03(\x0b\x32&.scanoss.api.cryptography.v2.Algorithm\"\x82\x02\n\x19\x41lgorithmsInRangeResponse\x12J\n\x05purls\x18\x01 \x03(\x0b\x32;.scanoss.api.cryptography.v2.AlgorithmsInRangeResponse.Purl\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a\x62\n\x04Purl\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x10\n\x08versions\x18\x02 \x03(\t\x12:\n\nalgorithms\x18\x03 \x03(\x0b\x32&.scanoss.api.cryptography.v2.Algorithm\"\xe1\x01\n\x17VersionsInRangeResponse\x12H\n\x05purls\x18\x01 \x03(\x0b\x32\x39.scanoss.api.cryptography.v2.VersionsInRangeResponse.Purl\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a\x45\n\x04Purl\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x15\n\rversions_with\x18\x02 \x03(\t\x12\x18\n\x10versions_without\x18\x03 \x03(\t\"}\n\x04Hint\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x10\n\x08\x63\x61tegory\x18\x04 \x01(\t\x12\x10\n\x03url\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04purl\x18\x06 \x01(\tH\x01\x88\x01\x01\x42\x06\n\x04_urlB\x07\n\x05_purl\"\xe1\x01\n\rHintsResponse\x12?\n\x05purls\x18\x01 \x03(\x0b\x32\x30.scanoss.api.cryptography.v2.HintsResponse.Purls\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1aX\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x30\n\x05hints\x18\x03 \x03(\x0b\x32!.scanoss.api.cryptography.v2.Hint\"\xee\x01\n\x14HintsInRangeResponse\x12\x45\n\x05purls\x18\x01 \x03(\x0b\x32\x36.scanoss.api.cryptography.v2.HintsInRangeResponse.Purl\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1aX\n\x04Purl\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x10\n\x08versions\x18\x02 \x03(\t\x12\x30\n\x05hints\x18\x03 \x03(\x0b\x32!.scanoss.api.cryptography.v2.Hint2\x88\x07\n\x0c\x43ryptography\x12u\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"$\x82\xd3\xe4\x93\x02\x1e\"\x19/api/v2/cryptography/echo:\x01*\x12\x8f\x01\n\rGetAlgorithms\x12\".scanoss.api.common.v2.PurlRequest\x1a..scanoss.api.cryptography.v2.AlgorithmResponse\"*\x82\xd3\xe4\x93\x02$\"\x1f/api/v2/cryptography/algorithms:\x01*\x12\xa5\x01\n\x14GetAlgorithmsInRange\x12\".scanoss.api.common.v2.PurlRequest\x1a\x36.scanoss.api.cryptography.v2.AlgorithmsInRangeResponse\"1\x82\xd3\xe4\x93\x02+\"&/api/v2/cryptography/algorithmsInRange:\x01*\x12\x9f\x01\n\x12GetVersionsInRange\x12\".scanoss.api.common.v2.PurlRequest\x1a\x34.scanoss.api.cryptography.v2.VersionsInRangeResponse\"/\x82\xd3\xe4\x93\x02)\"$/api/v2/cryptography/versionsInRange:\x01*\x12\x96\x01\n\x0fGetHintsInRange\x12\".scanoss.api.common.v2.PurlRequest\x1a\x31.scanoss.api.cryptography.v2.HintsInRangeResponse\",\x82\xd3\xe4\x93\x02&\"!/api/v2/cryptography/hintsInRange:\x01*\x12\x8b\x01\n\x12GetEncryptionHints\x12\".scanoss.api.common.v2.PurlRequest\x1a*.scanoss.api.cryptography.v2.HintsResponse\"%\x82\xd3\xe4\x93\x02\x1f\"\x1a/api/v2/cryptography/hints:\x01*B\x9e\x02Z9github.com/scanoss/papi/api/cryptographyv2;cryptographyv2\x92\x41\xdf\x01\x12y\n\x1cSCANOSS Cryptography Service\"T\n\x14scanoss-cryptography\x12\'https://github.com/scanoss/crpytography\x1a\x13support@scanoss.com2\x03\x32.0*\x01\x01\x32\x10\x61pplication/json:\x10\x61pplication/jsonR;\n\x03\x34\x30\x34\x12\x34\n*Returned when the resource does not exist.\x12\x06\n\x04\x9a\x02\x01\x07\x62\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scanoss.api.cryptography.v2.scanoss_cryptography_pb2', globals()) -if _descriptor._USE_C_DESCRIPTORS == False: +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n6scanoss/api/cryptography/v2/scanoss-cryptography.proto\x12\x1bscanoss.api.cryptography.v2\x1a*scanoss/api/common/v2/scanoss-common.proto\x1a\x1cgoogle/api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\"0\n\tAlgorithm\x12\x11\n\talgorithm\x18\x01 \x01(\t\x12\x10\n\x08strength\x18\x02 \x01(\t\"\xf3\x01\n\x11\x41lgorithmResponse\x12\x43\n\x05purls\x18\x01 \x03(\x0b\x32\x34.scanoss.api.cryptography.v2.AlgorithmResponse.Purls\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a\x62\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12:\n\nalgorithms\x18\x03 \x03(\x0b\x32&.scanoss.api.cryptography.v2.Algorithm\"\x82\x02\n\x19\x41lgorithmsInRangeResponse\x12J\n\x05purls\x18\x01 \x03(\x0b\x32;.scanoss.api.cryptography.v2.AlgorithmsInRangeResponse.Purl\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a\x62\n\x04Purl\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x10\n\x08versions\x18\x02 \x03(\t\x12:\n\nalgorithms\x18\x03 \x03(\x0b\x32&.scanoss.api.cryptography.v2.Algorithm\"\xe1\x01\n\x17VersionsInRangeResponse\x12H\n\x05purls\x18\x01 \x03(\x0b\x32\x39.scanoss.api.cryptography.v2.VersionsInRangeResponse.Purl\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a\x45\n\x04Purl\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x15\n\rversions_with\x18\x02 \x03(\t\x12\x18\n\x10versions_without\x18\x03 \x03(\t\"b\n\x04Hint\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x10\n\x08\x63\x61tegory\x18\x04 \x01(\t\x12\x0b\n\x03url\x18\x05 \x01(\t\x12\x0c\n\x04purl\x18\x06 \x01(\t\"\xe1\x01\n\rHintsResponse\x12?\n\x05purls\x18\x01 \x03(\x0b\x32\x30.scanoss.api.cryptography.v2.HintsResponse.Purls\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1aX\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x30\n\x05hints\x18\x03 \x03(\x0b\x32!.scanoss.api.cryptography.v2.Hint\"\xee\x01\n\x14HintsInRangeResponse\x12\x45\n\x05purls\x18\x01 \x03(\x0b\x32\x36.scanoss.api.cryptography.v2.HintsInRangeResponse.Purl\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1aX\n\x04Purl\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x10\n\x08versions\x18\x02 \x03(\t\x12\x30\n\x05hints\x18\x03 \x03(\x0b\x32!.scanoss.api.cryptography.v2.Hint2\x88\x07\n\x0c\x43ryptography\x12u\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"$\x82\xd3\xe4\x93\x02\x1e\"\x19/api/v2/cryptography/echo:\x01*\x12\x8f\x01\n\rGetAlgorithms\x12\".scanoss.api.common.v2.PurlRequest\x1a..scanoss.api.cryptography.v2.AlgorithmResponse\"*\x82\xd3\xe4\x93\x02$\"\x1f/api/v2/cryptography/algorithms:\x01*\x12\xa5\x01\n\x14GetAlgorithmsInRange\x12\".scanoss.api.common.v2.PurlRequest\x1a\x36.scanoss.api.cryptography.v2.AlgorithmsInRangeResponse\"1\x82\xd3\xe4\x93\x02+\"&/api/v2/cryptography/algorithmsInRange:\x01*\x12\x9f\x01\n\x12GetVersionsInRange\x12\".scanoss.api.common.v2.PurlRequest\x1a\x34.scanoss.api.cryptography.v2.VersionsInRangeResponse\"/\x82\xd3\xe4\x93\x02)\"$/api/v2/cryptography/versionsInRange:\x01*\x12\x96\x01\n\x0fGetHintsInRange\x12\".scanoss.api.common.v2.PurlRequest\x1a\x31.scanoss.api.cryptography.v2.HintsInRangeResponse\",\x82\xd3\xe4\x93\x02&\"!/api/v2/cryptography/hintsInRange:\x01*\x12\x8b\x01\n\x12GetEncryptionHints\x12\".scanoss.api.common.v2.PurlRequest\x1a*.scanoss.api.cryptography.v2.HintsResponse\"%\x82\xd3\xe4\x93\x02\x1f\"\x1a/api/v2/cryptography/hints:\x01*B\x9e\x02Z9github.com/scanoss/papi/api/cryptographyv2;cryptographyv2\x92\x41\xdf\x01\x12y\n\x1cSCANOSS Cryptography Service\"T\n\x14scanoss-cryptography\x12\'https://github.com/scanoss/crpytography\x1a\x13support@scanoss.com2\x03\x32.0*\x01\x01\x32\x10\x61pplication/json:\x10\x61pplication/jsonR;\n\x03\x34\x30\x34\x12\x34\n*Returned when the resource does not exist.\x12\x06\n\x04\x9a\x02\x01\x07\x62\x06proto3') - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z9github.com/scanoss/papi/api/cryptographyv2;cryptographyv2\222A\337\001\022y\n\034SCANOSS Cryptography Service\"T\n\024scanoss-cryptography\022\'https://github.com/scanoss/crpytography\032\023support@scanoss.com2\0032.0*\001\0012\020application/json:\020application/jsonR;\n\003404\0224\n*Returned when the resource does not exist.\022\006\n\004\232\002\001\007' - _CRYPTOGRAPHY.methods_by_name['Echo']._options = None - _CRYPTOGRAPHY.methods_by_name['Echo']._serialized_options = b'\202\323\344\223\002\036\"\031/api/v2/cryptography/echo:\001*' - _CRYPTOGRAPHY.methods_by_name['GetAlgorithms']._options = None - _CRYPTOGRAPHY.methods_by_name['GetAlgorithms']._serialized_options = b'\202\323\344\223\002$\"\037/api/v2/cryptography/algorithms:\001*' - _CRYPTOGRAPHY.methods_by_name['GetAlgorithmsInRange']._options = None - _CRYPTOGRAPHY.methods_by_name['GetAlgorithmsInRange']._serialized_options = b'\202\323\344\223\002+\"&/api/v2/cryptography/algorithmsInRange:\001*' - _CRYPTOGRAPHY.methods_by_name['GetVersionsInRange']._options = None - _CRYPTOGRAPHY.methods_by_name['GetVersionsInRange']._serialized_options = b'\202\323\344\223\002)\"$/api/v2/cryptography/versionsInRange:\001*' - _CRYPTOGRAPHY.methods_by_name['GetHintsInRange']._options = None - _CRYPTOGRAPHY.methods_by_name['GetHintsInRange']._serialized_options = b'\202\323\344\223\002&\"!/api/v2/cryptography/hintsInRange:\001*' - _CRYPTOGRAPHY.methods_by_name['GetEncryptionHints']._options = None - _CRYPTOGRAPHY.methods_by_name['GetEncryptionHints']._serialized_options = b'\202\323\344\223\002\037\"\032/api/v2/cryptography/hints:\001*' - _ALGORITHM._serialized_start=207 - _ALGORITHM._serialized_end=255 - _ALGORITHMRESPONSE._serialized_start=258 - _ALGORITHMRESPONSE._serialized_end=501 - _ALGORITHMRESPONSE_PURLS._serialized_start=403 - _ALGORITHMRESPONSE_PURLS._serialized_end=501 - _ALGORITHMSINRANGERESPONSE._serialized_start=504 - _ALGORITHMSINRANGERESPONSE._serialized_end=762 - _ALGORITHMSINRANGERESPONSE_PURL._serialized_start=664 - _ALGORITHMSINRANGERESPONSE_PURL._serialized_end=762 - _VERSIONSINRANGERESPONSE._serialized_start=765 - _VERSIONSINRANGERESPONSE._serialized_end=990 - _VERSIONSINRANGERESPONSE_PURL._serialized_start=921 - _VERSIONSINRANGERESPONSE_PURL._serialized_end=990 - _HINT._serialized_start=992 - _HINT._serialized_end=1117 - _HINTSRESPONSE._serialized_start=1120 - _HINTSRESPONSE._serialized_end=1345 - _HINTSRESPONSE_PURLS._serialized_start=1257 - _HINTSRESPONSE_PURLS._serialized_end=1345 - _HINTSINRANGERESPONSE._serialized_start=1348 - _HINTSINRANGERESPONSE._serialized_end=1586 - _HINTSINRANGERESPONSE_PURL._serialized_start=1498 - _HINTSINRANGERESPONSE_PURL._serialized_end=1586 - _CRYPTOGRAPHY._serialized_start=1589 - _CRYPTOGRAPHY._serialized_end=2493 +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scanoss.api.cryptography.v2.scanoss_cryptography_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'Z9github.com/scanoss/papi/api/cryptographyv2;cryptographyv2\222A\337\001\022y\n\034SCANOSS Cryptography Service\"T\n\024scanoss-cryptography\022\'https://github.com/scanoss/crpytography\032\023support@scanoss.com2\0032.0*\001\0012\020application/json:\020application/jsonR;\n\003404\0224\n*Returned when the resource does not exist.\022\006\n\004\232\002\001\007' + _globals['_CRYPTOGRAPHY'].methods_by_name['Echo']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['Echo']._serialized_options = b'\202\323\344\223\002\036\"\031/api/v2/cryptography/echo:\001*' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetAlgorithms']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetAlgorithms']._serialized_options = b'\202\323\344\223\002$\"\037/api/v2/cryptography/algorithms:\001*' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetAlgorithmsInRange']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetAlgorithmsInRange']._serialized_options = b'\202\323\344\223\002+\"&/api/v2/cryptography/algorithmsInRange:\001*' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetVersionsInRange']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetVersionsInRange']._serialized_options = b'\202\323\344\223\002)\"$/api/v2/cryptography/versionsInRange:\001*' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetHintsInRange']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetHintsInRange']._serialized_options = b'\202\323\344\223\002&\"!/api/v2/cryptography/hintsInRange:\001*' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetEncryptionHints']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetEncryptionHints']._serialized_options = b'\202\323\344\223\002\037\"\032/api/v2/cryptography/hints:\001*' + _globals['_ALGORITHM']._serialized_start=209 + _globals['_ALGORITHM']._serialized_end=257 + _globals['_ALGORITHMRESPONSE']._serialized_start=260 + _globals['_ALGORITHMRESPONSE']._serialized_end=503 + _globals['_ALGORITHMRESPONSE_PURLS']._serialized_start=405 + _globals['_ALGORITHMRESPONSE_PURLS']._serialized_end=503 + _globals['_ALGORITHMSINRANGERESPONSE']._serialized_start=506 + _globals['_ALGORITHMSINRANGERESPONSE']._serialized_end=764 + _globals['_ALGORITHMSINRANGERESPONSE_PURL']._serialized_start=666 + _globals['_ALGORITHMSINRANGERESPONSE_PURL']._serialized_end=764 + _globals['_VERSIONSINRANGERESPONSE']._serialized_start=767 + _globals['_VERSIONSINRANGERESPONSE']._serialized_end=992 + _globals['_VERSIONSINRANGERESPONSE_PURL']._serialized_start=923 + _globals['_VERSIONSINRANGERESPONSE_PURL']._serialized_end=992 + _globals['_HINT']._serialized_start=994 + _globals['_HINT']._serialized_end=1092 + _globals['_HINTSRESPONSE']._serialized_start=1095 + _globals['_HINTSRESPONSE']._serialized_end=1320 + _globals['_HINTSRESPONSE_PURLS']._serialized_start=1232 + _globals['_HINTSRESPONSE_PURLS']._serialized_end=1320 + _globals['_HINTSINRANGERESPONSE']._serialized_start=1323 + _globals['_HINTSINRANGERESPONSE']._serialized_end=1561 + _globals['_HINTSINRANGERESPONSE_PURL']._serialized_start=1473 + _globals['_HINTSINRANGERESPONSE_PURL']._serialized_end=1561 + _globals['_CRYPTOGRAPHY']._serialized_start=1564 + _globals['_CRYPTOGRAPHY']._serialized_end=2468 # @@protoc_insertion_point(module_scope) diff --git a/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2_grpc.py b/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2_grpc.py index 25b77e2c..e015e875 100644 --- a/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2_grpc.py +++ b/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2_grpc.py @@ -1,10 +1,30 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 from scanoss.api.cryptography.v2 import scanoss_cryptography_pb2 as scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2 +GRPC_GENERATED_VERSION = '1.73.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in scanoss/api/cryptography/v2/scanoss_cryptography_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + class CryptographyStub(object): """ @@ -21,32 +41,32 @@ def __init__(self, channel): '/scanoss.api.cryptography.v2.Cryptography/Echo', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, - ) + _registered_method=True) self.GetAlgorithms = channel.unary_unary( '/scanoss.api.cryptography.v2.Cryptography/GetAlgorithms', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.AlgorithmResponse.FromString, - ) + _registered_method=True) self.GetAlgorithmsInRange = channel.unary_unary( '/scanoss.api.cryptography.v2.Cryptography/GetAlgorithmsInRange', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.AlgorithmsInRangeResponse.FromString, - ) + _registered_method=True) self.GetVersionsInRange = channel.unary_unary( '/scanoss.api.cryptography.v2.Cryptography/GetVersionsInRange', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.VersionsInRangeResponse.FromString, - ) + _registered_method=True) self.GetHintsInRange = channel.unary_unary( '/scanoss.api.cryptography.v2.Cryptography/GetHintsInRange', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.HintsInRangeResponse.FromString, - ) + _registered_method=True) self.GetEncryptionHints = channel.unary_unary( '/scanoss.api.cryptography.v2.Cryptography/GetEncryptionHints', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.HintsResponse.FromString, - ) + _registered_method=True) class CryptographyServicer(object): @@ -133,6 +153,7 @@ def add_CryptographyServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'scanoss.api.cryptography.v2.Cryptography', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('scanoss.api.cryptography.v2.Cryptography', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -152,11 +173,21 @@ def Echo(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.cryptography.v2.Cryptography/Echo', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.cryptography.v2.Cryptography/Echo', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetAlgorithms(request, @@ -169,11 +200,21 @@ def GetAlgorithms(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.cryptography.v2.Cryptography/GetAlgorithms', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.cryptography.v2.Cryptography/GetAlgorithms', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.AlgorithmResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetAlgorithmsInRange(request, @@ -186,11 +227,21 @@ def GetAlgorithmsInRange(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.cryptography.v2.Cryptography/GetAlgorithmsInRange', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.cryptography.v2.Cryptography/GetAlgorithmsInRange', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.AlgorithmsInRangeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetVersionsInRange(request, @@ -203,11 +254,21 @@ def GetVersionsInRange(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.cryptography.v2.Cryptography/GetVersionsInRange', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.cryptography.v2.Cryptography/GetVersionsInRange', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.VersionsInRangeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetHintsInRange(request, @@ -220,11 +281,21 @@ def GetHintsInRange(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.cryptography.v2.Cryptography/GetHintsInRange', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.cryptography.v2.Cryptography/GetHintsInRange', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.HintsInRangeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetEncryptionHints(request, @@ -237,8 +308,18 @@ def GetEncryptionHints(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.cryptography.v2.Cryptography/GetEncryptionHints', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.cryptography.v2.Cryptography/GetEncryptionHints', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.HintsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/src/scanoss/api/dependencies/v2/scanoss_dependencies_pb2.py b/src/scanoss/api/dependencies/v2/scanoss_dependencies_pb2.py index a0779b29..59399d84 100644 --- a/src/scanoss/api/dependencies/v2/scanoss_dependencies_pb2.py +++ b/src/scanoss/api/dependencies/v2/scanoss_dependencies_pb2.py @@ -1,11 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: scanoss/api/dependencies/v2/scanoss-dependencies.proto +# Protobuf Python Version: 6.31.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 0, + '', + 'scanoss/api/dependencies/v2/scanoss-dependencies.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -13,43 +24,43 @@ from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from protoc_gen_swagger.options import annotations_pb2 as protoc__gen__swagger_dot_options_dot_annotations__pb2 - +from protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n6scanoss/api/dependencies/v2/scanoss-dependencies.proto\x12\x1bscanoss.api.dependencies.v2\x1a*scanoss/api/common/v2/scanoss-common.proto\x1a\x1cgoogle/api/annotations.proto\x1a,protoc-gen-swagger/options/annotations.proto\"\xef\x01\n\x11\x44\x65pendencyRequest\x12\x43\n\x05\x66iles\x18\x01 \x03(\x0b\x32\x34.scanoss.api.dependencies.v2.DependencyRequest.Files\x12\r\n\x05\x64\x65pth\x18\x02 \x01(\x05\x1a*\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x13\n\x0brequirement\x18\x02 \x01(\t\x1aZ\n\x05\x46iles\x12\x0c\n\x04\x66ile\x18\x01 \x01(\t\x12\x43\n\x05purls\x18\x02 \x03(\x0b\x32\x34.scanoss.api.dependencies.v2.DependencyRequest.Purls\"\x98\x04\n\x12\x44\x65pendencyResponse\x12\x44\n\x05\x66iles\x18\x01 \x03(\x0b\x32\x35.scanoss.api.dependencies.v2.DependencyResponse.Files\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1aP\n\x08Licenses\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07spdx_id\x18\x02 \x01(\t\x12\x18\n\x10is_spdx_approved\x18\x03 \x01(\x08\x12\x0b\n\x03url\x18\x04 \x01(\t\x1a\xaa\x01\n\x0c\x44\x65pendencies\x12\x11\n\tcomponent\x18\x01 \x01(\t\x12\x0c\n\x04purl\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12J\n\x08licenses\x18\x04 \x03(\x0b\x32\x38.scanoss.api.dependencies.v2.DependencyResponse.Licenses\x12\x0b\n\x03url\x18\x05 \x01(\t\x12\x0f\n\x07\x63omment\x18\x06 \x01(\t\x1a\x85\x01\n\x05\x46iles\x12\x0c\n\x04\x66ile\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12R\n\x0c\x64\x65pendencies\x18\x04 \x03(\x0b\x32<.scanoss.api.dependencies.v2.DependencyResponse.Dependencies\"z\n\x1bTransitiveDependencyRequest\x12\x11\n\tecosystem\x18\x01 \x01(\t\x12\r\n\x05\x64\x65pth\x18\x02 \x01(\x05\x12\r\n\x05limit\x18\x03 \x01(\x05\x12*\n\x05purls\x18\x05 \x03(\x0b\x32\x1b.scanoss.api.common.v2.Purl\"\xe2\x01\n\x1cTransitiveDependencyResponse\x12\\\n\x0c\x64\x65pendencies\x18\x01 \x03(\x0b\x32\x46.scanoss.api.dependencies.v2.TransitiveDependencyResponse.Dependencies\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a-\n\x0c\x44\x65pendencies\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t2\xe7\x03\n\x0c\x44\x65pendencies\x12u\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"$\x82\xd3\xe4\x93\x02\x1e\"\x19/api/v2/dependencies/echo:\x01*\x12\xa0\x01\n\x0fGetDependencies\x12..scanoss.api.dependencies.v2.DependencyRequest\x1a/.scanoss.api.dependencies.v2.DependencyResponse\",\x82\xd3\xe4\x93\x02&\"!/api/v2/dependencies/dependencies:\x01*\x12\xbc\x01\n\x19GetTransitiveDependencies\x12\x38.scanoss.api.dependencies.v2.TransitiveDependencyRequest\x1a\x39.scanoss.api.dependencies.v2.TransitiveDependencyResponse\"*\x82\xd3\xe4\x93\x02$\"\x1f/api/v2/dependencies/transitive:\x01*B\x9c\x02Z9github.com/scanoss/papi/api/dependenciesv2;dependenciesv2\x92\x41\xdd\x01\x12w\n\x1aSCANOSS Dependency Service\"T\n\x14scanoss-dependencies\x12\'https://github.com/scanoss/dependencies\x1a\x13support@scanoss.com2\x03\x32.0*\x01\x01\x32\x10\x61pplication/json:\x10\x61pplication/jsonR;\n\x03\x34\x30\x34\x12\x34\n*Returned when the resource does not exist.\x12\x06\n\x04\x9a\x02\x01\x07\x62\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scanoss.api.dependencies.v2.scanoss_dependencies_pb2', globals()) -if _descriptor._USE_C_DESCRIPTORS == False: +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n6scanoss/api/dependencies/v2/scanoss-dependencies.proto\x12\x1bscanoss.api.dependencies.v2\x1a*scanoss/api/common/v2/scanoss-common.proto\x1a\x1cgoogle/api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\"\xef\x01\n\x11\x44\x65pendencyRequest\x12\x43\n\x05\x66iles\x18\x01 \x03(\x0b\x32\x34.scanoss.api.dependencies.v2.DependencyRequest.Files\x12\r\n\x05\x64\x65pth\x18\x02 \x01(\x05\x1a*\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x13\n\x0brequirement\x18\x02 \x01(\t\x1aZ\n\x05\x46iles\x12\x0c\n\x04\x66ile\x18\x01 \x01(\t\x12\x43\n\x05purls\x18\x02 \x03(\x0b\x32\x34.scanoss.api.dependencies.v2.DependencyRequest.Purls\"\x98\x04\n\x12\x44\x65pendencyResponse\x12\x44\n\x05\x66iles\x18\x01 \x03(\x0b\x32\x35.scanoss.api.dependencies.v2.DependencyResponse.Files\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1aP\n\x08Licenses\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07spdx_id\x18\x02 \x01(\t\x12\x18\n\x10is_spdx_approved\x18\x03 \x01(\x08\x12\x0b\n\x03url\x18\x04 \x01(\t\x1a\xaa\x01\n\x0c\x44\x65pendencies\x12\x11\n\tcomponent\x18\x01 \x01(\t\x12\x0c\n\x04purl\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12J\n\x08licenses\x18\x04 \x03(\x0b\x32\x38.scanoss.api.dependencies.v2.DependencyResponse.Licenses\x12\x0b\n\x03url\x18\x05 \x01(\t\x12\x0f\n\x07\x63omment\x18\x06 \x01(\t\x1a\x85\x01\n\x05\x46iles\x12\x0c\n\x04\x66ile\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12R\n\x0c\x64\x65pendencies\x18\x04 \x03(\x0b\x32<.scanoss.api.dependencies.v2.DependencyResponse.Dependencies\"z\n\x1bTransitiveDependencyRequest\x12\x11\n\tecosystem\x18\x01 \x01(\t\x12\r\n\x05\x64\x65pth\x18\x02 \x01(\x05\x12\r\n\x05limit\x18\x03 \x01(\x05\x12*\n\x05purls\x18\x05 \x03(\x0b\x32\x1b.scanoss.api.common.v2.Purl\"\xe2\x01\n\x1cTransitiveDependencyResponse\x12\\\n\x0c\x64\x65pendencies\x18\x01 \x03(\x0b\x32\x46.scanoss.api.dependencies.v2.TransitiveDependencyResponse.Dependencies\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a-\n\x0c\x44\x65pendencies\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t2\xe7\x03\n\x0c\x44\x65pendencies\x12u\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"$\x82\xd3\xe4\x93\x02\x1e\"\x19/api/v2/dependencies/echo:\x01*\x12\xa0\x01\n\x0fGetDependencies\x12..scanoss.api.dependencies.v2.DependencyRequest\x1a/.scanoss.api.dependencies.v2.DependencyResponse\",\x82\xd3\xe4\x93\x02&\"!/api/v2/dependencies/dependencies:\x01*\x12\xbc\x01\n\x19GetTransitiveDependencies\x12\x38.scanoss.api.dependencies.v2.TransitiveDependencyRequest\x1a\x39.scanoss.api.dependencies.v2.TransitiveDependencyResponse\"*\x82\xd3\xe4\x93\x02$\"\x1f/api/v2/dependencies/transitive:\x01*B\x9c\x02Z9github.com/scanoss/papi/api/dependenciesv2;dependenciesv2\x92\x41\xdd\x01\x12w\n\x1aSCANOSS Dependency Service\"T\n\x14scanoss-dependencies\x12\'https://github.com/scanoss/dependencies\x1a\x13support@scanoss.com2\x03\x32.0*\x01\x01\x32\x10\x61pplication/json:\x10\x61pplication/jsonR;\n\x03\x34\x30\x34\x12\x34\n*Returned when the resource does not exist.\x12\x06\n\x04\x9a\x02\x01\x07\x62\x06proto3') - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z9github.com/scanoss/papi/api/dependenciesv2;dependenciesv2\222A\335\001\022w\n\032SCANOSS Dependency Service\"T\n\024scanoss-dependencies\022\'https://github.com/scanoss/dependencies\032\023support@scanoss.com2\0032.0*\001\0012\020application/json:\020application/jsonR;\n\003404\0224\n*Returned when the resource does not exist.\022\006\n\004\232\002\001\007' - _DEPENDENCIES.methods_by_name['Echo']._options = None - _DEPENDENCIES.methods_by_name['Echo']._serialized_options = b'\202\323\344\223\002\036\"\031/api/v2/dependencies/echo:\001*' - _DEPENDENCIES.methods_by_name['GetDependencies']._options = None - _DEPENDENCIES.methods_by_name['GetDependencies']._serialized_options = b'\202\323\344\223\002&\"!/api/v2/dependencies/dependencies:\001*' - _DEPENDENCIES.methods_by_name['GetTransitiveDependencies']._options = None - _DEPENDENCIES.methods_by_name['GetTransitiveDependencies']._serialized_options = b'\202\323\344\223\002$\"\037/api/v2/dependencies/transitive:\001*' - _DEPENDENCYREQUEST._serialized_start=208 - _DEPENDENCYREQUEST._serialized_end=447 - _DEPENDENCYREQUEST_PURLS._serialized_start=313 - _DEPENDENCYREQUEST_PURLS._serialized_end=355 - _DEPENDENCYREQUEST_FILES._serialized_start=357 - _DEPENDENCYREQUEST_FILES._serialized_end=447 - _DEPENDENCYRESPONSE._serialized_start=450 - _DEPENDENCYRESPONSE._serialized_end=986 - _DEPENDENCYRESPONSE_LICENSES._serialized_start=597 - _DEPENDENCYRESPONSE_LICENSES._serialized_end=677 - _DEPENDENCYRESPONSE_DEPENDENCIES._serialized_start=680 - _DEPENDENCYRESPONSE_DEPENDENCIES._serialized_end=850 - _DEPENDENCYRESPONSE_FILES._serialized_start=853 - _DEPENDENCYRESPONSE_FILES._serialized_end=986 - _TRANSITIVEDEPENDENCYREQUEST._serialized_start=988 - _TRANSITIVEDEPENDENCYREQUEST._serialized_end=1110 - _TRANSITIVEDEPENDENCYRESPONSE._serialized_start=1113 - _TRANSITIVEDEPENDENCYRESPONSE._serialized_end=1339 - _TRANSITIVEDEPENDENCYRESPONSE_DEPENDENCIES._serialized_start=1294 - _TRANSITIVEDEPENDENCYRESPONSE_DEPENDENCIES._serialized_end=1339 - _DEPENDENCIES._serialized_start=1342 - _DEPENDENCIES._serialized_end=1829 +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scanoss.api.dependencies.v2.scanoss_dependencies_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'Z9github.com/scanoss/papi/api/dependenciesv2;dependenciesv2\222A\335\001\022w\n\032SCANOSS Dependency Service\"T\n\024scanoss-dependencies\022\'https://github.com/scanoss/dependencies\032\023support@scanoss.com2\0032.0*\001\0012\020application/json:\020application/jsonR;\n\003404\0224\n*Returned when the resource does not exist.\022\006\n\004\232\002\001\007' + _globals['_DEPENDENCIES'].methods_by_name['Echo']._loaded_options = None + _globals['_DEPENDENCIES'].methods_by_name['Echo']._serialized_options = b'\202\323\344\223\002\036\"\031/api/v2/dependencies/echo:\001*' + _globals['_DEPENDENCIES'].methods_by_name['GetDependencies']._loaded_options = None + _globals['_DEPENDENCIES'].methods_by_name['GetDependencies']._serialized_options = b'\202\323\344\223\002&\"!/api/v2/dependencies/dependencies:\001*' + _globals['_DEPENDENCIES'].methods_by_name['GetTransitiveDependencies']._loaded_options = None + _globals['_DEPENDENCIES'].methods_by_name['GetTransitiveDependencies']._serialized_options = b'\202\323\344\223\002$\"\037/api/v2/dependencies/transitive:\001*' + _globals['_DEPENDENCYREQUEST']._serialized_start=210 + _globals['_DEPENDENCYREQUEST']._serialized_end=449 + _globals['_DEPENDENCYREQUEST_PURLS']._serialized_start=315 + _globals['_DEPENDENCYREQUEST_PURLS']._serialized_end=357 + _globals['_DEPENDENCYREQUEST_FILES']._serialized_start=359 + _globals['_DEPENDENCYREQUEST_FILES']._serialized_end=449 + _globals['_DEPENDENCYRESPONSE']._serialized_start=452 + _globals['_DEPENDENCYRESPONSE']._serialized_end=988 + _globals['_DEPENDENCYRESPONSE_LICENSES']._serialized_start=599 + _globals['_DEPENDENCYRESPONSE_LICENSES']._serialized_end=679 + _globals['_DEPENDENCYRESPONSE_DEPENDENCIES']._serialized_start=682 + _globals['_DEPENDENCYRESPONSE_DEPENDENCIES']._serialized_end=852 + _globals['_DEPENDENCYRESPONSE_FILES']._serialized_start=855 + _globals['_DEPENDENCYRESPONSE_FILES']._serialized_end=988 + _globals['_TRANSITIVEDEPENDENCYREQUEST']._serialized_start=990 + _globals['_TRANSITIVEDEPENDENCYREQUEST']._serialized_end=1112 + _globals['_TRANSITIVEDEPENDENCYRESPONSE']._serialized_start=1115 + _globals['_TRANSITIVEDEPENDENCYRESPONSE']._serialized_end=1341 + _globals['_TRANSITIVEDEPENDENCYRESPONSE_DEPENDENCIES']._serialized_start=1296 + _globals['_TRANSITIVEDEPENDENCYRESPONSE_DEPENDENCIES']._serialized_end=1341 + _globals['_DEPENDENCIES']._serialized_start=1344 + _globals['_DEPENDENCIES']._serialized_end=1831 # @@protoc_insertion_point(module_scope) diff --git a/src/scanoss/api/dependencies/v2/scanoss_dependencies_pb2_grpc.py b/src/scanoss/api/dependencies/v2/scanoss_dependencies_pb2_grpc.py index ae675b67..aa4e5b7a 100644 --- a/src/scanoss/api/dependencies/v2/scanoss_dependencies_pb2_grpc.py +++ b/src/scanoss/api/dependencies/v2/scanoss_dependencies_pb2_grpc.py @@ -1,10 +1,30 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 from scanoss.api.dependencies.v2 import scanoss_dependencies_pb2 as scanoss_dot_api_dot_dependencies_dot_v2_dot_scanoss__dependencies__pb2 +GRPC_GENERATED_VERSION = '1.73.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in scanoss/api/dependencies/v2/scanoss_dependencies_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + class DependenciesStub(object): """ @@ -21,17 +41,17 @@ def __init__(self, channel): '/scanoss.api.dependencies.v2.Dependencies/Echo', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, - ) + _registered_method=True) self.GetDependencies = channel.unary_unary( '/scanoss.api.dependencies.v2.Dependencies/GetDependencies', request_serializer=scanoss_dot_api_dot_dependencies_dot_v2_dot_scanoss__dependencies__pb2.DependencyRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_dependencies_dot_v2_dot_scanoss__dependencies__pb2.DependencyResponse.FromString, - ) + _registered_method=True) self.GetTransitiveDependencies = channel.unary_unary( '/scanoss.api.dependencies.v2.Dependencies/GetTransitiveDependencies', request_serializer=scanoss_dot_api_dot_dependencies_dot_v2_dot_scanoss__dependencies__pb2.TransitiveDependencyRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_dependencies_dot_v2_dot_scanoss__dependencies__pb2.TransitiveDependencyResponse.FromString, - ) + _registered_method=True) class DependenciesServicer(object): @@ -82,6 +102,7 @@ def add_DependenciesServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'scanoss.api.dependencies.v2.Dependencies', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('scanoss.api.dependencies.v2.Dependencies', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -101,11 +122,21 @@ def Echo(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.dependencies.v2.Dependencies/Echo', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.dependencies.v2.Dependencies/Echo', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetDependencies(request, @@ -118,11 +149,21 @@ def GetDependencies(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.dependencies.v2.Dependencies/GetDependencies', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.dependencies.v2.Dependencies/GetDependencies', scanoss_dot_api_dot_dependencies_dot_v2_dot_scanoss__dependencies__pb2.DependencyRequest.SerializeToString, scanoss_dot_api_dot_dependencies_dot_v2_dot_scanoss__dependencies__pb2.DependencyResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetTransitiveDependencies(request, @@ -135,8 +176,18 @@ def GetTransitiveDependencies(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.dependencies.v2.Dependencies/GetTransitiveDependencies', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.dependencies.v2.Dependencies/GetTransitiveDependencies', scanoss_dot_api_dot_dependencies_dot_v2_dot_scanoss__dependencies__pb2.TransitiveDependencyRequest.SerializeToString, scanoss_dot_api_dot_dependencies_dot_v2_dot_scanoss__dependencies__pb2.TransitiveDependencyResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2.py b/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2.py index df9e5754..e79f7ec6 100644 --- a/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2.py +++ b/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2.py @@ -1,11 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: scanoss/api/geoprovenance/v2/scanoss-geoprovenance.proto +# Protobuf Python Version: 6.31.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 0, + '', + 'scanoss/api/geoprovenance/v2/scanoss-geoprovenance.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -13,37 +24,37 @@ from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from protoc_gen_swagger.options import annotations_pb2 as protoc__gen__swagger_dot_options_dot_annotations__pb2 - +from protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n8scanoss/api/geoprovenance/v2/scanoss-geoprovenance.proto\x12\x1cscanoss.api.geoprovenance.v2\x1a*scanoss/api/common/v2/scanoss-common.proto\x1a\x1cgoogle/api/annotations.proto\x1a,protoc-gen-swagger/options/annotations.proto\"\xd1\x03\n\x13\x43ontributorResponse\x12\x46\n\x05purls\x18\x01 \x03(\x0b\x32\x37.scanoss.api.geoprovenance.v2.ContributorResponse.Purls\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a\x32\n\x10\x44\x65\x63laredLocation\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x10\n\x08location\x18\x02 \x01(\t\x1a\x31\n\x0f\x43uratedLocation\x12\x0f\n\x07\x63ountry\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\x1a\xd3\x01\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12^\n\x12\x64\x65\x63lared_locations\x18\x02 \x03(\x0b\x32\x42.scanoss.api.geoprovenance.v2.ContributorResponse.DeclaredLocation\x12\\\n\x11\x63urated_locations\x18\x03 \x03(\x0b\x32\x41.scanoss.api.geoprovenance.v2.ContributorResponse.CuratedLocation\"\x99\x02\n\x0eOriginResponse\x12\x41\n\x05purls\x18\x01 \x03(\x0b\x32\x32.scanoss.api.geoprovenance.v2.OriginResponse.Purls\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a,\n\x08Location\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\npercentage\x18\x02 \x01(\x02\x1a_\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12H\n\tlocations\x18\x02 \x03(\x0b\x32\x35.scanoss.api.geoprovenance.v2.OriginResponse.Location2\xb9\x03\n\rGeoProvenance\x12v\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"%\x82\xd3\xe4\x93\x02\x1f\"\x1a/api/v2/geoprovenance/echo:\x01*\x12\x9d\x01\n\x18GetComponentContributors\x12\".scanoss.api.common.v2.PurlRequest\x1a\x31.scanoss.api.geoprovenance.v2.ContributorResponse\"*\x82\xd3\xe4\x93\x02$\"\x1f/api/v2/geoprovenance/countries:\x01*\x12\x8f\x01\n\x12GetComponentOrigin\x12\".scanoss.api.common.v2.PurlRequest\x1a,.scanoss.api.geoprovenance.v2.OriginResponse\"\'\x82\xd3\xe4\x93\x02!\"\x1c/api/v2/geoprovenance/origin:\x01*B\xa4\x02Z;github.com/scanoss/papi/api/geoprovenancev2;geoprovenancev2\x92\x41\xe3\x01\x12}\n\x1eSCANOSS GEO Provenance Service\"V\n\x15scanoss-geoprovenance\x12(https://github.com/scanoss/geoprovenance\x1a\x13support@scanoss.com2\x03\x32.0*\x01\x01\x32\x10\x61pplication/json:\x10\x61pplication/jsonR;\n\x03\x34\x30\x34\x12\x34\n*Returned when the resource does not exist.\x12\x06\n\x04\x9a\x02\x01\x07\x62\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scanoss.api.geoprovenance.v2.scanoss_geoprovenance_pb2', globals()) -if _descriptor._USE_C_DESCRIPTORS == False: +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n8scanoss/api/geoprovenance/v2/scanoss-geoprovenance.proto\x12\x1cscanoss.api.geoprovenance.v2\x1a*scanoss/api/common/v2/scanoss-common.proto\x1a\x1cgoogle/api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\"\xd1\x03\n\x13\x43ontributorResponse\x12\x46\n\x05purls\x18\x01 \x03(\x0b\x32\x37.scanoss.api.geoprovenance.v2.ContributorResponse.Purls\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a\x32\n\x10\x44\x65\x63laredLocation\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x10\n\x08location\x18\x02 \x01(\t\x1a\x31\n\x0f\x43uratedLocation\x12\x0f\n\x07\x63ountry\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\x1a\xd3\x01\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12^\n\x12\x64\x65\x63lared_locations\x18\x02 \x03(\x0b\x32\x42.scanoss.api.geoprovenance.v2.ContributorResponse.DeclaredLocation\x12\\\n\x11\x63urated_locations\x18\x03 \x03(\x0b\x32\x41.scanoss.api.geoprovenance.v2.ContributorResponse.CuratedLocation\"\x99\x02\n\x0eOriginResponse\x12\x41\n\x05purls\x18\x01 \x03(\x0b\x32\x32.scanoss.api.geoprovenance.v2.OriginResponse.Purls\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a,\n\x08Location\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\npercentage\x18\x02 \x01(\x02\x1a_\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12H\n\tlocations\x18\x02 \x03(\x0b\x32\x35.scanoss.api.geoprovenance.v2.OriginResponse.Location2\xb9\x03\n\rGeoProvenance\x12v\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"%\x82\xd3\xe4\x93\x02\x1f\"\x1a/api/v2/geoprovenance/echo:\x01*\x12\x9d\x01\n\x18GetComponentContributors\x12\".scanoss.api.common.v2.PurlRequest\x1a\x31.scanoss.api.geoprovenance.v2.ContributorResponse\"*\x82\xd3\xe4\x93\x02$\"\x1f/api/v2/geoprovenance/countries:\x01*\x12\x8f\x01\n\x12GetComponentOrigin\x12\".scanoss.api.common.v2.PurlRequest\x1a,.scanoss.api.geoprovenance.v2.OriginResponse\"\'\x82\xd3\xe4\x93\x02!\"\x1c/api/v2/geoprovenance/origin:\x01*B\xa4\x02Z;github.com/scanoss/papi/api/geoprovenancev2;geoprovenancev2\x92\x41\xe3\x01\x12}\n\x1eSCANOSS GEO Provenance Service\"V\n\x15scanoss-geoprovenance\x12(https://github.com/scanoss/geoprovenance\x1a\x13support@scanoss.com2\x03\x32.0*\x01\x01\x32\x10\x61pplication/json:\x10\x61pplication/jsonR;\n\x03\x34\x30\x34\x12\x34\n*Returned when the resource does not exist.\x12\x06\n\x04\x9a\x02\x01\x07\x62\x06proto3') - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z;github.com/scanoss/papi/api/geoprovenancev2;geoprovenancev2\222A\343\001\022}\n\036SCANOSS GEO Provenance Service\"V\n\025scanoss-geoprovenance\022(https://github.com/scanoss/geoprovenance\032\023support@scanoss.com2\0032.0*\001\0012\020application/json:\020application/jsonR;\n\003404\0224\n*Returned when the resource does not exist.\022\006\n\004\232\002\001\007' - _GEOPROVENANCE.methods_by_name['Echo']._options = None - _GEOPROVENANCE.methods_by_name['Echo']._serialized_options = b'\202\323\344\223\002\037\"\032/api/v2/geoprovenance/echo:\001*' - _GEOPROVENANCE.methods_by_name['GetComponentContributors']._options = None - _GEOPROVENANCE.methods_by_name['GetComponentContributors']._serialized_options = b'\202\323\344\223\002$\"\037/api/v2/geoprovenance/countries:\001*' - _GEOPROVENANCE.methods_by_name['GetComponentOrigin']._options = None - _GEOPROVENANCE.methods_by_name['GetComponentOrigin']._serialized_options = b'\202\323\344\223\002!\"\034/api/v2/geoprovenance/origin:\001*' - _CONTRIBUTORRESPONSE._serialized_start=211 - _CONTRIBUTORRESPONSE._serialized_end=676 - _CONTRIBUTORRESPONSE_DECLAREDLOCATION._serialized_start=361 - _CONTRIBUTORRESPONSE_DECLAREDLOCATION._serialized_end=411 - _CONTRIBUTORRESPONSE_CURATEDLOCATION._serialized_start=413 - _CONTRIBUTORRESPONSE_CURATEDLOCATION._serialized_end=462 - _CONTRIBUTORRESPONSE_PURLS._serialized_start=465 - _CONTRIBUTORRESPONSE_PURLS._serialized_end=676 - _ORIGINRESPONSE._serialized_start=679 - _ORIGINRESPONSE._serialized_end=960 - _ORIGINRESPONSE_LOCATION._serialized_start=819 - _ORIGINRESPONSE_LOCATION._serialized_end=863 - _ORIGINRESPONSE_PURLS._serialized_start=865 - _ORIGINRESPONSE_PURLS._serialized_end=960 - _GEOPROVENANCE._serialized_start=963 - _GEOPROVENANCE._serialized_end=1404 +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scanoss.api.geoprovenance.v2.scanoss_geoprovenance_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'Z;github.com/scanoss/papi/api/geoprovenancev2;geoprovenancev2\222A\343\001\022}\n\036SCANOSS GEO Provenance Service\"V\n\025scanoss-geoprovenance\022(https://github.com/scanoss/geoprovenance\032\023support@scanoss.com2\0032.0*\001\0012\020application/json:\020application/jsonR;\n\003404\0224\n*Returned when the resource does not exist.\022\006\n\004\232\002\001\007' + _globals['_GEOPROVENANCE'].methods_by_name['Echo']._loaded_options = None + _globals['_GEOPROVENANCE'].methods_by_name['Echo']._serialized_options = b'\202\323\344\223\002\037\"\032/api/v2/geoprovenance/echo:\001*' + _globals['_GEOPROVENANCE'].methods_by_name['GetComponentContributors']._loaded_options = None + _globals['_GEOPROVENANCE'].methods_by_name['GetComponentContributors']._serialized_options = b'\202\323\344\223\002$\"\037/api/v2/geoprovenance/countries:\001*' + _globals['_GEOPROVENANCE'].methods_by_name['GetComponentOrigin']._loaded_options = None + _globals['_GEOPROVENANCE'].methods_by_name['GetComponentOrigin']._serialized_options = b'\202\323\344\223\002!\"\034/api/v2/geoprovenance/origin:\001*' + _globals['_CONTRIBUTORRESPONSE']._serialized_start=213 + _globals['_CONTRIBUTORRESPONSE']._serialized_end=678 + _globals['_CONTRIBUTORRESPONSE_DECLAREDLOCATION']._serialized_start=363 + _globals['_CONTRIBUTORRESPONSE_DECLAREDLOCATION']._serialized_end=413 + _globals['_CONTRIBUTORRESPONSE_CURATEDLOCATION']._serialized_start=415 + _globals['_CONTRIBUTORRESPONSE_CURATEDLOCATION']._serialized_end=464 + _globals['_CONTRIBUTORRESPONSE_PURLS']._serialized_start=467 + _globals['_CONTRIBUTORRESPONSE_PURLS']._serialized_end=678 + _globals['_ORIGINRESPONSE']._serialized_start=681 + _globals['_ORIGINRESPONSE']._serialized_end=962 + _globals['_ORIGINRESPONSE_LOCATION']._serialized_start=821 + _globals['_ORIGINRESPONSE_LOCATION']._serialized_end=865 + _globals['_ORIGINRESPONSE_PURLS']._serialized_start=867 + _globals['_ORIGINRESPONSE_PURLS']._serialized_end=962 + _globals['_GEOPROVENANCE']._serialized_start=965 + _globals['_GEOPROVENANCE']._serialized_end=1406 # @@protoc_insertion_point(module_scope) diff --git a/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2_grpc.py b/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2_grpc.py index ff63832a..d669a5e4 100644 --- a/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2_grpc.py +++ b/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2_grpc.py @@ -1,10 +1,30 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 from scanoss.api.geoprovenance.v2 import scanoss_geoprovenance_pb2 as scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2 +GRPC_GENERATED_VERSION = '1.73.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + class GeoProvenanceStub(object): """* @@ -21,17 +41,17 @@ def __init__(self, channel): '/scanoss.api.geoprovenance.v2.GeoProvenance/Echo', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, - ) + _registered_method=True) self.GetComponentContributors = channel.unary_unary( '/scanoss.api.geoprovenance.v2.GeoProvenance/GetComponentContributors', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ContributorResponse.FromString, - ) + _registered_method=True) self.GetComponentOrigin = channel.unary_unary( '/scanoss.api.geoprovenance.v2.GeoProvenance/GetComponentOrigin', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.OriginResponse.FromString, - ) + _registered_method=True) class GeoProvenanceServicer(object): @@ -82,6 +102,7 @@ def add_GeoProvenanceServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'scanoss.api.geoprovenance.v2.GeoProvenance', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('scanoss.api.geoprovenance.v2.GeoProvenance', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -101,11 +122,21 @@ def Echo(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.geoprovenance.v2.GeoProvenance/Echo', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.geoprovenance.v2.GeoProvenance/Echo', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetComponentContributors(request, @@ -118,11 +149,21 @@ def GetComponentContributors(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.geoprovenance.v2.GeoProvenance/GetComponentContributors', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.geoprovenance.v2.GeoProvenance/GetComponentContributors', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ContributorResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetComponentOrigin(request, @@ -135,8 +176,18 @@ def GetComponentOrigin(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.geoprovenance.v2.GeoProvenance/GetComponentOrigin', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.geoprovenance.v2.GeoProvenance/GetComponentOrigin', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.OriginResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/src/scanoss/api/licenses/__init__.py b/src/scanoss/api/licenses/__init__.py new file mode 100644 index 00000000..1e95c46d --- /dev/null +++ b/src/scanoss/api/licenses/__init__.py @@ -0,0 +1,23 @@ +""" +SPDX-License-Identifier: MIT + + Copyright (c) 2025, SCANOSS + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +""" diff --git a/src/scanoss/api/licenses/v2/__init__.py b/src/scanoss/api/licenses/v2/__init__.py new file mode 100644 index 00000000..1e95c46d --- /dev/null +++ b/src/scanoss/api/licenses/v2/__init__.py @@ -0,0 +1,23 @@ +""" +SPDX-License-Identifier: MIT + + Copyright (c) 2025, SCANOSS + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +""" diff --git a/src/scanoss/api/licenses/v2/scanoss_licenses_pb2.py b/src/scanoss/api/licenses/v2/scanoss_licenses_pb2.py new file mode 100644 index 00000000..144f8d7d --- /dev/null +++ b/src/scanoss/api/licenses/v2/scanoss_licenses_pb2.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: scanoss/api/licenses/v2/scanoss-licenses.proto +# Protobuf Python Version: 6.31.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 0, + '', + 'scanoss/api/licenses/v2/scanoss-licenses.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.scanoss/api/licenses/v2/scanoss-licenses.proto\x12\x17scanoss.api.licenses.v2\x1a*scanoss/api/common/v2/scanoss-common.proto\x1a\x1cgoogle/api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\"\xbd\x03\n\x18\x43omponentLicenseResponse\x12@\n\tcomponent\x18\x01 \x01(\x0b\x32-.scanoss.api.licenses.v2.ComponentLicenseInfo\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse:\xa7\x02\x92\x41\xa3\x02\n\xa0\x02J\x9d\x02{\"component\":{\"purl\": \"pkg:github/scanoss/engine@1.0.0\", \"requirement\": \"\", \"version\": \"1.0.0\", \"statement\": \"GPL-2.0\", \"licenses\": [{\"id\": \"GPL-2.0\", \"full_name\": \"GNU General Public License v2.0 only\"}]}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Licenses Successfully retrieved\"}}\"\xe9\x04\n\x19\x43omponentsLicenseResponse\x12\x41\n\ncomponents\x18\x01 \x03(\x0b\x32-.scanoss.api.licenses.v2.ComponentLicenseInfo\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse:\xd1\x03\x92\x41\xcd\x03\n\xca\x03J\xc7\x03{\"components\":[{\"purl\": \"pkg:github/scanoss/engine@1.0.0\", \"requirement\": \"\", \"version\": \"1.0.0\", \"statement\": \"GPL-2.0\", \"licenses\": [{\"id\": \"GPL-2.0\", \"full_name\": \"GNU General Public License v2.0 only\"}]}, {\"purl\": \"pkg:github/scanoss/scanoss.py@v1.30.0\",\"requirement\": \"\",\"version\": \"v1.30.0\",\"statement\": \"MIT\", \"licenses\": [{\"id\": \"MIT\",\"full_name\": \"MIT License\"}]} ], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Licenses Successfully retrieved\"}}\"\x89\x01\n\x16LicenseDetailsResponse\x12\x38\n\x07license\x18\x01 \x01(\x0b\x32\'.scanoss.api.licenses.v2.LicenseDetails\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\"\x81\x01\n\x13ObligationsResponse\x12\x33\n\x0bobligations\x18\x01 \x01(\x0b\x32\x1e.scanoss.api.licenses.v2.OSADL\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\"\xa3\x04\n\x04SPDX\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tfull_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65tails_url\x18\x04 \x01(\t\x12\x15\n\rreference_url\x18\x05 \x01(\t\x12\x15\n\ris_deprecated\x18\x06 \x01(\x08\x12\x14\n\x0cis_fsf_libre\x18\x07 \x01(\x08\x12\x17\n\x0fis_osi_approved\x18\x08 \x01(\x08\x12\x10\n\x08see_also\x18\t \x03(\t\x12>\n\ncross_refs\x18\n \x03(\x0b\x32*.scanoss.api.licenses.v2.SPDX.SPDXCrossRef\x12?\n\nexceptions\x18\x0b \x03(\x0b\x32+.scanoss.api.licenses.v2.SPDX.SPDXException\x1a\x88\x01\n\x0cSPDXCrossRef\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x10\n\x08is_valid\x18\x02 \x01(\x08\x12\x0f\n\x07is_live\x18\x03 \x01(\x08\x12\x11\n\ttimestamp\x18\x04 \x01(\t\x12\x17\n\x0fis_wayback_link\x18\x05 \x01(\x08\x12\r\n\x05order\x18\x06 \x01(\x05\x12\r\n\x05match\x18\x07 \x01(\t\x1al\n\rSPDXException\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tfull_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65tails_url\x18\x03 \x01(\t\x12\x10\n\x08see_also\x18\x05 \x03(\t\x12\x15\n\ris_deprecated\x18\x06 \x01(\x08\"\x97\x02\n\x05OSADL\x12\x17\n\x0f\x63opyleft_clause\x18\x01 \x01(\x08\x12\x14\n\x0cpatent_hints\x18\x02 \x01(\x08\x12\x15\n\rcompatibility\x18\x03 \x03(\t\x12\x1f\n\x17\x64\x65pending_compatibility\x18\x04 \x03(\t\x12\x17\n\x0fincompatibility\x18\x05 \x03(\t\x12>\n\tuse_cases\x18\x06 \x03(\x0b\x32+.scanoss.api.licenses.v2.OSADL.OSADLUseCase\x1aN\n\x0cOSADLUseCase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\x0fobligation_text\x18\x02 \x01(\t\x12\x17\n\x0fobligation_json\x18\x03 \x01(\t\"{\n\x0bLicenseInfo\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tfull_name\x18\x02 \x01(\t:M\x92\x41J\nHJF{\"id\": \"GPL-2.0\", \"full_name\": \"GNU General Public License v2.0 only\"}\"\xb3\x01\n\x0eLicenseDetails\x12\x11\n\tfull_name\x18\x01 \x01(\t\x12\x32\n\x04type\x18\x02 \x01(\x0e\x32$.scanoss.api.licenses.v2.LicenseType\x12+\n\x04spdx\x18\x03 \x01(\x0b\x32\x1d.scanoss.api.licenses.v2.SPDX\x12-\n\x05osadl\x18\x04 \x01(\x0b\x32\x1e.scanoss.api.licenses.v2.OSADL\"\x1c\n\x0eLicenseRequest\x12\n\n\x02id\x18\x01 \x01(\t\"\x95\x01\n\x14\x43omponentLicenseInfo\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x13\n\x0brequirement\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12\x11\n\tstatement\x18\x04 \x01(\t\x12\x36\n\x08licenses\x18\x05 \x03(\x0b\x32$.scanoss.api.licenses.v2.LicenseInfo*l\n\x0bLicenseType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0e\n\nPERMISSIVE\x10\x01\x12\x0c\n\x08\x43OPYLEFT\x10\x02\x12\x0e\n\nCOMMERCIAL\x10\x03\x12\x0f\n\x0bPROPRIETARY\x10\x04\x12\x11\n\rPUBLIC_DOMAIN\x10\x05\x32\xd0\x05\n\x07License\x12q\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\" \x82\xd3\xe4\x93\x02\x1a\"\x15/api/v2/licenses/echo:\x01*\x12\x96\x01\n\x14GetComponentLicenses\x12\'.scanoss.api.common.v2.ComponentRequest\x1a\x31.scanoss.api.licenses.v2.ComponentLicenseResponse\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/api/v2/licenses/component\x12\x9d\x01\n\x15GetComponentsLicenses\x12(.scanoss.api.common.v2.ComponentsRequest\x1a\x32.scanoss.api.licenses.v2.ComponentsLicenseResponse\"&\x82\xd3\xe4\x93\x02 \"\x1b/api/v2/licenses/components:\x01*\x12\x88\x01\n\nGetDetails\x12\'.scanoss.api.licenses.v2.LicenseRequest\x1a/.scanoss.api.licenses.v2.LicenseDetailsResponse\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/api/v2/licenses/details\x12\x8d\x01\n\x0eGetObligations\x12\'.scanoss.api.licenses.v2.LicenseRequest\x1a,.scanoss.api.licenses.v2.ObligationsResponse\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/api/v2/licenses/obligationsB\xa7\x02Z1github.com/scanoss/papi/api/licensesv2;licensesv2\x92\x41\xf0\x01\x12\xb4\x01\n\x17SCANOSS License Service\x12\x46License service provides license intelligence for software components.\"L\n\x10scanoss-licenses\x12#https://github.com/scanoss/licenses\x1a\x13support@scanoss.com2\x03\x32.0\x1a\x0f\x61pi.scanoss.com*\x02\x01\x02\x32\x10\x61pplication/json:\x10\x61pplication/jsonb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scanoss.api.licenses.v2.scanoss_licenses_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'Z1github.com/scanoss/papi/api/licensesv2;licensesv2\222A\360\001\022\264\001\n\027SCANOSS License Service\022FLicense service provides license intelligence for software components.\"L\n\020scanoss-licenses\022#https://github.com/scanoss/licenses\032\023support@scanoss.com2\0032.0\032\017api.scanoss.com*\002\001\0022\020application/json:\020application/json' + _globals['_COMPONENTLICENSERESPONSE']._loaded_options = None + _globals['_COMPONENTLICENSERESPONSE']._serialized_options = b'\222A\243\002\n\240\002J\235\002{\"component\":{\"purl\": \"pkg:github/scanoss/engine@1.0.0\", \"requirement\": \"\", \"version\": \"1.0.0\", \"statement\": \"GPL-2.0\", \"licenses\": [{\"id\": \"GPL-2.0\", \"full_name\": \"GNU General Public License v2.0 only\"}]}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Licenses Successfully retrieved\"}}' + _globals['_COMPONENTSLICENSERESPONSE']._loaded_options = None + _globals['_COMPONENTSLICENSERESPONSE']._serialized_options = b'\222A\315\003\n\312\003J\307\003{\"components\":[{\"purl\": \"pkg:github/scanoss/engine@1.0.0\", \"requirement\": \"\", \"version\": \"1.0.0\", \"statement\": \"GPL-2.0\", \"licenses\": [{\"id\": \"GPL-2.0\", \"full_name\": \"GNU General Public License v2.0 only\"}]}, {\"purl\": \"pkg:github/scanoss/scanoss.py@v1.30.0\",\"requirement\": \"\",\"version\": \"v1.30.0\",\"statement\": \"MIT\", \"licenses\": [{\"id\": \"MIT\",\"full_name\": \"MIT License\"}]} ], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Licenses Successfully retrieved\"}}' + _globals['_LICENSEINFO']._loaded_options = None + _globals['_LICENSEINFO']._serialized_options = b'\222AJ\nHJF{\"id\": \"GPL-2.0\", \"full_name\": \"GNU General Public License v2.0 only\"}' + _globals['_LICENSE'].methods_by_name['Echo']._loaded_options = None + _globals['_LICENSE'].methods_by_name['Echo']._serialized_options = b'\202\323\344\223\002\032\"\025/api/v2/licenses/echo:\001*' + _globals['_LICENSE'].methods_by_name['GetComponentLicenses']._loaded_options = None + _globals['_LICENSE'].methods_by_name['GetComponentLicenses']._serialized_options = b'\202\323\344\223\002\034\022\032/api/v2/licenses/component' + _globals['_LICENSE'].methods_by_name['GetComponentsLicenses']._loaded_options = None + _globals['_LICENSE'].methods_by_name['GetComponentsLicenses']._serialized_options = b'\202\323\344\223\002 \"\033/api/v2/licenses/components:\001*' + _globals['_LICENSE'].methods_by_name['GetDetails']._loaded_options = None + _globals['_LICENSE'].methods_by_name['GetDetails']._serialized_options = b'\202\323\344\223\002\032\022\030/api/v2/licenses/details' + _globals['_LICENSE'].methods_by_name['GetObligations']._loaded_options = None + _globals['_LICENSE'].methods_by_name['GetObligations']._serialized_options = b'\202\323\344\223\002\036\022\034/api/v2/licenses/obligations' + _globals['_LICENSETYPE']._serialized_start=2858 + _globals['_LICENSETYPE']._serialized_end=2966 + _globals['_COMPONENTLICENSERESPONSE']._serialized_start=198 + _globals['_COMPONENTLICENSERESPONSE']._serialized_end=643 + _globals['_COMPONENTSLICENSERESPONSE']._serialized_start=646 + _globals['_COMPONENTSLICENSERESPONSE']._serialized_end=1263 + _globals['_LICENSEDETAILSRESPONSE']._serialized_start=1266 + _globals['_LICENSEDETAILSRESPONSE']._serialized_end=1403 + _globals['_OBLIGATIONSRESPONSE']._serialized_start=1406 + _globals['_OBLIGATIONSRESPONSE']._serialized_end=1535 + _globals['_SPDX']._serialized_start=1538 + _globals['_SPDX']._serialized_end=2085 + _globals['_SPDX_SPDXCROSSREF']._serialized_start=1839 + _globals['_SPDX_SPDXCROSSREF']._serialized_end=1975 + _globals['_SPDX_SPDXEXCEPTION']._serialized_start=1977 + _globals['_SPDX_SPDXEXCEPTION']._serialized_end=2085 + _globals['_OSADL']._serialized_start=2088 + _globals['_OSADL']._serialized_end=2367 + _globals['_OSADL_OSADLUSECASE']._serialized_start=2289 + _globals['_OSADL_OSADLUSECASE']._serialized_end=2367 + _globals['_LICENSEINFO']._serialized_start=2369 + _globals['_LICENSEINFO']._serialized_end=2492 + _globals['_LICENSEDETAILS']._serialized_start=2495 + _globals['_LICENSEDETAILS']._serialized_end=2674 + _globals['_LICENSEREQUEST']._serialized_start=2676 + _globals['_LICENSEREQUEST']._serialized_end=2704 + _globals['_COMPONENTLICENSEINFO']._serialized_start=2707 + _globals['_COMPONENTLICENSEINFO']._serialized_end=2856 + _globals['_LICENSE']._serialized_start=2969 + _globals['_LICENSE']._serialized_end=3689 +# @@protoc_insertion_point(module_scope) diff --git a/src/scanoss/api/licenses/v2/scanoss_licenses_pb2_grpc.py b/src/scanoss/api/licenses/v2/scanoss_licenses_pb2_grpc.py new file mode 100644 index 00000000..ac0df474 --- /dev/null +++ b/src/scanoss/api/licenses/v2/scanoss_licenses_pb2_grpc.py @@ -0,0 +1,302 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 +from scanoss.api.licenses.v2 import scanoss_licenses_pb2 as scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2 + +GRPC_GENERATED_VERSION = '1.73.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in scanoss/api/licenses/v2/scanoss_licenses_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class LicenseStub(object): + """ + License Service Definition + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Echo = channel.unary_unary( + '/scanoss.api.licenses.v2.License/Echo', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, + _registered_method=True) + self.GetComponentLicenses = channel.unary_unary( + '/scanoss.api.licenses.v2.License/GetComponentLicenses', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.ComponentLicenseResponse.FromString, + _registered_method=True) + self.GetComponentsLicenses = channel.unary_unary( + '/scanoss.api.licenses.v2.License/GetComponentsLicenses', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.ComponentsLicenseResponse.FromString, + _registered_method=True) + self.GetDetails = channel.unary_unary( + '/scanoss.api.licenses.v2.License/GetDetails', + request_serializer=scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.LicenseRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.LicenseDetailsResponse.FromString, + _registered_method=True) + self.GetObligations = channel.unary_unary( + '/scanoss.api.licenses.v2.License/GetObligations', + request_serializer=scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.LicenseRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.ObligationsResponse.FromString, + _registered_method=True) + + +class LicenseServicer(object): + """ + License Service Definition + """ + + def Echo(self, request, context): + """ + Returns the same message that was sent, used for health checks and connectivity testing + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentLicenses(self, request, context): + """ + Get license information for a single software component. + + Examines source code, license files, and package metadata to determine which licenses apply to the component. + Returns license data in both individual SPDX license and SPDX expressions when determinable. + + See: https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/licenses/v2/README.md?tab=readme-ov-file#getcomponentlicenses + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentsLicenses(self, request, context): + """ + Get license information for multiple software components in a single request. + + Examines source code, license files, and package metadata to determine which licenses apply to each component. + Returns license data in both individual SPDX license and SPDX expressions when determinable. + + See https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/licenses/v2/README.md?tab=readme-ov-file#getcomponentslicenses + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetDetails(self, request, context): + """ + Get detailed metadata for a specific license by SPDX identifier. + + Provides comprehensive license information including SPDX registry data, + OSADL compliance metadata, license type classification, and official references. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetObligations(self, request, context): + """ + Get compliance obligations and usage requirements for a specific license. + + Returns structured OSADL compliance data including use cases, obligations, + compatibility information, and patent hints for the specified license. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_LicenseServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Echo': grpc.unary_unary_rpc_method_handler( + servicer.Echo, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.FromString, + response_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.SerializeToString, + ), + 'GetComponentLicenses': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentLicenses, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.FromString, + response_serializer=scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.ComponentLicenseResponse.SerializeToString, + ), + 'GetComponentsLicenses': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentsLicenses, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.FromString, + response_serializer=scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.ComponentsLicenseResponse.SerializeToString, + ), + 'GetDetails': grpc.unary_unary_rpc_method_handler( + servicer.GetDetails, + request_deserializer=scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.LicenseRequest.FromString, + response_serializer=scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.LicenseDetailsResponse.SerializeToString, + ), + 'GetObligations': grpc.unary_unary_rpc_method_handler( + servicer.GetObligations, + request_deserializer=scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.LicenseRequest.FromString, + response_serializer=scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.ObligationsResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'scanoss.api.licenses.v2.License', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('scanoss.api.licenses.v2.License', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class License(object): + """ + License Service Definition + """ + + @staticmethod + def Echo(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.licenses.v2.License/Echo', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetComponentLicenses(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.licenses.v2.License/GetComponentLicenses', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.ComponentLicenseResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetComponentsLicenses(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.licenses.v2.License/GetComponentsLicenses', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.ComponentsLicenseResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetDetails(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.licenses.v2.License/GetDetails', + scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.LicenseRequest.SerializeToString, + scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.LicenseDetailsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetObligations(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.licenses.v2.License/GetObligations', + scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.LicenseRequest.SerializeToString, + scanoss_dot_api_dot_licenses_dot_v2_dot_scanoss__licenses__pb2.ObligationsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/src/scanoss/api/scanning/v2/scanoss_scanning_pb2.py b/src/scanoss/api/scanning/v2/scanoss_scanning_pb2.py index 114a0bf8..90ae2840 100644 --- a/src/scanoss/api/scanning/v2/scanoss_scanning_pb2.py +++ b/src/scanoss/api/scanning/v2/scanoss_scanning_pb2.py @@ -1,11 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: scanoss/api/scanning/v2/scanoss-scanning.proto +# Protobuf Python Version: 6.31.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 0, + '', + 'scanoss/api/scanning/v2/scanoss-scanning.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -13,10 +24,10 @@ from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from protoc_gen_swagger.options import annotations_pb2 as protoc__gen__swagger_dot_options_dot_annotations__pb2 +from protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.scanoss/api/scanning/v2/scanoss-scanning.proto\x12\x17scanoss.api.scanning.v2\x1a*scanoss/api/common/v2/scanoss-common.proto\x1a\x1cgoogle/api/annotations.proto\x1a,protoc-gen-swagger/options/annotations.proto\"\xc5\x03\n\nHFHRequest\x12:\n\x04root\x18\x01 \x01(\x0b\x32,.scanoss.api.scanning.v2.HFHRequest.Children\x12\x16\n\x0erank_threshold\x18\x02 \x01(\x05\x12\x10\n\x08\x63\x61tegory\x18\x03 \x01(\t\x12\x13\n\x0bquery_limit\x18\x04 \x01(\x05\x1a\xbb\x02\n\x08\x43hildren\x12\x0f\n\x07path_id\x18\x01 \x01(\t\x12\x16\n\x0esim_hash_names\x18\x02 \x01(\t\x12\x18\n\x10sim_hash_content\x18\x03 \x01(\t\x12>\n\x08\x63hildren\x18\x04 \x03(\x0b\x32,.scanoss.api.scanning.v2.HFHRequest.Children\x12\x1a\n\x12sim_hash_dir_names\x18\x05 \x01(\t\x12Y\n\x0flang_extensions\x18\x06 \x03(\x0b\x32@.scanoss.api.scanning.v2.HFHRequest.Children.LangExtensionsEntry\x1a\x35\n\x13LangExtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"\xa3\x03\n\x0bHFHResponse\x12<\n\x07results\x18\x01 \x03(\x0b\x32+.scanoss.api.scanning.v2.HFHResponse.Result\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a)\n\x07Version\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x1a\x94\x01\n\tComponent\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06vendor\x18\x03 \x01(\t\x12>\n\x08versions\x18\x04 \x03(\x0b\x32,.scanoss.api.scanning.v2.HFHResponse.Version\x12\x0c\n\x04rank\x18\x05 \x01(\x05\x12\r\n\x05order\x18\x06 \x01(\x05\x1a]\n\x06Result\x12\x0f\n\x07path_id\x18\x01 \x01(\t\x12\x42\n\ncomponents\x18\x02 \x03(\x0b\x32..scanoss.api.scanning.v2.HFHResponse.Component2\x81\x02\n\x08Scanning\x12q\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\" \x82\xd3\xe4\x93\x02\x1a\"\x15/api/v2/scanning/echo:\x01*\x12\x81\x01\n\x0e\x46olderHashScan\x12#.scanoss.api.scanning.v2.HFHRequest\x1a$.scanoss.api.scanning.v2.HFHResponse\"$\x82\xd3\xe4\x93\x02\x1e\"\x19/api/v2/scanning/hfh/scan:\x01*B\x8a\x02Z1github.com/scanoss/papi/api/scanningv2;scanningv2\x92\x41\xd3\x01\x12m\n\x18SCANOSS Scanning Service\"L\n\x10scanoss-scanning\x12#https://github.com/scanoss/scanning\x1a\x13support@scanoss.com2\x03\x32.0*\x01\x01\x32\x10\x61pplication/json:\x10\x61pplication/jsonR;\n\x03\x34\x30\x34\x12\x34\n*Returned when the resource does not exist.\x12\x06\n\x04\x9a\x02\x01\x07\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.scanoss/api/scanning/v2/scanoss-scanning.proto\x12\x17scanoss.api.scanning.v2\x1a*scanoss/api/common/v2/scanoss-common.proto\x1a\x1cgoogle/api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\"\xc5\x03\n\nHFHRequest\x12:\n\x04root\x18\x01 \x01(\x0b\x32,.scanoss.api.scanning.v2.HFHRequest.Children\x12\x16\n\x0erank_threshold\x18\x02 \x01(\x05\x12\x10\n\x08\x63\x61tegory\x18\x03 \x01(\t\x12\x13\n\x0bquery_limit\x18\x04 \x01(\x05\x1a\xbb\x02\n\x08\x43hildren\x12\x0f\n\x07path_id\x18\x01 \x01(\t\x12\x16\n\x0esim_hash_names\x18\x02 \x01(\t\x12\x18\n\x10sim_hash_content\x18\x03 \x01(\t\x12>\n\x08\x63hildren\x18\x04 \x03(\x0b\x32,.scanoss.api.scanning.v2.HFHRequest.Children\x12\x1a\n\x12sim_hash_dir_names\x18\x05 \x01(\t\x12Y\n\x0flang_extensions\x18\x06 \x03(\x0b\x32@.scanoss.api.scanning.v2.HFHRequest.Children.LangExtensionsEntry\x1a\x35\n\x13LangExtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"\xa3\x03\n\x0bHFHResponse\x12<\n\x07results\x18\x01 \x03(\x0b\x32+.scanoss.api.scanning.v2.HFHResponse.Result\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a)\n\x07Version\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x1a\x94\x01\n\tComponent\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06vendor\x18\x03 \x01(\t\x12>\n\x08versions\x18\x04 \x03(\x0b\x32,.scanoss.api.scanning.v2.HFHResponse.Version\x12\x0c\n\x04rank\x18\x05 \x01(\x05\x12\r\n\x05order\x18\x06 \x01(\x05\x1a]\n\x06Result\x12\x0f\n\x07path_id\x18\x01 \x01(\t\x12\x42\n\ncomponents\x18\x02 \x03(\x0b\x32..scanoss.api.scanning.v2.HFHResponse.Component2\x81\x02\n\x08Scanning\x12q\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\" \x82\xd3\xe4\x93\x02\x1a\"\x15/api/v2/scanning/echo:\x01*\x12\x81\x01\n\x0e\x46olderHashScan\x12#.scanoss.api.scanning.v2.HFHRequest\x1a$.scanoss.api.scanning.v2.HFHResponse\"$\x82\xd3\xe4\x93\x02\x1e\"\x19/api/v2/scanning/hfh/scan:\x01*B\x8a\x02Z1github.com/scanoss/papi/api/scanningv2;scanningv2\x92\x41\xd3\x01\x12m\n\x18SCANOSS Scanning Service\"L\n\x10scanoss-scanning\x12#https://github.com/scanoss/scanning\x1a\x13support@scanoss.com2\x03\x32.0*\x01\x01\x32\x10\x61pplication/json:\x10\x61pplication/jsonR;\n\x03\x34\x30\x34\x12\x34\n*Returned when the resource does not exist.\x12\x06\n\x04\x9a\x02\x01\x07\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -30,20 +41,20 @@ _globals['_SCANNING'].methods_by_name['Echo']._serialized_options = b'\202\323\344\223\002\032\"\025/api/v2/scanning/echo:\001*' _globals['_SCANNING'].methods_by_name['FolderHashScan']._loaded_options = None _globals['_SCANNING'].methods_by_name['FolderHashScan']._serialized_options = b'\202\323\344\223\002\036\"\031/api/v2/scanning/hfh/scan:\001*' - _globals['_HFHREQUEST']._serialized_start=196 - _globals['_HFHREQUEST']._serialized_end=649 - _globals['_HFHREQUEST_CHILDREN']._serialized_start=334 - _globals['_HFHREQUEST_CHILDREN']._serialized_end=649 - _globals['_HFHREQUEST_CHILDREN_LANGEXTENSIONSENTRY']._serialized_start=596 - _globals['_HFHREQUEST_CHILDREN_LANGEXTENSIONSENTRY']._serialized_end=649 - _globals['_HFHRESPONSE']._serialized_start=652 - _globals['_HFHRESPONSE']._serialized_end=1071 - _globals['_HFHRESPONSE_VERSION']._serialized_start=784 - _globals['_HFHRESPONSE_VERSION']._serialized_end=825 - _globals['_HFHRESPONSE_COMPONENT']._serialized_start=828 - _globals['_HFHRESPONSE_COMPONENT']._serialized_end=976 - _globals['_HFHRESPONSE_RESULT']._serialized_start=978 - _globals['_HFHRESPONSE_RESULT']._serialized_end=1071 - _globals['_SCANNING']._serialized_start=1074 - _globals['_SCANNING']._serialized_end=1331 + _globals['_HFHREQUEST']._serialized_start=198 + _globals['_HFHREQUEST']._serialized_end=651 + _globals['_HFHREQUEST_CHILDREN']._serialized_start=336 + _globals['_HFHREQUEST_CHILDREN']._serialized_end=651 + _globals['_HFHREQUEST_CHILDREN_LANGEXTENSIONSENTRY']._serialized_start=598 + _globals['_HFHREQUEST_CHILDREN_LANGEXTENSIONSENTRY']._serialized_end=651 + _globals['_HFHRESPONSE']._serialized_start=654 + _globals['_HFHRESPONSE']._serialized_end=1073 + _globals['_HFHRESPONSE_VERSION']._serialized_start=786 + _globals['_HFHRESPONSE_VERSION']._serialized_end=827 + _globals['_HFHRESPONSE_COMPONENT']._serialized_start=830 + _globals['_HFHRESPONSE_COMPONENT']._serialized_end=978 + _globals['_HFHRESPONSE_RESULT']._serialized_start=980 + _globals['_HFHRESPONSE_RESULT']._serialized_end=1073 + _globals['_SCANNING']._serialized_start=1076 + _globals['_SCANNING']._serialized_end=1333 # @@protoc_insertion_point(module_scope) diff --git a/src/scanoss/api/scanning/v2/scanoss_scanning_pb2_grpc.py b/src/scanoss/api/scanning/v2/scanoss_scanning_pb2_grpc.py index d00b7e38..6928eed7 100644 --- a/src/scanoss/api/scanning/v2/scanoss_scanning_pb2_grpc.py +++ b/src/scanoss/api/scanning/v2/scanoss_scanning_pb2_grpc.py @@ -1,10 +1,30 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 from scanoss.api.scanning.v2 import scanoss_scanning_pb2 as scanoss_dot_api_dot_scanning_dot_v2_dot_scanoss__scanning__pb2 +GRPC_GENERATED_VERSION = '1.73.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in scanoss/api/scanning/v2/scanoss_scanning_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + class ScanningStub(object): """* @@ -21,12 +41,12 @@ def __init__(self, channel): '/scanoss.api.scanning.v2.Scanning/Echo', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, - ) + _registered_method=True) self.FolderHashScan = channel.unary_unary( '/scanoss.api.scanning.v2.Scanning/FolderHashScan', request_serializer=scanoss_dot_api_dot_scanning_dot_v2_dot_scanoss__scanning__pb2.HFHRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_scanning_dot_v2_dot_scanoss__scanning__pb2.HFHResponse.FromString, - ) + _registered_method=True) class ScanningServicer(object): @@ -65,6 +85,7 @@ def add_ScanningServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'scanoss.api.scanning.v2.Scanning', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('scanoss.api.scanning.v2.Scanning', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -84,11 +105,21 @@ def Echo(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.scanning.v2.Scanning/Echo', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.scanning.v2.Scanning/Echo', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def FolderHashScan(request, @@ -101,8 +132,18 @@ def FolderHashScan(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.scanning.v2.Scanning/FolderHashScan', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.scanning.v2.Scanning/FolderHashScan', scanoss_dot_api_dot_scanning_dot_v2_dot_scanoss__scanning__pb2.HFHRequest.SerializeToString, scanoss_dot_api_dot_scanning_dot_v2_dot_scanoss__scanning__pb2.HFHResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2.py b/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2.py index 1b8b0461..195d4386 100644 --- a/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2.py +++ b/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2.py @@ -1,11 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: scanoss/api/semgrep/v2/scanoss-semgrep.proto +# Protobuf Python Version: 6.31.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 0, + '', + 'scanoss/api/semgrep/v2/scanoss-semgrep.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -13,29 +24,29 @@ from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from protoc_gen_swagger.options import annotations_pb2 as protoc__gen__swagger_dot_options_dot_annotations__pb2 - +from protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,scanoss/api/semgrep/v2/scanoss-semgrep.proto\x12\x16scanoss.api.semgrep.v2\x1a*scanoss/api/common/v2/scanoss-common.proto\x1a\x1cgoogle/api/annotations.proto\x1a,protoc-gen-swagger/options/annotations.proto\"\x96\x03\n\x0fSemgrepResponse\x12<\n\x05purls\x18\x01 \x03(\x0b\x32-.scanoss.api.semgrep.v2.SemgrepResponse.Purls\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a\x43\n\x05Issue\x12\x0e\n\x06ruleID\x18\x01 \x01(\t\x12\x0c\n\x04\x66rom\x18\x02 \x01(\t\x12\n\n\x02to\x18\x03 \x01(\t\x12\x10\n\x08severity\x18\x04 \x01(\t\x1a\x64\n\x04\x46ile\x12\x0f\n\x07\x66ileMD5\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\x12=\n\x06issues\x18\x03 \x03(\x0b\x32-.scanoss.api.semgrep.v2.SemgrepResponse.Issue\x1a\x63\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12;\n\x05\x66iles\x18\x03 \x03(\x0b\x32,.scanoss.api.semgrep.v2.SemgrepResponse.File2\xf8\x01\n\x07Semgrep\x12p\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\"\x14/api/v2/semgrep/echo:\x01*\x12{\n\tGetIssues\x12\".scanoss.api.common.v2.PurlRequest\x1a\'.scanoss.api.semgrep.v2.SemgrepResponse\"!\x82\xd3\xe4\x93\x02\x1b\"\x16/api/v2/semgrep/issues:\x01*B\x85\x02Z/github.com/scanoss/papi/api/semgrepv2;semgrepv2\x92\x41\xd0\x01\x12j\n\x17SCANOSS Semgrep Service\"J\n\x0fscanoss-semgrep\x12\"https://github.com/scanoss/semgrep\x1a\x13support@scanoss.com2\x03\x32.0*\x01\x01\x32\x10\x61pplication/json:\x10\x61pplication/jsonR;\n\x03\x34\x30\x34\x12\x34\n*Returned when the resource does not exist.\x12\x06\n\x04\x9a\x02\x01\x07\x62\x06proto3') -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scanoss.api.semgrep.v2.scanoss_semgrep_pb2', globals()) -if _descriptor._USE_C_DESCRIPTORS == False: +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,scanoss/api/semgrep/v2/scanoss-semgrep.proto\x12\x16scanoss.api.semgrep.v2\x1a*scanoss/api/common/v2/scanoss-common.proto\x1a\x1cgoogle/api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\"\x96\x03\n\x0fSemgrepResponse\x12<\n\x05purls\x18\x01 \x03(\x0b\x32-.scanoss.api.semgrep.v2.SemgrepResponse.Purls\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a\x43\n\x05Issue\x12\x0e\n\x06ruleID\x18\x01 \x01(\t\x12\x0c\n\x04\x66rom\x18\x02 \x01(\t\x12\n\n\x02to\x18\x03 \x01(\t\x12\x10\n\x08severity\x18\x04 \x01(\t\x1a\x64\n\x04\x46ile\x12\x0f\n\x07\x66ileMD5\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\x12=\n\x06issues\x18\x03 \x03(\x0b\x32-.scanoss.api.semgrep.v2.SemgrepResponse.Issue\x1a\x63\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12;\n\x05\x66iles\x18\x03 \x03(\x0b\x32,.scanoss.api.semgrep.v2.SemgrepResponse.File2\xf8\x01\n\x07Semgrep\x12p\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\"\x14/api/v2/semgrep/echo:\x01*\x12{\n\tGetIssues\x12\".scanoss.api.common.v2.PurlRequest\x1a\'.scanoss.api.semgrep.v2.SemgrepResponse\"!\x82\xd3\xe4\x93\x02\x1b\"\x16/api/v2/semgrep/issues:\x01*B\x85\x02Z/github.com/scanoss/papi/api/semgrepv2;semgrepv2\x92\x41\xd0\x01\x12j\n\x17SCANOSS Semgrep Service\"J\n\x0fscanoss-semgrep\x12\"https://github.com/scanoss/semgrep\x1a\x13support@scanoss.com2\x03\x32.0*\x01\x01\x32\x10\x61pplication/json:\x10\x61pplication/jsonR;\n\x03\x34\x30\x34\x12\x34\n*Returned when the resource does not exist.\x12\x06\n\x04\x9a\x02\x01\x07\x62\x06proto3') - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z/github.com/scanoss/papi/api/semgrepv2;semgrepv2\222A\320\001\022j\n\027SCANOSS Semgrep Service\"J\n\017scanoss-semgrep\022\"https://github.com/scanoss/semgrep\032\023support@scanoss.com2\0032.0*\001\0012\020application/json:\020application/jsonR;\n\003404\0224\n*Returned when the resource does not exist.\022\006\n\004\232\002\001\007' - _SEMGREP.methods_by_name['Echo']._options = None - _SEMGREP.methods_by_name['Echo']._serialized_options = b'\202\323\344\223\002\031\"\024/api/v2/semgrep/echo:\001*' - _SEMGREP.methods_by_name['GetIssues']._options = None - _SEMGREP.methods_by_name['GetIssues']._serialized_options = b'\202\323\344\223\002\033\"\026/api/v2/semgrep/issues:\001*' - _SEMGREPRESPONSE._serialized_start=193 - _SEMGREPRESPONSE._serialized_end=599 - _SEMGREPRESPONSE_ISSUE._serialized_start=329 - _SEMGREPRESPONSE_ISSUE._serialized_end=396 - _SEMGREPRESPONSE_FILE._serialized_start=398 - _SEMGREPRESPONSE_FILE._serialized_end=498 - _SEMGREPRESPONSE_PURLS._serialized_start=500 - _SEMGREPRESPONSE_PURLS._serialized_end=599 - _SEMGREP._serialized_start=602 - _SEMGREP._serialized_end=850 +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scanoss.api.semgrep.v2.scanoss_semgrep_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'Z/github.com/scanoss/papi/api/semgrepv2;semgrepv2\222A\320\001\022j\n\027SCANOSS Semgrep Service\"J\n\017scanoss-semgrep\022\"https://github.com/scanoss/semgrep\032\023support@scanoss.com2\0032.0*\001\0012\020application/json:\020application/jsonR;\n\003404\0224\n*Returned when the resource does not exist.\022\006\n\004\232\002\001\007' + _globals['_SEMGREP'].methods_by_name['Echo']._loaded_options = None + _globals['_SEMGREP'].methods_by_name['Echo']._serialized_options = b'\202\323\344\223\002\031\"\024/api/v2/semgrep/echo:\001*' + _globals['_SEMGREP'].methods_by_name['GetIssues']._loaded_options = None + _globals['_SEMGREP'].methods_by_name['GetIssues']._serialized_options = b'\202\323\344\223\002\033\"\026/api/v2/semgrep/issues:\001*' + _globals['_SEMGREPRESPONSE']._serialized_start=195 + _globals['_SEMGREPRESPONSE']._serialized_end=601 + _globals['_SEMGREPRESPONSE_ISSUE']._serialized_start=331 + _globals['_SEMGREPRESPONSE_ISSUE']._serialized_end=398 + _globals['_SEMGREPRESPONSE_FILE']._serialized_start=400 + _globals['_SEMGREPRESPONSE_FILE']._serialized_end=500 + _globals['_SEMGREPRESPONSE_PURLS']._serialized_start=502 + _globals['_SEMGREPRESPONSE_PURLS']._serialized_end=601 + _globals['_SEMGREP']._serialized_start=604 + _globals['_SEMGREP']._serialized_end=852 # @@protoc_insertion_point(module_scope) diff --git a/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2_grpc.py b/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2_grpc.py index 4748a3ee..fdda3109 100644 --- a/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2_grpc.py +++ b/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2_grpc.py @@ -1,10 +1,30 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 from scanoss.api.semgrep.v2 import scanoss_semgrep_pb2 as scanoss_dot_api_dot_semgrep_dot_v2_dot_scanoss__semgrep__pb2 +GRPC_GENERATED_VERSION = '1.73.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in scanoss/api/semgrep/v2/scanoss_semgrep_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + class SemgrepStub(object): """ @@ -21,12 +41,12 @@ def __init__(self, channel): '/scanoss.api.semgrep.v2.Semgrep/Echo', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, - ) + _registered_method=True) self.GetIssues = channel.unary_unary( '/scanoss.api.semgrep.v2.Semgrep/GetIssues', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_semgrep_dot_v2_dot_scanoss__semgrep__pb2.SemgrepResponse.FromString, - ) + _registered_method=True) class SemgrepServicer(object): @@ -65,6 +85,7 @@ def add_SemgrepServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'scanoss.api.semgrep.v2.Semgrep', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('scanoss.api.semgrep.v2.Semgrep', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -84,11 +105,21 @@ def Echo(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.semgrep.v2.Semgrep/Echo', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.semgrep.v2.Semgrep/Echo', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetIssues(request, @@ -101,8 +132,18 @@ def GetIssues(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.semgrep.v2.Semgrep/GetIssues', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.semgrep.v2.Semgrep/GetIssues', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.SerializeToString, scanoss_dot_api_dot_semgrep_dot_v2_dot_scanoss__semgrep__pb2.SemgrepResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/src/scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2.py b/src/scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2.py index 9fc87ed3..7608af1d 100644 --- a/src/scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2.py +++ b/src/scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2.py @@ -1,11 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: scanoss/api/vulnerabilities/v2/scanoss-vulnerabilities.proto +# Protobuf Python Version: 6.31.0 """Generated protocol buffer code.""" -from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 0, + '', + 'scanoss/api/vulnerabilities/v2/scanoss-vulnerabilities.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -13,37 +24,73 @@ from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from protoc_gen_swagger.options import annotations_pb2 as protoc__gen__swagger_dot_options_dot_annotations__pb2 - +from protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1.0.0\", \"version\": \"1.0.0\", \"vulnerabilities\": [{\"id\": \"DLA-2640-1\", \"cve\": \"DLA-2640-1\", \"url\": \"https://osv.dev/vulnerability/DLA-2640-1\", \"summary\": \"gst-plugins-good1.0 - security update\", \"severity\": \"Critical\", \"published\": \"2021-04-26\", \"modified\": \"2025-05-26\", \"source\": \"OSV\", \"cvss\": [{\"cvss\": \"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H\", \"cvss_score\": 9.8, \"cvss_severity\": \"Critical\"}]}]}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Vulnerabilities Successfully retrieved\"}}\"\xbd\t\n\x1f\x43omponentsVulnerabilityResponse\x12N\n\ncomponents\x18\x01 \x03(\x0b\x32:.scanoss.api.vulnerabilities.v2.ComponentVulnerabilityInfo\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse:\x92\x08\x92\x41\x8e\x08\n\x8b\x08J\x88\x08{\"components\":[{\"purl\": \"pkg:github/scanoss/engine\", \"requirement\": \"1.0.0\", \"version\": \"1.0.0\", \"vulnerabilities\": [{\"id\": \"DLA-2640-1\", \"cve\": \"DLA-2640-1\", \"url\": \"https://osv.dev/vulnerability/DLA-2640-1\", \"summary\": \"gst-plugins-good1.0 - security update\", \"severity\": \"Critical\", \"published\": \"2021-04-26\", \"modified\": \"2025-05-26\", \"source\": \"OSV\", \"cvss\": [{\"cvss\": \"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H\", \"cvss_score\": 9.8, \"cvss_severity\": \"Critical\"}]}]}, {\"purl\": \"pkg:github/scanoss/scanoss.py\",\"requirement\": \"v1.30.0\",\"version\": \"v1.30.0\", \"vulnerabilities\": [{\"id\": \"CVE-2024-54321\", \"cve\": \"CVE-2024-54321\", \"url\": \"https://nvd.nist.gov/vuln/detail/CVE-2024-54321\", \"summary\": \"Denial of service vulnerability\", \"severity\": \"Medium\", \"published\": \"2024-01-15\", \"modified\": \"2024-02-01\", \"source\": \"NDV\", \"cvss\": [{\"cvss\": \"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L\", \"cvss_score\": 4.3, \"cvss_severity\": \"Medium\"}]}]}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Vulnerabilities Successfully retrieved\"}}2\xc7\x08\n\x0fVulnerabilities\x12x\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"\'\x82\xd3\xe4\x93\x02!\"\x1c/api/v2/vulnerabilities/echo:\x01*\x12q\n\x07GetCpes\x12\x34.scanoss.api.vulnerabilities.v2.VulnerabilityRequest\x1a+.scanoss.api.vulnerabilities.v2.CpeResponse\"\x03\x88\x02\x01\x12\xa2\x01\n\x10GetComponentCpes\x12\'.scanoss.api.common.v2.ComponentRequest\x1a\x35.scanoss.api.vulnerabilities.v2.ComponentCpesResponse\".\x82\xd3\xe4\x93\x02(\x12&/api/v2/vulnerabilities/cpes/component\x12\xa9\x01\n\x11GetComponentsCpes\x12(.scanoss.api.common.v2.ComponentsRequest\x1a\x36.scanoss.api.vulnerabilities.v2.ComponentsCpesResponse\"2\x82\xd3\xe4\x93\x02,\"\'/api/v2/vulnerabilities/cpes/components:\x01*\x12\x86\x01\n\x12GetVulnerabilities\x12\x34.scanoss.api.vulnerabilities.v2.VulnerabilityRequest\x1a\x35.scanoss.api.vulnerabilities.v2.VulnerabilityResponse\"\x03\x88\x02\x01\x12\xb1\x01\n\x1bGetComponentVulnerabilities\x12\'.scanoss.api.common.v2.ComponentRequest\x1a>.scanoss.api.vulnerabilities.v2.ComponentVulnerabilityResponse\")\x82\xd3\xe4\x93\x02#\x12!/api/v2/vulnerabilities/component\x12\xb8\x01\n\x1cGetComponentsVulnerabilities\x12(.scanoss.api.common.v2.ComponentsRequest\x1a?.scanoss.api.vulnerabilities.v2.ComponentsVulnerabilityResponse\"-\x82\xd3\xe4\x93\x02\'\"\"/api/v2/vulnerabilities/components:\x01*B\x92\x03Z?github.com/scanoss/papi/api/vulnerabilitiesv2;vulnerabilitiesv2\x92\x41\xcd\x02\x12\xd4\x01\n\x1dSCANOSS Vulnerability Service\x12RVulnerability service provides vulnerability intelligence for software components.\"Z\n\x17scanoss-vulnerabilities\x12*https://github.com/scanoss/vulnerabilities\x1a\x13support@scanoss.com2\x03\x32.0\x1a\x0f\x61pi.scanoss.com*\x02\x01\x02\x32\x10\x61pplication/json:\x10\x61pplication/jsonR;\n\x03\x34\x30\x34\x12\x34\n*Returned when the resource does not exist.\x12\x06\n\x04\x9a\x02\x01\x07\x62\x06proto3') - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z?github.com/scanoss/papi/api/vulnerabilitiesv2;vulnerabilitiesv2\222A\347\001\022\200\001\n\035SCANOSS Vulnerability Service\"Z\n\027scanoss-vulnerabilities\022*https://github.com/scanoss/vulnerabilities\032\023support@scanoss.com2\0032.0*\001\0012\020application/json:\020application/jsonR;\n\003404\0224\n*Returned when the resource does not exist.\022\006\n\004\232\002\001\007' - _VULNERABILITIES.methods_by_name['Echo']._options = None - _VULNERABILITIES.methods_by_name['Echo']._serialized_options = b'\202\323\344\223\002!\"\034/api/v2/vulnerabilities/echo:\001*' - _VULNERABILITIES.methods_by_name['GetCpes']._options = None - _VULNERABILITIES.methods_by_name['GetCpes']._serialized_options = b'\202\323\344\223\002!\"\034/api/v2/vulnerabilities/cpes:\001*' - _VULNERABILITIES.methods_by_name['GetVulnerabilities']._options = None - _VULNERABILITIES.methods_by_name['GetVulnerabilities']._serialized_options = b'\202\323\344\223\002,\"\'/api/v2/vulnerabilities/vulnerabilities:\001*' - _VULNERABILITYREQUEST._serialized_start=217 - _VULNERABILITYREQUEST._serialized_end=358 - _VULNERABILITYREQUEST_PURLS._serialized_start=316 - _VULNERABILITYREQUEST_PURLS._serialized_end=358 - _CPERESPONSE._serialized_start=361 - _CPERESPONSE._serialized_end=532 - _CPERESPONSE_PURLS._serialized_start=497 - _CPERESPONSE_PURLS._serialized_end=532 - _VULNERABILITYRESPONSE._serialized_start=535 - _VULNERABILITYRESPONSE._serialized_end=954 - _VULNERABILITYRESPONSE_VULNERABILITIES._serialized_start=692 - _VULNERABILITYRESPONSE_VULNERABILITIES._serialized_end=835 - _VULNERABILITYRESPONSE_PURLS._serialized_start=837 - _VULNERABILITYRESPONSE_PURLS._serialized_end=954 - _VULNERABILITIES._serialized_start=957 - _VULNERABILITIES._serialized_end=1432 +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scanoss.api.vulnerabilities.v2.scanoss_vulnerabilities_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'Z?github.com/scanoss/papi/api/vulnerabilitiesv2;vulnerabilitiesv2\222A\315\002\022\324\001\n\035SCANOSS Vulnerability Service\022RVulnerability service provides vulnerability intelligence for software components.\"Z\n\027scanoss-vulnerabilities\022*https://github.com/scanoss/vulnerabilities\032\023support@scanoss.com2\0032.0\032\017api.scanoss.com*\002\001\0022\020application/json:\020application/jsonR;\n\003404\0224\n*Returned when the resource does not exist.\022\006\n\004\232\002\001\007' + _globals['_VULNERABILITYREQUEST']._loaded_options = None + _globals['_VULNERABILITYREQUEST']._serialized_options = b'\030\001' + _globals['_CPERESPONSE']._loaded_options = None + _globals['_CPERESPONSE']._serialized_options = b'\030\001' + _globals['_COMPONENTCPESRESPONSE']._loaded_options = None + _globals['_COMPONENTCPESRESPONSE']._serialized_options = b'\222A\360\001\n\355\001J\352\001{\"component\":{\"purl\": \"pkg:github/scanoss/engine@1.0.0\", \"requirement\": \"1.0.0\", \"version\": \"1.0.0\", \"cpes\": [\"cpe:2.3:a:scanoss:engine:1.0.0:*:*:*:*:*:*:*\"]}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"CPEs Successfully retrieved\"}}' + _globals['_COMPONENTSCPESRESPONSE']._loaded_options = None + _globals['_COMPONENTSCPESRESPONSE']._serialized_options = b'\222A\212\003\n\207\003J\204\003{\"components\":[{\"purl\": \"pkg:github/scanoss/engine\", \"requirement=\": \"1.0.0\", \"version=\": \"1.0.0\", \"cpes\": [\"cpe:2.3:a:scanoss:engine:1.0.0:*:*:*:*:*:*:*\"]}, {\"purl\": \"pkg:github/scanoss/scanoss.py@v1.30.0\",\"requirement\": \"\",\"version\": \"v1.30.0\", \"cpes\": [\"cpe:2.3:a:scanoss:scanoss.py:1.30.0:*:*:*:*:*:*:*\"]} ], \"status\": {\"status\": \"SUCCESS\", \"message\": \"CPEs Successfully retrieved\"}}' + _globals['_VULNERABILITYRESPONSE']._loaded_options = None + _globals['_VULNERABILITYRESPONSE']._serialized_options = b'\030\001' + _globals['_COMPONENTVULNERABILITYRESPONSE']._loaded_options = None + _globals['_COMPONENTVULNERABILITYRESPONSE']._serialized_options = b'\222A\266\004\n\263\004J\260\004{\"component\":{\"purl\": \"pkg:github/scanoss/engine\", \"requirement\": \"=>1.0.0\", \"version\": \"1.0.0\", \"vulnerabilities\": [{\"id\": \"DLA-2640-1\", \"cve\": \"DLA-2640-1\", \"url\": \"https://osv.dev/vulnerability/DLA-2640-1\", \"summary\": \"gst-plugins-good1.0 - security update\", \"severity\": \"Critical\", \"published\": \"2021-04-26\", \"modified\": \"2025-05-26\", \"source\": \"OSV\", \"cvss\": [{\"cvss\": \"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H\", \"cvss_score\": 9.8, \"cvss_severity\": \"Critical\"}]}]}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Vulnerabilities Successfully retrieved\"}}' + _globals['_COMPONENTSVULNERABILITYRESPONSE']._loaded_options = None + _globals['_COMPONENTSVULNERABILITYRESPONSE']._serialized_options = b'\222A\216\010\n\213\010J\210\010{\"components\":[{\"purl\": \"pkg:github/scanoss/engine\", \"requirement\": \"1.0.0\", \"version\": \"1.0.0\", \"vulnerabilities\": [{\"id\": \"DLA-2640-1\", \"cve\": \"DLA-2640-1\", \"url\": \"https://osv.dev/vulnerability/DLA-2640-1\", \"summary\": \"gst-plugins-good1.0 - security update\", \"severity\": \"Critical\", \"published\": \"2021-04-26\", \"modified\": \"2025-05-26\", \"source\": \"OSV\", \"cvss\": [{\"cvss\": \"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H\", \"cvss_score\": 9.8, \"cvss_severity\": \"Critical\"}]}]}, {\"purl\": \"pkg:github/scanoss/scanoss.py\",\"requirement\": \"v1.30.0\",\"version\": \"v1.30.0\", \"vulnerabilities\": [{\"id\": \"CVE-2024-54321\", \"cve\": \"CVE-2024-54321\", \"url\": \"https://nvd.nist.gov/vuln/detail/CVE-2024-54321\", \"summary\": \"Denial of service vulnerability\", \"severity\": \"Medium\", \"published\": \"2024-01-15\", \"modified\": \"2024-02-01\", \"source\": \"NDV\", \"cvss\": [{\"cvss\": \"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L\", \"cvss_score\": 4.3, \"cvss_severity\": \"Medium\"}]}]}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Vulnerabilities Successfully retrieved\"}}' + _globals['_VULNERABILITIES'].methods_by_name['Echo']._loaded_options = None + _globals['_VULNERABILITIES'].methods_by_name['Echo']._serialized_options = b'\202\323\344\223\002!\"\034/api/v2/vulnerabilities/echo:\001*' + _globals['_VULNERABILITIES'].methods_by_name['GetCpes']._loaded_options = None + _globals['_VULNERABILITIES'].methods_by_name['GetCpes']._serialized_options = b'\210\002\001' + _globals['_VULNERABILITIES'].methods_by_name['GetComponentCpes']._loaded_options = None + _globals['_VULNERABILITIES'].methods_by_name['GetComponentCpes']._serialized_options = b'\202\323\344\223\002(\022&/api/v2/vulnerabilities/cpes/component' + _globals['_VULNERABILITIES'].methods_by_name['GetComponentsCpes']._loaded_options = None + _globals['_VULNERABILITIES'].methods_by_name['GetComponentsCpes']._serialized_options = b'\202\323\344\223\002,\"\'/api/v2/vulnerabilities/cpes/components:\001*' + _globals['_VULNERABILITIES'].methods_by_name['GetVulnerabilities']._loaded_options = None + _globals['_VULNERABILITIES'].methods_by_name['GetVulnerabilities']._serialized_options = b'\210\002\001' + _globals['_VULNERABILITIES'].methods_by_name['GetComponentVulnerabilities']._loaded_options = None + _globals['_VULNERABILITIES'].methods_by_name['GetComponentVulnerabilities']._serialized_options = b'\202\323\344\223\002#\022!/api/v2/vulnerabilities/component' + _globals['_VULNERABILITIES'].methods_by_name['GetComponentsVulnerabilities']._loaded_options = None + _globals['_VULNERABILITIES'].methods_by_name['GetComponentsVulnerabilities']._serialized_options = b'\202\323\344\223\002\'\"\"/api/v2/vulnerabilities/components:\001*' + _globals['_VULNERABILITYREQUEST']._serialized_start=219 + _globals['_VULNERABILITYREQUEST']._serialized_end=364 + _globals['_VULNERABILITYREQUEST_PURLS']._serialized_start=318 + _globals['_VULNERABILITYREQUEST_PURLS']._serialized_end=360 + _globals['_CPERESPONSE']._serialized_start=367 + _globals['_CPERESPONSE']._serialized_end=542 + _globals['_CPERESPONSE_PURLS']._serialized_start=503 + _globals['_CPERESPONSE_PURLS']._serialized_end=538 + _globals['_COMPONENTCPESINFO']._serialized_start=544 + _globals['_COMPONENTCPESINFO']._serialized_end=629 + _globals['_COMPONENTCPESRESPONSE']._serialized_start=632 + _globals['_COMPONENTCPESRESPONSE']._serialized_end=1027 + _globals['_COMPONENTSCPESRESPONSE']._serialized_start=1030 + _globals['_COMPONENTSCPESRESPONSE']._serialized_end=1581 + _globals['_CVSS']._serialized_start=1583 + _globals['_CVSS']._serialized_end=1646 + _globals['_VULNERABILITY']._serialized_start=1649 + _globals['_VULNERABILITY']._serialized_end=1842 + _globals['_VULNERABILITYRESPONSE']._serialized_start=1845 + _globals['_VULNERABILITYRESPONSE']._serialized_end=2098 + _globals['_VULNERABILITYRESPONSE_PURLS']._serialized_start=2001 + _globals['_VULNERABILITYRESPONSE_PURLS']._serialized_end=2094 + _globals['_COMPONENTVULNERABILITYINFO']._serialized_start=2101 + _globals['_COMPONENTVULNERABILITYINFO']._serialized_end=2253 + _globals['_COMPONENTVULNERABILITYRESPONSE']._serialized_start=2256 + _globals['_COMPONENTVULNERABILITYRESPONSE']._serialized_end=2995 + _globals['_COMPONENTSVULNERABILITYRESPONSE']._serialized_start=2998 + _globals['_COMPONENTSVULNERABILITYRESPONSE']._serialized_end=4211 + _globals['_VULNERABILITIES']._serialized_start=4214 + _globals['_VULNERABILITIES']._serialized_end=5309 # @@protoc_insertion_point(module_scope) diff --git a/src/scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2_grpc.py b/src/scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2_grpc.py index 59e7b6db..158aaf6b 100644 --- a/src/scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2_grpc.py +++ b/src/scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2_grpc.py @@ -1,14 +1,34 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings from scanoss.api.common.v2 import scanoss_common_pb2 as scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2 from scanoss.api.vulnerabilities.v2 import scanoss_vulnerabilities_pb2 as scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2 +GRPC_GENERATED_VERSION = '1.73.1' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + class VulnerabilitiesStub(object): """ - Expose all of the SCANOSS Vulnerability RPCs here + Vulnerability Service Definition """ def __init__(self, channel): @@ -21,40 +41,125 @@ def __init__(self, channel): '/scanoss.api.vulnerabilities.v2.Vulnerabilities/Echo', request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, - ) + _registered_method=True) self.GetCpes = channel.unary_unary( '/scanoss.api.vulnerabilities.v2.Vulnerabilities/GetCpes', request_serializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.VulnerabilityRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.CpeResponse.FromString, - ) + _registered_method=True) + self.GetComponentCpes = channel.unary_unary( + '/scanoss.api.vulnerabilities.v2.Vulnerabilities/GetComponentCpes', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.ComponentCpesResponse.FromString, + _registered_method=True) + self.GetComponentsCpes = channel.unary_unary( + '/scanoss.api.vulnerabilities.v2.Vulnerabilities/GetComponentsCpes', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.ComponentsCpesResponse.FromString, + _registered_method=True) self.GetVulnerabilities = channel.unary_unary( '/scanoss.api.vulnerabilities.v2.Vulnerabilities/GetVulnerabilities', request_serializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.VulnerabilityRequest.SerializeToString, response_deserializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.VulnerabilityResponse.FromString, - ) + _registered_method=True) + self.GetComponentVulnerabilities = channel.unary_unary( + '/scanoss.api.vulnerabilities.v2.Vulnerabilities/GetComponentVulnerabilities', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.ComponentVulnerabilityResponse.FromString, + _registered_method=True) + self.GetComponentsVulnerabilities = channel.unary_unary( + '/scanoss.api.vulnerabilities.v2.Vulnerabilities/GetComponentsVulnerabilities', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.ComponentsVulnerabilityResponse.FromString, + _registered_method=True) class VulnerabilitiesServicer(object): """ - Expose all of the SCANOSS Vulnerability RPCs here + Vulnerability Service Definition """ def Echo(self, request, context): - """Standard echo + """ + Returns the same message that was sent, used for health checks and connectivity testing """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetCpes(self, request, context): - """Get CPEs associated with a PURL + """ + Get CPEs (Common Platform Enumeration) associated with a PURL - legacy endpoint. + + Legacy method for retrieving Common Platform Enumeration identifiers + associated with software components. Use GetComponentCpes instead. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentCpes(self, request, context): + """ + Get CPEs (Common Platform Enumeration) associated with a single software component. + + Returns Common Platform Enumeration identifiers that match the specified component. + CPEs are used to identify IT platforms in vulnerability databases and enable + vulnerability scanning and assessment. + + See: https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/vulnerabilities/v2/README.md?tab=readme-ov-file#getcomponentcpes + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentsCpes(self, request, context): + """ + Get CPEs (Common Platform Enumeration) associated with multiple software components. + + Returns Common Platform Enumeration identifiers for multiple components in a single request. + CPEs are used to identify IT platforms in vulnerability databases and enable + vulnerability scanning and assessment. + + See: https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/vulnerabilities/v2/README.md?tab=readme-ov-file#getcomponentscpes """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetVulnerabilities(self, request, context): - """Get vulnerability details + """ + Get vulnerability details - legacy endpoint. + + Legacy method for retrieving vulnerability information for software components. + Use GetComponentVulnerabilities or GetComponentsVulnerabilities instead. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentVulnerabilities(self, request, context): + """ + Get vulnerability information for a single software component. + + Analyzes the component and returns known vulnerabilities including CVE details, + severity scores, publication dates, and other security metadata. + Vulnerability data is sourced from various security databases and feeds. + + See: https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/vulnerabilities/v2/README.md?tab=readme-ov-file#getcomponentvulnerabilities + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentsVulnerabilities(self, request, context): + """ + Get vulnerability information for multiple software components in a single request. + + Analyzes multiple components and returns known vulnerabilities for each including CVE details, + severity scores, publication dates, and other security metadata. + Vulnerability data is sourced from various security databases and feeds. + + See: https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/vulnerabilities/v2/README.md?tab=readme-ov-file#getcomponentsvulnerabilities """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -73,21 +178,42 @@ def add_VulnerabilitiesServicer_to_server(servicer, server): request_deserializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.VulnerabilityRequest.FromString, response_serializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.CpeResponse.SerializeToString, ), + 'GetComponentCpes': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentCpes, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.FromString, + response_serializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.ComponentCpesResponse.SerializeToString, + ), + 'GetComponentsCpes': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentsCpes, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.FromString, + response_serializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.ComponentsCpesResponse.SerializeToString, + ), 'GetVulnerabilities': grpc.unary_unary_rpc_method_handler( servicer.GetVulnerabilities, request_deserializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.VulnerabilityRequest.FromString, response_serializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.VulnerabilityResponse.SerializeToString, ), + 'GetComponentVulnerabilities': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentVulnerabilities, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.FromString, + response_serializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.ComponentVulnerabilityResponse.SerializeToString, + ), + 'GetComponentsVulnerabilities': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentsVulnerabilities, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.FromString, + response_serializer=scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.ComponentsVulnerabilityResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'scanoss.api.vulnerabilities.v2.Vulnerabilities', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('scanoss.api.vulnerabilities.v2.Vulnerabilities', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. class Vulnerabilities(object): """ - Expose all of the SCANOSS Vulnerability RPCs here + Vulnerability Service Definition """ @staticmethod @@ -101,11 +227,21 @@ def Echo(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.vulnerabilities.v2.Vulnerabilities/Echo', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.vulnerabilities.v2.Vulnerabilities/Echo', scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoRequest.SerializeToString, scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.EchoResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetCpes(request, @@ -118,11 +254,75 @@ def GetCpes(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.vulnerabilities.v2.Vulnerabilities/GetCpes', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.vulnerabilities.v2.Vulnerabilities/GetCpes', scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.VulnerabilityRequest.SerializeToString, scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.CpeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetComponentCpes(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.vulnerabilities.v2.Vulnerabilities/GetComponentCpes', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.ComponentCpesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetComponentsCpes(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.vulnerabilities.v2.Vulnerabilities/GetComponentsCpes', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.ComponentsCpesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetVulnerabilities(request, @@ -135,8 +335,72 @@ def GetVulnerabilities(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scanoss.api.vulnerabilities.v2.Vulnerabilities/GetVulnerabilities', + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.vulnerabilities.v2.Vulnerabilities/GetVulnerabilities', scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.VulnerabilityRequest.SerializeToString, scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.VulnerabilityResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetComponentVulnerabilities(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.vulnerabilities.v2.Vulnerabilities/GetComponentVulnerabilities', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.ComponentVulnerabilityResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetComponentsVulnerabilities(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/scanoss.api.vulnerabilities.v2.Vulnerabilities/GetComponentsVulnerabilities', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + scanoss_dot_api_dot_vulnerabilities_dot_v2_dot_scanoss__vulnerabilities__pb2.ComponentsVulnerabilityResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/src/scanoss/cli.py b/src/scanoss/cli.py index 7e447522..c3aee759 100644 --- a/src/scanoss/cli.py +++ b/src/scanoss/cli.py @@ -796,9 +796,9 @@ def setup_args() -> None: # noqa: PLR0912, PLR0915 p_inspect_dt_project_violation.add_argument( '--format', '-f', required=False, - choices=['json', 'md'], + choices=['json', 'md', 'jira_md'], default='json', - help='Output format: json (default) or md (Markdown)' + help='Output format: json (default), md (Markdown) or jira_md (JIRA Markdown)' ) p_inspect_dt_project_violation.add_argument( '--timeout', '-M', diff --git a/src/scanoss/inspection/dependency_track/project_violation.py b/src/scanoss/inspection/dependency_track/project_violation.py index 9e2d5ed2..b1c7597c 100644 --- a/src/scanoss/inspection/dependency_track/project_violation.py +++ b/src/scanoss/inspection/dependency_track/project_violation.py @@ -34,7 +34,6 @@ DEFAULT_TIME_OUT = 300.0 MILLISECONDS_TO_SECONDS = 1000 - """ Dependency Track project violation policy check implementation. @@ -43,6 +42,7 @@ for a specific project. """ + class ResolvedLicenseDict(TypedDict): """TypedDict for resolved license information from Dependency Track.""" uuid: str @@ -125,7 +125,7 @@ class DependencyTrackProjectViolationPolicyCheck(PolicyCheck[PolicyViolationDict This class handles retrieving, processing, and formatting policy violations from a Dependency Track instance for a specific project. """ - + def __init__( # noqa: PLR0913 self, debug: bool = False, @@ -161,13 +161,13 @@ def __init__( # noqa: PLR0913 timeout: Timeout for processing in seconds (default: 300) """ super().__init__(debug, trace, quiet, format_type, status, 'dependency-track', output) - self.url = url self.api_key = api_key self.project_id = project_id self.project_name = project_name self.project_version = project_version self.upload_token = upload_token self.timeout = timeout + self.url = url.strip().rstrip('/') if url else None self.dep_track_service = DependencyTrackService(self.api_key, self.url, debug=debug, trace=trace, quiet=quiet) def _json(self, project_violations: list[PolicyViolationDict]) -> Dict[str, Any]: @@ -230,7 +230,7 @@ def is_project_updated(self, dt_project: Dict[str, Any]) -> bool: if not dt_project: self.print_stderr('Warning: No project details supplied. Returning False.') return False - + # Safely extract and normalise timestamp values to numeric types def _safe_timestamp(field, value=None, default=0) -> float: """Convert timestamp value to float, handling string/numeric types safely.""" @@ -241,7 +241,7 @@ def _safe_timestamp(field, value=None, default=0) -> float: except (ValueError, TypeError): self.print_stderr(f'Warning: Invalid timestamp for {field}, value: {value}, using default: {default}') return float(default) - + last_import = _safe_timestamp('lastBomImport', dt_project.get('lastBomImport'), 0) last_vulnerability_analysis = _safe_timestamp('lastVulnerabilityAnalysis', dt_project.get('lastVulnerabilityAnalysis'), 0 @@ -372,7 +372,7 @@ def _sort_project_violations(violations: List[PolicyViolationDict]) -> List[Poli """ type_priority = {'SECURITY': 3, 'LICENSE': 2, 'OTHER': 1} return sorted( - violations, + violations, key=lambda x: -type_priority.get(x.get('type', 'OTHER'), 1) ) @@ -424,8 +424,9 @@ def _md_summary_generator(self, project_violations: list[PolicyViolationDict], t rows.append(row) # End for loop return { - "details": f'### Dependency Track Project Violations\n{table_generator(headers, rows, c_cols)}\n', - "summary": f'{len(project_violations)} policy violations were found.\n', + "details": f'### Dependency Track Project Violations\n{table_generator(headers, rows, c_cols)}\n\n' + f'View project in Dependency Track [here]({self.url}/projects/{self.project_id}).\n', + "summary": f'{len(project_violations)} policy violations were found.\n' } def run(self) -> int: diff --git a/src/scanoss/services/dependency_track_service.py b/src/scanoss/services/dependency_track_service.py index 7a367a0f..debc287d 100644 --- a/src/scanoss/services/dependency_track_service.py +++ b/src/scanoss/services/dependency_track_service.py @@ -41,7 +41,7 @@ def __init__( super().__init__(debug=debug, trace=trace, quiet=quiet) if not url: raise ValueError("Error: Dependency Track URL is required") - self.url = url.rstrip('/') + self.url = url.strip().rstrip('/') if not api_key: raise ValueError("Error: Dependency Track API key is required") self.api_key = api_key diff --git a/src/scanoss/threadeddependencies.py b/src/scanoss/threadeddependencies.py index b2cff5d1..c083f4f4 100644 --- a/src/scanoss/threadeddependencies.py +++ b/src/scanoss/threadeddependencies.py @@ -22,12 +22,12 @@ THE SOFTWARE. """ -import threading -import queue import json -from enum import Enum -from typing import Dict, Optional, Set +import queue +import threading from dataclasses import dataclass +from enum import Enum +from typing import Dict from .scancodedeps import ScancodeDeps from .scanossbase import ScanossBase @@ -63,7 +63,7 @@ class ThreadedDependencies(ScanossBase): inputs: queue.Queue = queue.Queue() output: queue.Queue = queue.Queue() - def __init__( + def __init__( # noqa: PLR0913 self, sc_deps: ScancodeDeps, grpc_api: ScanossGrpc, @@ -180,13 +180,15 @@ def filter_dependencies_by_scopes( return self.filter_dependencies( deps, lambda purl: (exclude and purl not in exclude) or (not exclude and purl in include) ) + return None - def scan_dependencies( + def scan_dependencies( # noqa: PLR0912 self, dep_scope: SCOPE = None, dep_scope_include: str = None, dep_scope_exclude: str = None ) -> None: """ Scan for dependencies from the given file/dir or from an input file (from the input queue). """ + # TODO refactor to simplify branches based on PLR0912 current_thread = threading.get_ident() self.print_trace(f'Starting dependency worker {current_thread}...') try: @@ -194,18 +196,17 @@ def scan_dependencies( deps = None if what_to_scan.startswith(DEP_FILE_PREFIX): # We have a pre-parsed dependency file, load it deps = self.sc_deps.load_from_file(what_to_scan.strip(DEP_FILE_PREFIX)) - else: # Search the file/folder for dependency files to parse - if not self.sc_deps.run_scan(what_to_scan=what_to_scan): - self._errors = True - else: - deps = self.sc_deps.produce_from_file() - if dep_scope is not None: - self.print_debug(f'Filtering {dep_scope.name} dependencies') - if dep_scope_include is not None: - self.print_debug(f"Including dependencies with '{dep_scope_include.split(',')}' scopes") - if dep_scope_exclude is not None: - self.print_debug(f"Excluding dependencies with '{dep_scope_exclude.split(',')}' scopes") - deps = self.filter_dependencies_by_scopes(deps, dep_scope, dep_scope_include, dep_scope_exclude) + elif not self.sc_deps.run_scan(what_to_scan=what_to_scan): + self._errors = True + else: + deps = self.sc_deps.produce_from_file() + if dep_scope is not None: + self.print_debug(f'Filtering {dep_scope.name} dependencies') + if dep_scope_include is not None: + self.print_debug(f"Including dependencies with '{dep_scope_include.split(',')}' scopes") + if dep_scope_exclude is not None: + self.print_debug(f"Excluding dependencies with '{dep_scope_exclude.split(',')}' scopes") + deps = self.filter_dependencies_by_scopes(deps, dep_scope, dep_scope_include, dep_scope_exclude) if not self._errors: if deps is None: