diff --git a/CHANGELOG.md b/CHANGELOG.md index 663c4eb..9bb3fad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Upcoming changes... +## [1.34.0] - 2025-10-06 +### Added +- Add REST API support for decoration commands + ## [1.33.0] - 2025-09-19 ### Added - Add `licenses` sub-command to `component` command @@ -668,3 +672,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [1.31.5]: https://github.com/scanoss/scanoss.py/compare/v1.31.4...v1.31.5 [1.32.0]: https://github.com/scanoss/scanoss.py/compare/v1.31.5...v1.32.0 [1.33.0]: https://github.com/scanoss/scanoss.py/compare/v1.32.0...v1.33.0 +[1.34.0]: https://github.com/scanoss/scanoss.py/compare/v1.33.0...v1.34.0 diff --git a/src/scanoss/__init__.py b/src/scanoss/__init__.py index 2a69dd2..3339f1a 100644 --- a/src/scanoss/__init__.py +++ b/src/scanoss/__init__.py @@ -22,4 +22,4 @@ THE SOFTWARE. """ -__version__ = '1.33.0' +__version__ = '1.34.0' diff --git a/src/scanoss/api/common/v2/scanoss_common_pb2.py b/src/scanoss/api/common/v2/scanoss_common_pb2.py index a82eb99..3daa20b 100644 --- a/src/scanoss/api/common/v2/scanoss_common_pb2.py +++ b/src/scanoss/api/common/v2/scanoss_common_pb2.py @@ -26,7 +26,7 @@ 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\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-gitproxy.zycloud.tk/scanoss/papi/api/commonv2;commonv2b\x06proto3') +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\"}]}\"v\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:\x02\x18\x01\")\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-gitproxy.zycloud.tk/scanoss/papi/api/commonv2;commonv2b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -42,8 +42,10 @@ _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['_PURLREQUEST']._loaded_options = None + _globals['_PURLREQUEST']._serialized_options = b'\030\001' + _globals['_STATUSCODE']._serialized_start=776 + _globals['_STATUSCODE']._serialized_end=872 _globals['_STATUSRESPONSE']._serialized_start=150 _globals['_STATUSRESPONSE']._serialized_end=234 _globals['_ECHOREQUEST']._serialized_start=236 @@ -55,9 +57,9 @@ _globals['_COMPONENTSREQUEST']._serialized_start=411 _globals['_COMPONENTSREQUEST']._serialized_end=611 _globals['_PURLREQUEST']._serialized_start=613 - _globals['_PURLREQUEST']._serialized_end=727 + _globals['_PURLREQUEST']._serialized_end=731 _globals['_PURLREQUEST_PURLS']._serialized_start=685 _globals['_PURLREQUEST_PURLS']._serialized_end=727 - _globals['_PURL']._serialized_start=729 - _globals['_PURL']._serialized_end=770 + _globals['_PURL']._serialized_start=733 + _globals['_PURL']._serialized_end=774 # @@protoc_insertion_point(module_scope) diff --git a/src/scanoss/api/components/v2/scanoss_components_pb2.py b/src/scanoss/api/components/v2/scanoss_components_pb2.py index 3820ed9..fb2a523 100644 --- a/src/scanoss/api/components/v2/scanoss_components_pb2.py +++ b/src/scanoss/api/components/v2/scanoss_components_pb2.py @@ -27,46 +27,60 @@ 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-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 = _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\"\xae\x01\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:6\x92\x41\x33\n1J/{\"search\": \"scanoss\", \"limit\": 10, \"offset\": 0}\"\xfe\x01\n\rCompStatistic\x12.\n\x12total_source_files\x18\x01 \x01(\x05R\x12total_source_files\x12 \n\x0btotal_lines\x18\x02 \x01(\x05R\x0btotal_lines\x12,\n\x11total_blank_lines\x18\x03 \x01(\x05R\x11total_blank_lines\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\"\xb5\x05\n\x1b\x43omponentsStatisticResponse\x12~\n\x14\x63omponent_statistics\x18\x01 \x03(\x0b\x32J.scanoss.api.components.v2.ComponentsStatisticResponse.ComponentStatisticsR\x14\x63omponent_statistics\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1ar\n\x13\x43omponentStatistics\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:\xea\x02\x92\x41\xe6\x02\n\xe3\x02J\xe0\x02{\"component_statistics\": [{\"purl\": \"pkg:github/scanoss/engine@5.0.0\", \"version\": \"5.0.0\", \"statistics\": {\"total_source_files\": 156, \"total_lines\": 25430, \"total_blank_lines\": 3420, \"languages\": [{\"name\": \"C\", \"files\": 89}, {\"name\": \"C Header\", \"files\": 45}]}}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component statistics successfully retrieved\"}}\"\xdb\x04\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\x1aK\n\tComponent\x12\x15\n\tcomponent\x18\x01 \x01(\tB\x02\x18\x01\x12\x0c\n\x04purl\x18\x02 \x01(\t\x12\x0b\n\x03url\x18\x03 \x01(\t\x12\x0c\n\x04name\x18\x04 \x01(\t:\xf3\x02\x92\x41\xef\x02\n\xec\x02J\xe9\x02{\"components\": [{\"name\": \"scanoss-py\", \"purl\": \"pkg:github/scanoss/scanoss.py\", \"url\": \"https://github.com/scanoss/scanoss.py\", \"component\": \"scanoss-py\"}, {\"name\": \"engine\", \"purl\": \"pkg:github/scanoss/engine\", \"url\": \"https://github.com/scanoss/engine\", \"component\": \"engine\"}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Components successfully retrieved\"}}\"l\n\x12\x43ompVersionRequest\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x05:9\x92\x41\x36\n4J2{\"purl\": \"pkg:github/scanoss/engine\", \"limit\": 20}\"\xe0\x07\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\x1aj\n\x07License\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x07spdx_id\x18\x02 \x01(\tR\x07spdx_id\x12*\n\x10is_spdx_approved\x18\x03 \x01(\x08R\x10is_spdx_approved\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\x95\x01\n\tComponent\x12\x15\n\tcomponent\x18\x01 \x01(\tB\x02\x18\x01\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.Version\x12\x0c\n\x04name\x18\x05 \x01(\t:\xcc\x03\x92\x41\xc8\x03\n\xc5\x03J\xc2\x03{\"component\": {\"name\": \"engine\", \"purl\": \"pkg:github/scanoss/engine\", \"url\": \"https://github.com/scanoss/engine\", \"versions\": [{\"version\": \"5.0.0\", \"licenses\": [{\"name\": \"GNU General Public License v2.0\", \"spdx_id\": \"GPL-2.0\", \"is_spdx_approved\": true, \"url\": \"https://spdx.org/licenses/GPL-2.0.html\"}], \"date\": \"2024-01-15T10:30:00Z\"}], \"component\": \"engine\"}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component versions successfully retrieved\"}}2\xca\x04\n\nComponents\x12o\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\"\x13/v2/components/echo:\x01*\x12\x8e\x01\n\x10SearchComponents\x12,.scanoss.api.components.v2.CompSearchRequest\x1a-.scanoss.api.components.v2.CompSearchResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\x12\x15/v2/components/search\x12\x96\x01\n\x14GetComponentVersions\x12-.scanoss.api.components.v2.CompVersionRequest\x1a..scanoss.api.components.v2.CompVersionResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/v2/components/versions\x12\xa0\x01\n\x16GetComponentStatistics\x12(.scanoss.api.common.v2.ComponentsRequest\x1a\x36.scanoss.api.components.v2.ComponentsStatisticResponse\"$\x82\xd3\xe4\x93\x02\x1e\"\x19/v2/components/statistics:\x01*B\x8b\x03Z5github.com/scanoss/papi/api/componentsv2;componentsv2\x92\x41\xd0\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\x06proto3') _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['DESCRIPTOR']._serialized_options = b'Z5github.com/scanoss/papi/api/componentsv2;componentsv2\222A\320\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 \002' + _globals['_COMPSEARCHREQUEST']._loaded_options = None + _globals['_COMPSEARCHREQUEST']._serialized_options = b'\222A3\n1J/{\"search\": \"scanoss\", \"limit\": 10, \"offset\": 0}' + _globals['_COMPONENTSSTATISTICRESPONSE']._loaded_options = None + _globals['_COMPONENTSSTATISTICRESPONSE']._serialized_options = b'\222A\346\002\n\343\002J\340\002{\"component_statistics\": [{\"purl\": \"pkg:github/scanoss/engine@5.0.0\", \"version\": \"5.0.0\", \"statistics\": {\"total_source_files\": 156, \"total_lines\": 25430, \"total_blank_lines\": 3420, \"languages\": [{\"name\": \"C\", \"files\": 89}, {\"name\": \"C Header\", \"files\": 45}]}}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component statistics successfully retrieved\"}}' + _globals['_COMPSEARCHRESPONSE_COMPONENT'].fields_by_name['component']._loaded_options = None + _globals['_COMPSEARCHRESPONSE_COMPONENT'].fields_by_name['component']._serialized_options = b'\030\001' + _globals['_COMPSEARCHRESPONSE']._loaded_options = None + _globals['_COMPSEARCHRESPONSE']._serialized_options = b'\222A\357\002\n\354\002J\351\002{\"components\": [{\"name\": \"scanoss-py\", \"purl\": \"pkg:github/scanoss/scanoss.py\", \"url\": \"https://github.com/scanoss/scanoss.py\", \"component\": \"scanoss-py\"}, {\"name\": \"engine\", \"purl\": \"pkg:github/scanoss/engine\", \"url\": \"https://github.com/scanoss/engine\", \"component\": \"engine\"}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Components successfully retrieved\"}}' + _globals['_COMPVERSIONREQUEST']._loaded_options = None + _globals['_COMPVERSIONREQUEST']._serialized_options = b'\222A6\n4J2{\"purl\": \"pkg:github/scanoss/engine\", \"limit\": 20}' + _globals['_COMPVERSIONRESPONSE_COMPONENT'].fields_by_name['component']._loaded_options = None + _globals['_COMPVERSIONRESPONSE_COMPONENT'].fields_by_name['component']._serialized_options = b'\030\001' + _globals['_COMPVERSIONRESPONSE']._loaded_options = None + _globals['_COMPVERSIONRESPONSE']._serialized_options = b'\222A\310\003\n\305\003J\302\003{\"component\": {\"name\": \"engine\", \"purl\": \"pkg:github/scanoss/engine\", \"url\": \"https://github.com/scanoss/engine\", \"versions\": [{\"version\": \"5.0.0\", \"licenses\": [{\"name\": \"GNU General Public License v2.0\", \"spdx_id\": \"GPL-2.0\", \"is_spdx_approved\": true, \"url\": \"https://spdx.org/licenses/GPL-2.0.html\"}], \"date\": \"2024-01-15T10:30:00Z\"}], \"component\": \"engine\"}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Component versions successfully retrieved\"}}' _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['Echo']._serialized_options = b'\202\323\344\223\002\030\"\023/v2/components/echo:\001*' _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['SearchComponents']._serialized_options = b'\202\323\344\223\002\027\022\025/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['GetComponentVersions']._serialized_options = b'\202\323\344\223\002\031\022\027/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 + _globals['_COMPONENTS'].methods_by_name['GetComponentStatistics']._serialized_options = b'\202\323\344\223\002\036\"\031/v2/components/statistics:\001*' + _globals['_COMPSEARCHREQUEST']._serialized_start=204 + _globals['_COMPSEARCHREQUEST']._serialized_end=378 + _globals['_COMPSTATISTIC']._serialized_start=381 + _globals['_COMPSTATISTIC']._serialized_end=635 + _globals['_COMPSTATISTIC_LANGUAGE']._serialized_start=596 + _globals['_COMPSTATISTIC_LANGUAGE']._serialized_end=635 + _globals['_COMPONENTSSTATISTICRESPONSE']._serialized_start=638 + _globals['_COMPONENTSSTATISTICRESPONSE']._serialized_end=1331 + _globals['_COMPONENTSSTATISTICRESPONSE_COMPONENTSTATISTICS']._serialized_start=852 + _globals['_COMPONENTSSTATISTICRESPONSE_COMPONENTSTATISTICS']._serialized_end=966 + _globals['_COMPSEARCHRESPONSE']._serialized_start=1334 + _globals['_COMPSEARCHRESPONSE']._serialized_end=1937 + _globals['_COMPSEARCHRESPONSE_COMPONENT']._serialized_start=1488 + _globals['_COMPSEARCHRESPONSE_COMPONENT']._serialized_end=1563 + _globals['_COMPVERSIONREQUEST']._serialized_start=1939 + _globals['_COMPVERSIONREQUEST']._serialized_end=2047 + _globals['_COMPVERSIONRESPONSE']._serialized_start=2050 + _globals['_COMPVERSIONRESPONSE']._serialized_end=3042 + _globals['_COMPVERSIONRESPONSE_LICENSE']._serialized_start=2205 + _globals['_COMPVERSIONRESPONSE_LICENSE']._serialized_end=2311 + _globals['_COMPVERSIONRESPONSE_VERSION']._serialized_start=2313 + _globals['_COMPVERSIONRESPONSE_VERSION']._serialized_end=2427 + _globals['_COMPVERSIONRESPONSE_COMPONENT']._serialized_start=2430 + _globals['_COMPVERSIONRESPONSE_COMPONENT']._serialized_end=2579 + _globals['_COMPONENTS']._serialized_start=3045 + _globals['_COMPONENTS']._serialized_end=3631 # @@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 b80082b..47490fb 100644 --- a/src/scanoss/api/components/v2/scanoss_components_pb2_grpc.py +++ b/src/scanoss/api/components/v2/scanoss_components_pb2_grpc.py @@ -54,8 +54,8 @@ def __init__(self, channel): _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, + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2.ComponentsStatisticResponse.FromString, _registered_method=True) @@ -112,8 +112,8 @@ def add_ComponentsServicer_to_server(servicer, server): ), 'GetComponentStatistics': grpc.unary_unary_rpc_method_handler( servicer.GetComponentStatistics, - request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.FromString, - response_serializer=scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2.CompStatisticResponse.SerializeToString, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.FromString, + response_serializer=scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2.ComponentsStatisticResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( @@ -224,8 +224,8 @@ def GetComponentStatistics(request, 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, + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + scanoss_dot_api_dot_components_dot_v2_dot_scanoss__components__pb2.ComponentsStatisticResponse.FromString, options, channel_credentials, insecure, diff --git a/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2.py b/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2.py index 6d488e1..0632444 100644 --- a/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2.py +++ b/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2.py @@ -27,50 +27,128 @@ 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-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 = _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\"\xf7\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:\x02\x18\x01\"\x85\x01\n\x13\x43omponentAlgorithms\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x13\n\x0brequirement\x18\x03 \x01(\t\x12:\n\nalgorithms\x18\x04 \x03(\x0b\x32&.scanoss.api.cryptography.v2.Algorithm\"\xe0\x04\n\x1c\x43omponentsAlgorithmsResponse\x12\x44\n\ncomponents\x18\x01 \x03(\x0b\x32\x30.scanoss.api.cryptography.v2.ComponentAlgorithms\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse:\xc2\x03\x92\x41\xbe\x03\n\xbb\x03J\xb8\x03{\"components\":[{\"purl\": \"pkg:github/scanoss/engine\", \"requirement\": \">=5.0.0\", \"version\": \"5.0.0\", \"algorithms\": [{\"algorithm\": \"AES\", \"strength\": \"Strong\"}, {\"algorithm\": \"RSA\", \"strength\": \"Strong\"}]}, {\"purl\": \"pkg:github/scanoss/scanoss.py\", \"requirement\": \"~1.30.0\", \"version\": \"v1.30.0\", \"algorithms\": [{\"algorithm\": \"SHA-256\", \"strength\": \"Strong\"}]}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Algorithms Successfully retrieved\"}}\"\xc0\x03\n\x1b\x43omponentAlgorithmsResponse\x12\x43\n\tcomponent\x18\x01 \x01(\x0b\x32\x30.scanoss.api.cryptography.v2.ComponentAlgorithms\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse:\xa4\x02\x92\x41\xa0\x02\n\x9d\x02J\x9a\x02{\"component\":{\"purl\": \"pkg:github/scanoss/engine\", \"requirement\": \">=5.0.0\", \"version\": \"5.0.0\", \"algorithms\": [{\"algorithm\": \"AES\", \"strength\": \"Strong\"}, {\"algorithm\": \"RSA\", \"strength\": \"Strong\"}]}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Algorithms Successfully retrieved\"}}\"\x86\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:\x02\x18\x01\"\xa2\x05\n#ComponentsAlgorithmsInRangeResponse\x12^\n\ncomponents\x18\x01 \x03(\x0b\x32J.scanoss.api.cryptography.v2.ComponentsAlgorithmsInRangeResponse.Component\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1ag\n\tComponent\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:\xfa\x02\x92\x41\xf6\x02\n\xf3\x02J\xf0\x02{\"components\":[{\"purl\": \"pkg:github/scanoss/engine\", \"versions\": [\"1.0.0\", \"2.0.0\"], \"algorithms\": [{\"algorithm\": \"AES\", \"strength\": \"Strong\"}]}, {\"purl\": \"pkg:github/scanoss/scanoss.py\", \"versions\": [\"v1.30.0\"], \"algorithms\": [{\"algorithm\": \"SHA-256\", \"strength\": \"Strong\"}]}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Algorithms in range Successfully retrieved\"}}\"\xce\x04\n\"ComponentAlgorithmsInRangeResponse\x12\\\n\tcomponent\x18\x01 \x01(\x0b\x32I.scanoss.api.cryptography.v2.ComponentAlgorithmsInRangeResponse.Component\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1ag\n\tComponent\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:\xa9\x02\x92\x41\xa5\x02\n\xa2\x02J\x9f\x02{\"component\": {\"purl\": \"pkg:github/scanoss/engine\", \"versions\": [\"1.0.0\", \"2.0.0\", \"3.0.0\"], \"algorithms\": [{\"algorithm\": \"AES\", \"strength\": \"Strong\"}, {\"algorithm\": \"RSA\", \"strength\": \"Strong\"}]}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Algorithms in range Successfully retrieved\"}}\"\x86\x02\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\x66\n\x04Purl\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12$\n\rversions_with\x18\x02 \x03(\tR\rversions_with\x12*\n\x10versions_without\x18\x03 \x03(\tR\x10versions_without:\x02\x18\x01\"\xeb\x04\n!ComponentsVersionsInRangeResponse\x12\\\n\ncomponents\x18\x01 \x03(\x0b\x32H.scanoss.api.cryptography.v2.ComponentsVersionsInRangeResponse.Component\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1ak\n\tComponent\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12$\n\rversions_with\x18\x02 \x03(\tR\rversions_with\x12*\n\x10versions_without\x18\x03 \x03(\tR\x10versions_without:\xc3\x02\x92\x41\xbf\x02\n\xbc\x02J\xb9\x02{\"components\":[{\"purl\": \"pkg:github/scanoss/engine\", \"versions_with\": [\"2.0.0\", \"3.0.0\"], \"versions_without\": [\"1.0.0\"]}, {\"purl\": \"pkg:github/scanoss/scanoss.py\", \"versions_with\": [\"v1.30.0\"], \"versions_without\": [\"v1.29.0\"]}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Version ranges Successfully retrieved\"}}\"\x8e\x04\n ComponentVersionsInRangeResponse\x12Z\n\tcomponent\x18\x01 \x01(\x0b\x32G.scanoss.api.cryptography.v2.ComponentVersionsInRangeResponse.Component\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1ak\n\tComponent\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12$\n\rversions_with\x18\x02 \x03(\tR\rversions_with\x12*\n\x10versions_without\x18\x03 \x03(\tR\x10versions_without:\xe9\x01\x92\x41\xe5\x01\n\xe2\x01J\xdf\x01{\"component\": {\"purl\": \"pkg:github/scanoss/engine\", \"versions_with\": [\"2.0.0\", \"3.0.0\", \"4.0.0\"], \"versions_without\": [\"1.0.0\", \"1.5.0\"]}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Version ranges Successfully retrieved\"}}\"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\"v\n\x0e\x43omponentHints\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x13\n\x0brequirement\x18\x03 \x01(\t\x12\x30\n\x05hints\x18\x04 \x03(\x0b\x32!.scanoss.api.cryptography.v2.Hint\"\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.Hint\"\x91\x02\n\x1e\x43omponentsHintsInRangeResponse\x12Y\n\ncomponents\x18\x01 \x03(\x0b\x32\x45.scanoss.api.cryptography.v2.ComponentsHintsInRangeResponse.Component\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a]\n\tComponent\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.Hint\"\x8e\x02\n\x1d\x43omponentHintsInRangeResponse\x12W\n\tcomponent\x18\x01 \x01(\x0b\x32\x44.scanoss.api.cryptography.v2.ComponentHintsInRangeResponse.Component\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a]\n\tComponent\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.Hint\"\xd4\x06\n!ComponentsEncryptionHintsResponse\x12?\n\ncomponents\x18\x01 \x03(\x0b\x32+.scanoss.api.cryptography.v2.ComponentHints\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse:\xb6\x05\x92\x41\xb2\x05\n\xaf\x05J\xac\x05{\"components\":[{\"purl\": \"pkg:github/scanoss/engine\", \"requirement\": \">=5.0.0\", \"version\": \"5.0.0\", \"hints\": [{\"id\": \"openssl-hint-001\", \"name\": \"OpenSSL\", \"description\": \"Industry standard cryptographic library\", \"category\": \"library\", \"url\": \"https://www.openssl.org/\", \"purl\": \"pkg:generic/openssl@3.0.0\"}]}, {\"purl\": \"pkg:github/scanoss/scanoss.py\", \"requirement\": \"~1.30.0\", \"version\": \"v1.30.0\", \"hints\": [{\"id\": \"tls-protocol-001\", \"name\": \"TLS 1.3\", \"description\": \"Transport Layer Security protocol\", \"category\": \"protocol\", \"url\": \"https://tools.ietf.org/html/rfc8446\", \"purl\": \"\"}]}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Cryptographic hints Successfully retrieved\"}}\"\xb4\x04\n ComponentEncryptionHintsResponse\x12>\n\tcomponent\x18\x01 \x01(\x0b\x32+.scanoss.api.cryptography.v2.ComponentHints\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse:\x98\x03\x92\x41\x94\x03\n\x91\x03J\x8e\x03{\"component\":{\"purl\": \"pkg:github/scanoss/engine\", \"requirement\": \">=5.0.0\", \"version\": \"5.0.0\", \"hints\": [{\"id\": \"openssl-hint-001\", \"name\": \"OpenSSL\", \"description\": \"Industry standard cryptographic library\", \"category\": \"library\", \"url\": \"https://www.openssl.org/\", \"purl\": \"pkg:generic/openssl@3.0.0\"}]}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Cryptographic hints Successfully retrieved\"}}2\x86\x14\n\x0c\x43ryptography\x12q\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\" \x82\xd3\xe4\x93\x02\x1a\"\x15/v2/cryptography/echo:\x01*\x12h\n\rGetAlgorithms\x12\".scanoss.api.common.v2.PurlRequest\x1a..scanoss.api.cryptography.v2.AlgorithmResponse\"\x03\x88\x02\x01\x12\xaa\x01\n\x16GetComponentAlgorithms\x12\'.scanoss.api.common.v2.ComponentRequest\x1a\x38.scanoss.api.cryptography.v2.ComponentAlgorithmsResponse\"-\x82\xd3\xe4\x93\x02\'\x12%/v2/cryptography/algorithms/component\x12\xb1\x01\n\x17GetComponentsAlgorithms\x12(.scanoss.api.common.v2.ComponentsRequest\x1a\x39.scanoss.api.cryptography.v2.ComponentsAlgorithmsResponse\"1\x82\xd3\xe4\x93\x02+\"&/v2/cryptography/algorithms/components:\x01*\x12w\n\x14GetAlgorithmsInRange\x12\".scanoss.api.common.v2.PurlRequest\x1a\x36.scanoss.api.cryptography.v2.AlgorithmsInRangeResponse\"\x03\x88\x02\x01\x12\xbe\x01\n\x1dGetComponentAlgorithmsInRange\x12\'.scanoss.api.common.v2.ComponentRequest\x1a?.scanoss.api.cryptography.v2.ComponentAlgorithmsInRangeResponse\"3\x82\xd3\xe4\x93\x02-\x12+/v2/cryptography/algorithms/range/component\x12\xc5\x01\n\x1eGetComponentsAlgorithmsInRange\x12(.scanoss.api.common.v2.ComponentsRequest\x1a@.scanoss.api.cryptography.v2.ComponentsAlgorithmsInRangeResponse\"7\x82\xd3\xe4\x93\x02\x31\",/v2/cryptography/algorithms/range/components:\x01*\x12s\n\x12GetVersionsInRange\x12\".scanoss.api.common.v2.PurlRequest\x1a\x34.scanoss.api.cryptography.v2.VersionsInRangeResponse\"\x03\x88\x02\x01\x12\xc3\x01\n\x1bGetComponentVersionsInRange\x12\'.scanoss.api.common.v2.ComponentRequest\x1a=.scanoss.api.cryptography.v2.ComponentVersionsInRangeResponse\"<\x82\xd3\xe4\x93\x02\x36\x12\x34/v2/cryptography/algorithms/versions/range/component\x12\xca\x01\n\x1cGetComponentsVersionsInRange\x12(.scanoss.api.common.v2.ComponentsRequest\x1a>.scanoss.api.cryptography.v2.ComponentsVersionsInRangeResponse\"@\x82\xd3\xe4\x93\x02:\"5/v2/cryptography/algorithms/versions/range/components:\x01*\x12m\n\x0fGetHintsInRange\x12\".scanoss.api.common.v2.PurlRequest\x1a\x31.scanoss.api.cryptography.v2.HintsInRangeResponse\"\x03\x88\x02\x01\x12\xaf\x01\n\x18GetComponentHintsInRange\x12\'.scanoss.api.common.v2.ComponentRequest\x1a:.scanoss.api.cryptography.v2.ComponentHintsInRangeResponse\".\x82\xd3\xe4\x93\x02(\x12&/v2/cryptography/hints/range/component\x12\xb6\x01\n\x19GetComponentsHintsInRange\x12(.scanoss.api.common.v2.ComponentsRequest\x1a;.scanoss.api.cryptography.v2.ComponentsHintsInRangeResponse\"2\x82\xd3\xe4\x93\x02,\"\'/v2/cryptography/hints/range/components:\x01*\x12i\n\x12GetEncryptionHints\x12\".scanoss.api.common.v2.PurlRequest\x1a*.scanoss.api.cryptography.v2.HintsResponse\"\x03\x88\x02\x01\x12\xaf\x01\n\x1bGetComponentEncryptionHints\x12\'.scanoss.api.common.v2.ComponentRequest\x1a=.scanoss.api.cryptography.v2.ComponentEncryptionHintsResponse\"(\x82\xd3\xe4\x93\x02\"\x12 /v2/cryptography/hints/component\x12\xb6\x01\n\x1cGetComponentsEncryptionHints\x12(.scanoss.api.common.v2.ComponentsRequest\x1a>.scanoss.api.cryptography.v2.ComponentsEncryptionHintsResponse\",\x82\xd3\xe4\x93\x02&\"!/v2/cryptography/hints/components:\x01*B\xbb\x03Z9github.com/scanoss/papi/api/cryptographyv2;cryptographyv2\x92\x41\xfc\x02\x12\x83\x02\n\x1cSCANOSS Cryptography Service\x12\x87\x01\x43ryptography service provides cryptographic intelligence for software components including algorithm detection and encryption analysis.\"T\n\x14scanoss-cryptography\x12\'https://github.com/scanoss/cryptography\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') _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['DESCRIPTOR']._serialized_options = b'Z9github.com/scanoss/papi/api/cryptographyv2;cryptographyv2\222A\374\002\022\203\002\n\034SCANOSS Cryptography Service\022\207\001Cryptography service provides cryptographic intelligence for software components including algorithm detection and encryption analysis.\"T\n\024scanoss-cryptography\022\'https://github.com/scanoss/cryptography\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['_ALGORITHMRESPONSE']._loaded_options = None + _globals['_ALGORITHMRESPONSE']._serialized_options = b'\030\001' + _globals['_COMPONENTSALGORITHMSRESPONSE']._loaded_options = None + _globals['_COMPONENTSALGORITHMSRESPONSE']._serialized_options = b'\222A\276\003\n\273\003J\270\003{\"components\":[{\"purl\": \"pkg:github/scanoss/engine\", \"requirement\": \">=5.0.0\", \"version\": \"5.0.0\", \"algorithms\": [{\"algorithm\": \"AES\", \"strength\": \"Strong\"}, {\"algorithm\": \"RSA\", \"strength\": \"Strong\"}]}, {\"purl\": \"pkg:github/scanoss/scanoss.py\", \"requirement\": \"~1.30.0\", \"version\": \"v1.30.0\", \"algorithms\": [{\"algorithm\": \"SHA-256\", \"strength\": \"Strong\"}]}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Algorithms Successfully retrieved\"}}' + _globals['_COMPONENTALGORITHMSRESPONSE']._loaded_options = None + _globals['_COMPONENTALGORITHMSRESPONSE']._serialized_options = b'\222A\240\002\n\235\002J\232\002{\"component\":{\"purl\": \"pkg:github/scanoss/engine\", \"requirement\": \">=5.0.0\", \"version\": \"5.0.0\", \"algorithms\": [{\"algorithm\": \"AES\", \"strength\": \"Strong\"}, {\"algorithm\": \"RSA\", \"strength\": \"Strong\"}]}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Algorithms Successfully retrieved\"}}' + _globals['_ALGORITHMSINRANGERESPONSE']._loaded_options = None + _globals['_ALGORITHMSINRANGERESPONSE']._serialized_options = b'\030\001' + _globals['_COMPONENTSALGORITHMSINRANGERESPONSE']._loaded_options = None + _globals['_COMPONENTSALGORITHMSINRANGERESPONSE']._serialized_options = b'\222A\366\002\n\363\002J\360\002{\"components\":[{\"purl\": \"pkg:github/scanoss/engine\", \"versions\": [\"1.0.0\", \"2.0.0\"], \"algorithms\": [{\"algorithm\": \"AES\", \"strength\": \"Strong\"}]}, {\"purl\": \"pkg:github/scanoss/scanoss.py\", \"versions\": [\"v1.30.0\"], \"algorithms\": [{\"algorithm\": \"SHA-256\", \"strength\": \"Strong\"}]}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Algorithms in range Successfully retrieved\"}}' + _globals['_COMPONENTALGORITHMSINRANGERESPONSE']._loaded_options = None + _globals['_COMPONENTALGORITHMSINRANGERESPONSE']._serialized_options = b'\222A\245\002\n\242\002J\237\002{\"component\": {\"purl\": \"pkg:github/scanoss/engine\", \"versions\": [\"1.0.0\", \"2.0.0\", \"3.0.0\"], \"algorithms\": [{\"algorithm\": \"AES\", \"strength\": \"Strong\"}, {\"algorithm\": \"RSA\", \"strength\": \"Strong\"}]}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Algorithms in range Successfully retrieved\"}}' + _globals['_VERSIONSINRANGERESPONSE']._loaded_options = None + _globals['_VERSIONSINRANGERESPONSE']._serialized_options = b'\030\001' + _globals['_COMPONENTSVERSIONSINRANGERESPONSE']._loaded_options = None + _globals['_COMPONENTSVERSIONSINRANGERESPONSE']._serialized_options = b'\222A\277\002\n\274\002J\271\002{\"components\":[{\"purl\": \"pkg:github/scanoss/engine\", \"versions_with\": [\"2.0.0\", \"3.0.0\"], \"versions_without\": [\"1.0.0\"]}, {\"purl\": \"pkg:github/scanoss/scanoss.py\", \"versions_with\": [\"v1.30.0\"], \"versions_without\": [\"v1.29.0\"]}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Version ranges Successfully retrieved\"}}' + _globals['_COMPONENTVERSIONSINRANGERESPONSE']._loaded_options = None + _globals['_COMPONENTVERSIONSINRANGERESPONSE']._serialized_options = b'\222A\345\001\n\342\001J\337\001{\"component\": {\"purl\": \"pkg:github/scanoss/engine\", \"versions_with\": [\"2.0.0\", \"3.0.0\", \"4.0.0\"], \"versions_without\": [\"1.0.0\", \"1.5.0\"]}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Version ranges Successfully retrieved\"}}' + _globals['_COMPONENTSENCRYPTIONHINTSRESPONSE']._loaded_options = None + _globals['_COMPONENTSENCRYPTIONHINTSRESPONSE']._serialized_options = b'\222A\262\005\n\257\005J\254\005{\"components\":[{\"purl\": \"pkg:github/scanoss/engine\", \"requirement\": \">=5.0.0\", \"version\": \"5.0.0\", \"hints\": [{\"id\": \"openssl-hint-001\", \"name\": \"OpenSSL\", \"description\": \"Industry standard cryptographic library\", \"category\": \"library\", \"url\": \"https://www.openssl.org/\", \"purl\": \"pkg:generic/openssl@3.0.0\"}]}, {\"purl\": \"pkg:github/scanoss/scanoss.py\", \"requirement\": \"~1.30.0\", \"version\": \"v1.30.0\", \"hints\": [{\"id\": \"tls-protocol-001\", \"name\": \"TLS 1.3\", \"description\": \"Transport Layer Security protocol\", \"category\": \"protocol\", \"url\": \"https://tools.ietf.org/html/rfc8446\", \"purl\": \"\"}]}], \"status\": {\"status\": \"SUCCESS\", \"message\": \"Cryptographic hints Successfully retrieved\"}}' + _globals['_COMPONENTENCRYPTIONHINTSRESPONSE']._loaded_options = None + _globals['_COMPONENTENCRYPTIONHINTSRESPONSE']._serialized_options = b'\222A\224\003\n\221\003J\216\003{\"component\":{\"purl\": \"pkg:github/scanoss/engine\", \"requirement\": \">=5.0.0\", \"version\": \"5.0.0\", \"hints\": [{\"id\": \"openssl-hint-001\", \"name\": \"OpenSSL\", \"description\": \"Industry standard cryptographic library\", \"category\": \"library\", \"url\": \"https://www.openssl.org/\", \"purl\": \"pkg:generic/openssl@3.0.0\"}]}, \"status\": {\"status\": \"SUCCESS\", \"message\": \"Cryptographic hints Successfully retrieved\"}}' _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['Echo']._serialized_options = b'\202\323\344\223\002\032\"\025/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['GetAlgorithms']._serialized_options = b'\210\002\001' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentAlgorithms']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentAlgorithms']._serialized_options = b'\202\323\344\223\002\'\022%/v2/cryptography/algorithms/component' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentsAlgorithms']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentsAlgorithms']._serialized_options = b'\202\323\344\223\002+\"&/v2/cryptography/algorithms/components:\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['GetAlgorithmsInRange']._serialized_options = b'\210\002\001' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentAlgorithmsInRange']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentAlgorithmsInRange']._serialized_options = b'\202\323\344\223\002-\022+/v2/cryptography/algorithms/range/component' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentsAlgorithmsInRange']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentsAlgorithmsInRange']._serialized_options = b'\202\323\344\223\0021\",/v2/cryptography/algorithms/range/components:\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['GetVersionsInRange']._serialized_options = b'\210\002\001' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentVersionsInRange']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentVersionsInRange']._serialized_options = b'\202\323\344\223\0026\0224/v2/cryptography/algorithms/versions/range/component' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentsVersionsInRange']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentsVersionsInRange']._serialized_options = b'\202\323\344\223\002:\"5/v2/cryptography/algorithms/versions/range/components:\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['GetHintsInRange']._serialized_options = b'\210\002\001' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentHintsInRange']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentHintsInRange']._serialized_options = b'\202\323\344\223\002(\022&/v2/cryptography/hints/range/component' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentsHintsInRange']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentsHintsInRange']._serialized_options = b'\202\323\344\223\002,\"\'/v2/cryptography/hints/range/components:\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['_CRYPTOGRAPHY'].methods_by_name['GetEncryptionHints']._serialized_options = b'\210\002\001' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentEncryptionHints']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentEncryptionHints']._serialized_options = b'\202\323\344\223\002\"\022 /v2/cryptography/hints/component' + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentsEncryptionHints']._loaded_options = None + _globals['_CRYPTOGRAPHY'].methods_by_name['GetComponentsEncryptionHints']._serialized_options = b'\202\323\344\223\002&\"!/v2/cryptography/hints/components:\001*' _globals['_ALGORITHM']._serialized_start=209 _globals['_ALGORITHM']._serialized_end=257 _globals['_ALGORITHMRESPONSE']._serialized_start=260 - _globals['_ALGORITHMRESPONSE']._serialized_end=503 + _globals['_ALGORITHMRESPONSE']._serialized_end=507 _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 + _globals['_COMPONENTALGORITHMS']._serialized_start=510 + _globals['_COMPONENTALGORITHMS']._serialized_end=643 + _globals['_COMPONENTSALGORITHMSRESPONSE']._serialized_start=646 + _globals['_COMPONENTSALGORITHMSRESPONSE']._serialized_end=1254 + _globals['_COMPONENTALGORITHMSRESPONSE']._serialized_start=1257 + _globals['_COMPONENTALGORITHMSRESPONSE']._serialized_end=1705 + _globals['_ALGORITHMSINRANGERESPONSE']._serialized_start=1708 + _globals['_ALGORITHMSINRANGERESPONSE']._serialized_end=1970 + _globals['_ALGORITHMSINRANGERESPONSE_PURL']._serialized_start=1868 + _globals['_ALGORITHMSINRANGERESPONSE_PURL']._serialized_end=1966 + _globals['_COMPONENTSALGORITHMSINRANGERESPONSE']._serialized_start=1973 + _globals['_COMPONENTSALGORITHMSINRANGERESPONSE']._serialized_end=2647 + _globals['_COMPONENTSALGORITHMSINRANGERESPONSE_COMPONENT']._serialized_start=2163 + _globals['_COMPONENTSALGORITHMSINRANGERESPONSE_COMPONENT']._serialized_end=2266 + _globals['_COMPONENTALGORITHMSINRANGERESPONSE']._serialized_start=2650 + _globals['_COMPONENTALGORITHMSINRANGERESPONSE']._serialized_end=3240 + _globals['_COMPONENTALGORITHMSINRANGERESPONSE_COMPONENT']._serialized_start=2163 + _globals['_COMPONENTALGORITHMSINRANGERESPONSE_COMPONENT']._serialized_end=2266 + _globals['_VERSIONSINRANGERESPONSE']._serialized_start=3243 + _globals['_VERSIONSINRANGERESPONSE']._serialized_end=3505 + _globals['_VERSIONSINRANGERESPONSE_PURL']._serialized_start=3399 + _globals['_VERSIONSINRANGERESPONSE_PURL']._serialized_end=3501 + _globals['_COMPONENTSVERSIONSINRANGERESPONSE']._serialized_start=3508 + _globals['_COMPONENTSVERSIONSINRANGERESPONSE']._serialized_end=4127 + _globals['_COMPONENTSVERSIONSINRANGERESPONSE_COMPONENT']._serialized_start=3694 + _globals['_COMPONENTSVERSIONSINRANGERESPONSE_COMPONENT']._serialized_end=3801 + _globals['_COMPONENTVERSIONSINRANGERESPONSE']._serialized_start=4130 + _globals['_COMPONENTVERSIONSINRANGERESPONSE']._serialized_end=4656 + _globals['_COMPONENTVERSIONSINRANGERESPONSE_COMPONENT']._serialized_start=3694 + _globals['_COMPONENTVERSIONSINRANGERESPONSE_COMPONENT']._serialized_end=3801 + _globals['_HINT']._serialized_start=4658 + _globals['_HINT']._serialized_end=4756 + _globals['_COMPONENTHINTS']._serialized_start=4758 + _globals['_COMPONENTHINTS']._serialized_end=4876 + _globals['_HINTSRESPONSE']._serialized_start=4879 + _globals['_HINTSRESPONSE']._serialized_end=5104 + _globals['_HINTSRESPONSE_PURLS']._serialized_start=5016 + _globals['_HINTSRESPONSE_PURLS']._serialized_end=5104 + _globals['_HINTSINRANGERESPONSE']._serialized_start=5107 + _globals['_HINTSINRANGERESPONSE']._serialized_end=5345 + _globals['_HINTSINRANGERESPONSE_PURL']._serialized_start=5257 + _globals['_HINTSINRANGERESPONSE_PURL']._serialized_end=5345 + _globals['_COMPONENTSHINTSINRANGERESPONSE']._serialized_start=5348 + _globals['_COMPONENTSHINTSINRANGERESPONSE']._serialized_end=5621 + _globals['_COMPONENTSHINTSINRANGERESPONSE_COMPONENT']._serialized_start=5528 + _globals['_COMPONENTSHINTSINRANGERESPONSE_COMPONENT']._serialized_end=5621 + _globals['_COMPONENTHINTSINRANGERESPONSE']._serialized_start=5624 + _globals['_COMPONENTHINTSINRANGERESPONSE']._serialized_end=5894 + _globals['_COMPONENTHINTSINRANGERESPONSE_COMPONENT']._serialized_start=5528 + _globals['_COMPONENTHINTSINRANGERESPONSE_COMPONENT']._serialized_end=5621 + _globals['_COMPONENTSENCRYPTIONHINTSRESPONSE']._serialized_start=5897 + _globals['_COMPONENTSENCRYPTIONHINTSRESPONSE']._serialized_end=6749 + _globals['_COMPONENTENCRYPTIONHINTSRESPONSE']._serialized_start=6752 + _globals['_COMPONENTENCRYPTIONHINTSRESPONSE']._serialized_end=7316 + _globals['_CRYPTOGRAPHY']._serialized_start=7319 + _globals['_CRYPTOGRAPHY']._serialized_end=9885 # @@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 e015e87..5aa7f6a 100644 --- a/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2_grpc.py +++ b/src/scanoss/api/cryptography/v2/scanoss_cryptography_pb2_grpc.py @@ -28,7 +28,10 @@ class CryptographyStub(object): """ - Expose all of the SCANOSS Cryptography RPCs here + Cryptography Service Definition + + Provides comprehensive cryptographic intelligence for software components + including algorithm detection, encryption hints, and security assessments. """ def __init__(self, channel): @@ -47,70 +50,280 @@ def __init__(self, channel): 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.GetComponentAlgorithms = channel.unary_unary( + '/scanoss.api.cryptography.v2.Cryptography/GetComponentAlgorithms', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentAlgorithmsResponse.FromString, + _registered_method=True) + self.GetComponentsAlgorithms = channel.unary_unary( + '/scanoss.api.cryptography.v2.Cryptography/GetComponentsAlgorithms', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsAlgorithmsResponse.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.GetComponentAlgorithmsInRange = channel.unary_unary( + '/scanoss.api.cryptography.v2.Cryptography/GetComponentAlgorithmsInRange', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentAlgorithmsInRangeResponse.FromString, + _registered_method=True) + self.GetComponentsAlgorithmsInRange = channel.unary_unary( + '/scanoss.api.cryptography.v2.Cryptography/GetComponentsAlgorithmsInRange', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsAlgorithmsInRangeResponse.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.GetComponentVersionsInRange = channel.unary_unary( + '/scanoss.api.cryptography.v2.Cryptography/GetComponentVersionsInRange', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentVersionsInRangeResponse.FromString, + _registered_method=True) + self.GetComponentsVersionsInRange = channel.unary_unary( + '/scanoss.api.cryptography.v2.Cryptography/GetComponentsVersionsInRange', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsVersionsInRangeResponse.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.GetComponentHintsInRange = channel.unary_unary( + '/scanoss.api.cryptography.v2.Cryptography/GetComponentHintsInRange', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentHintsInRangeResponse.FromString, + _registered_method=True) + self.GetComponentsHintsInRange = channel.unary_unary( + '/scanoss.api.cryptography.v2.Cryptography/GetComponentsHintsInRange', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsHintsInRangeResponse.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) + self.GetComponentEncryptionHints = channel.unary_unary( + '/scanoss.api.cryptography.v2.Cryptography/GetComponentEncryptionHints', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentEncryptionHintsResponse.FromString, + _registered_method=True) + self.GetComponentsEncryptionHints = channel.unary_unary( + '/scanoss.api.cryptography.v2.Cryptography/GetComponentsEncryptionHints', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsEncryptionHintsResponse.FromString, + _registered_method=True) class CryptographyServicer(object): """ - Expose all of the SCANOSS Cryptography RPCs here + Cryptography Service Definition + + Provides comprehensive cryptographic intelligence for software components + including algorithm detection, encryption hints, and security assessments. """ 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 GetAlgorithms(self, request, context): - """Get Cryptographic algorithms associated with a list of PURLs and, optionally, a requirement + """****** Algorithms ****** // + + + Get cryptographic algorithms associated with a list of PURLs - legacy endpoint. + + Legacy method for retrieving cryptographic algorithms used by software components. + Use GetComponentAlgorithms or GetComponentsAlgorithms instead. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentAlgorithms(self, request, context): + """ + Get cryptographic algorithms associated with a single software component. + + Analyzes the component and returns cryptographic algorithms detected in the codebase + including algorithm names and strength classifications. + + See: https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/cryptography/v2/README.md#getcomponentalgorithms + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentsAlgorithms(self, request, context): + """ + Get cryptographic algorithms associated with multiple software components in a single request. + + Analyzes multiple components and returns cryptographic algorithms detected in each codebase + including algorithm names and strength classifications. + + See: https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/cryptography/v2/README.md#getcomponentsalgorithms """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetAlgorithmsInRange(self, request, context): - """Given a list of PURLS and version ranges, get a list of cryptographic algorithms used + """****** Algorithms in range ****** // + + + Get cryptographic algorithms used across version ranges - legacy endpoint. + + Legacy method for retrieving cryptographic algorithms across component version ranges. + Use GetComponentAlgorithmsInRange or GetComponentsAlgorithmsInRange instead. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentAlgorithmsInRange(self, request, context): + """ + Get cryptographic algorithms used by a component across specified version ranges. + + Analyzes the component across version ranges and returns all cryptographic algorithms + detected along with the versions where they appear. + + See: https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/cryptography/v2/README.md#getcomponentalgorithmsinrange + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentsAlgorithmsInRange(self, request, context): + """ + Get cryptographic algorithms used by multiple components across specified version ranges. + + Analyzes multiple components across version ranges and returns all cryptographic algorithms + detected along with the versions where they appear for each component. + + See: https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/cryptography/v2/README.md#getcomponentsalgorithmsinrange """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetVersionsInRange(self, request, context): - """Given a list of PURLS and version ranges, get a list of versions that do/do not contain cryptographic algorithms + """****** Versions in range ****** // + + + Get component versions that contain or don't contain cryptographic algorithms - legacy endpoint. + + Legacy method for retrieving version lists based on cryptographic algorithm presence. + Use ComponentVersionsInRange or ComponentsVersionsInRange instead. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentVersionsInRange(self, request, context): + """ + Get component versions that contain or don't contain cryptographic algorithms within specified ranges. + + Returns lists of versions that either contain cryptographic algorithms or don't, + helping assess cryptographic presence across component evolution. + + See: https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/cryptography/v2/README.md#componentversionsinrange + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentsVersionsInRange(self, request, context): + """ + Get multiple component versions that contain or don't contain cryptographic algorithms within specified ranges. + + Returns lists of versions for multiple components that either contain cryptographic algorithms or don't, + helping assess cryptographic presence across component evolution in batch operations. + + See: https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/cryptography/v2/README.md#componentsversionsinrange """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetHintsInRange(self, request, context): - """Given a list of PURLS and version ranges, get hints related to protocol/library/sdk/framework + """****** Hints in range ****** // + + + Get cryptographic hints across version ranges - legacy endpoint. + + Legacy method for retrieving cryptographic hints related to protocols, libraries, + SDKs and frameworks across version ranges. Use ComponentHintsInRange or ComponentsHintsInRange instead. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentHintsInRange(self, request, context): + """ + Get cryptographic hints across version ranges - legacy endpoint. + + Legacy method for retrieving cryptographic hints related to protocols, libraries, + SDKs and frameworks across version ranges. Use ComponentHintsInRange or ComponentsHintsInRange instead. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentsHintsInRange(self, request, context): + """ + Get cryptographic hints across version ranges - legacy endpoint. + + Legacy method for retrieving cryptographic hints related to protocols, libraries, + SDKs and frameworks across version ranges. Use ComponentHintsInRange or ComponentsHintsInRange instead. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetEncryptionHints(self, request, context): - """Given a list of PURLS, get hints related to protocol/library/sdk/framework + """****** Encryption hints ****** // + + + Get encryption hints for components - legacy endpoint. + + Legacy method for retrieving hints about cryptographic protocols, libraries, + SDKs and frameworks used by components. Use ComponentHintsInRange or ComponentsHintsInRange instead. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentEncryptionHints(self, request, context): + """ + Get cryptographic hints for a single component. + + Returns hints about cryptographic protocols, libraries, SDKs and frameworks + used by the component, providing insights into cryptographic dependencies. + + See: https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/cryptography/v2/README.md#componenthintsinrange + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentsEncryptionHints(self, request, context): + """ + Get cryptographic hints for multiple components in a single request. + + Returns hints about cryptographic protocols, libraries, SDKs and frameworks + used by multiple components, providing insights into cryptographic dependencies. + + See: https://github.com/scanoss/papi/blob/main/protobuf/scanoss/api/cryptography/v2/README.md#componentshintsinrange """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -129,26 +342,76 @@ def add_CryptographyServicer_to_server(servicer, server): request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.FromString, response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.AlgorithmResponse.SerializeToString, ), + 'GetComponentAlgorithms': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentAlgorithms, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.FromString, + response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentAlgorithmsResponse.SerializeToString, + ), + 'GetComponentsAlgorithms': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentsAlgorithms, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.FromString, + response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsAlgorithmsResponse.SerializeToString, + ), 'GetAlgorithmsInRange': grpc.unary_unary_rpc_method_handler( servicer.GetAlgorithmsInRange, request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.FromString, response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.AlgorithmsInRangeResponse.SerializeToString, ), + 'GetComponentAlgorithmsInRange': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentAlgorithmsInRange, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.FromString, + response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentAlgorithmsInRangeResponse.SerializeToString, + ), + 'GetComponentsAlgorithmsInRange': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentsAlgorithmsInRange, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.FromString, + response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsAlgorithmsInRangeResponse.SerializeToString, + ), 'GetVersionsInRange': grpc.unary_unary_rpc_method_handler( servicer.GetVersionsInRange, request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.FromString, response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.VersionsInRangeResponse.SerializeToString, ), + 'GetComponentVersionsInRange': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentVersionsInRange, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.FromString, + response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentVersionsInRangeResponse.SerializeToString, + ), + 'GetComponentsVersionsInRange': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentsVersionsInRange, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.FromString, + response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsVersionsInRangeResponse.SerializeToString, + ), 'GetHintsInRange': grpc.unary_unary_rpc_method_handler( servicer.GetHintsInRange, request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.FromString, response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.HintsInRangeResponse.SerializeToString, ), + 'GetComponentHintsInRange': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentHintsInRange, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.FromString, + response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentHintsInRangeResponse.SerializeToString, + ), + 'GetComponentsHintsInRange': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentsHintsInRange, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.FromString, + response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsHintsInRangeResponse.SerializeToString, + ), 'GetEncryptionHints': grpc.unary_unary_rpc_method_handler( servicer.GetEncryptionHints, request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.FromString, response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.HintsResponse.SerializeToString, ), + 'GetComponentEncryptionHints': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentEncryptionHints, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.FromString, + response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentEncryptionHintsResponse.SerializeToString, + ), + 'GetComponentsEncryptionHints': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentsEncryptionHints, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.FromString, + response_serializer=scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsEncryptionHintsResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'scanoss.api.cryptography.v2.Cryptography', rpc_method_handlers) @@ -159,7 +422,10 @@ def add_CryptographyServicer_to_server(servicer, server): # This class is part of an EXPERIMENTAL API. class Cryptography(object): """ - Expose all of the SCANOSS Cryptography RPCs here + Cryptography Service Definition + + Provides comprehensive cryptographic intelligence for software components + including algorithm detection, encryption hints, and security assessments. """ @staticmethod @@ -216,6 +482,60 @@ def GetAlgorithms(request, metadata, _registered_method=True) + @staticmethod + def GetComponentAlgorithms(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.cryptography.v2.Cryptography/GetComponentAlgorithms', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentAlgorithmsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetComponentsAlgorithms(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.cryptography.v2.Cryptography/GetComponentsAlgorithms', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsAlgorithmsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetAlgorithmsInRange(request, target, @@ -243,6 +563,60 @@ def GetAlgorithmsInRange(request, metadata, _registered_method=True) + @staticmethod + def GetComponentAlgorithmsInRange(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.cryptography.v2.Cryptography/GetComponentAlgorithmsInRange', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentAlgorithmsInRangeResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetComponentsAlgorithmsInRange(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.cryptography.v2.Cryptography/GetComponentsAlgorithmsInRange', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsAlgorithmsInRangeResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetVersionsInRange(request, target, @@ -270,6 +644,60 @@ def GetVersionsInRange(request, metadata, _registered_method=True) + @staticmethod + def GetComponentVersionsInRange(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.cryptography.v2.Cryptography/GetComponentVersionsInRange', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentVersionsInRangeResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetComponentsVersionsInRange(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.cryptography.v2.Cryptography/GetComponentsVersionsInRange', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsVersionsInRangeResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetHintsInRange(request, target, @@ -297,6 +725,60 @@ def GetHintsInRange(request, metadata, _registered_method=True) + @staticmethod + def GetComponentHintsInRange(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.cryptography.v2.Cryptography/GetComponentHintsInRange', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentHintsInRangeResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetComponentsHintsInRange(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.cryptography.v2.Cryptography/GetComponentsHintsInRange', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsHintsInRangeResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetEncryptionHints(request, target, @@ -323,3 +805,57 @@ def GetEncryptionHints(request, timeout, metadata, _registered_method=True) + + @staticmethod + def GetComponentEncryptionHints(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.cryptography.v2.Cryptography/GetComponentEncryptionHints', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentEncryptionHintsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetComponentsEncryptionHints(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.cryptography.v2.Cryptography/GetComponentsEncryptionHints', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + scanoss_dot_api_dot_cryptography_dot_v2_dot_scanoss__cryptography__pb2.ComponentsEncryptionHintsResponse.FromString, + 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 59399d8..37662af 100644 --- a/src/scanoss/api/dependencies/v2/scanoss_dependencies_pb2.py +++ b/src/scanoss/api/dependencies/v2/scanoss_dependencies_pb2.py @@ -27,7 +27,7 @@ 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-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 = _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\"\xda\x02\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:i\x18\x01\x92\x41\x64\nbJ`{\"files\":[{\"file\":\"package.json\",\"purls\":[{\"purl\":\"pkg:npm/express\",\"requirement\":\"^4.18.0\"}]}]}\"\xd8\x07\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\x1ak\n\x08Licenses\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x07spdx_id\x18\x02 \x01(\tR\x07spdx_id\x12*\n\x10is_spdx_approved\x18\x03 \x01(\x08R\x10is_spdx_approved\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:\xa2\x03\x18\x01\x92\x41\x9c\x03\n\x99\x03J\x96\x03{\"files\":[{\"file\":\"package.json\",\"id\":\"dependency\",\"status\":\"pending\",\"dependencies\":[{\"component\":\"express\",\"purl\":\"pkg:npm/express\",\"version\":\"4.18.2\",\"licenses\":[{\"name\":\"MIT\",\"spdx_id\":\"MIT\",\"is_spdx_approved\":true,\"url\":\"https://opensource.org/licenses/MIT\"}],\"url\":\"https://www.npmjs.com/package/express\",\"comment\":\"\"}]}],\"status\":{\"status\":\"SUCCESS\",\"message\":\"Dependencies successfully retrieved\"}}\"\x8d\x02\n\x1bTransitiveDependencyRequest\x12\r\n\x05\x64\x65pth\x18\x01 \x01(\x05\x12\r\n\x05limit\x18\x02 \x01(\x05\x12;\n\ncomponents\x18\x03 \x03(\x0b\x32\'.scanoss.api.common.v2.ComponentRequest:\x92\x01\x92\x41\x8e\x01\n\x8b\x01J\x88\x01{\"depth\":3,\"limit\":50,\"components\":[{\"purl\":\"pkg:npm/express\",\"requirement\":\"4.18.0\"},{\"purl\":\"pkg:npm/lodash\",\"requirement\":\"4.17.0\"}]}\"\x89\x04\n\x1cTransitiveDependencyResponse\x12Y\n\x0c\x64\x65pendencies\x18\x01 \x03(\x0b\x32\x43.scanoss.api.dependencies.v2.TransitiveDependencyResponse.Component\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse\x1a?\n\tComponent\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x13\n\x0brequirement\x18\x03 \x01(\t:\x95\x02\x92\x41\x91\x02\n\x8e\x02J\x8b\x02{\"dependencies\":[{\"purl\":\"pkg:npm/express@4.18.2\",\"version\":\"4.18.2\"},{\"purl\":\"pkg:npm/body-parser@1.20.1\",\"version\":\"1.20.1\"},{\"purl\":\"pkg:npm/cookie@0.5.0\",\"version\":\"0.5.0\"}],\"status\":{\"status\":\"SUCCESS\",\"message\":\"Transitive dependencies successfully retrieved\"}}2\xe9\x03\n\x0c\x44\x65pendencies\x12q\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\" \x82\xd3\xe4\x93\x02\x1a\"\x15/v2/dependencies/echo:\x01*\x12\x9f\x01\n\x0fGetDependencies\x12..scanoss.api.dependencies.v2.DependencyRequest\x1a/.scanoss.api.dependencies.v2.DependencyResponse\"+\x88\x02\x01\x82\xd3\xe4\x93\x02\"\"\x1d/v2/dependencies/dependencies:\x01*\x12\xc3\x01\n\x19GetTransitiveDependencies\x12\x38.scanoss.api.dependencies.v2.TransitiveDependencyRequest\x1a\x39.scanoss.api.dependencies.v2.TransitiveDependencyResponse\"1\x82\xd3\xe4\x93\x02+\"&/v2/dependencies/transitive/components:\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') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -35,32 +35,40 @@ 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['_DEPENDENCYREQUEST']._loaded_options = None + _globals['_DEPENDENCYREQUEST']._serialized_options = b'\030\001\222Ad\nbJ`{\"files\":[{\"file\":\"package.json\",\"purls\":[{\"purl\":\"pkg:npm/express\",\"requirement\":\"^4.18.0\"}]}]}' + _globals['_DEPENDENCYRESPONSE']._loaded_options = None + _globals['_DEPENDENCYRESPONSE']._serialized_options = b'\030\001\222A\234\003\n\231\003J\226\003{\"files\":[{\"file\":\"package.json\",\"id\":\"dependency\",\"status\":\"pending\",\"dependencies\":[{\"component\":\"express\",\"purl\":\"pkg:npm/express\",\"version\":\"4.18.2\",\"licenses\":[{\"name\":\"MIT\",\"spdx_id\":\"MIT\",\"is_spdx_approved\":true,\"url\":\"https://opensource.org/licenses/MIT\"}],\"url\":\"https://www.npmjs.com/package/express\",\"comment\":\"\"}]}],\"status\":{\"status\":\"SUCCESS\",\"message\":\"Dependencies successfully retrieved\"}}' + _globals['_TRANSITIVEDEPENDENCYREQUEST']._loaded_options = None + _globals['_TRANSITIVEDEPENDENCYREQUEST']._serialized_options = b'\222A\216\001\n\213\001J\210\001{\"depth\":3,\"limit\":50,\"components\":[{\"purl\":\"pkg:npm/express\",\"requirement\":\"4.18.0\"},{\"purl\":\"pkg:npm/lodash\",\"requirement\":\"4.17.0\"}]}' + _globals['_TRANSITIVEDEPENDENCYRESPONSE']._loaded_options = None + _globals['_TRANSITIVEDEPENDENCYRESPONSE']._serialized_options = b'\222A\221\002\n\216\002J\213\002{\"dependencies\":[{\"purl\":\"pkg:npm/express@4.18.2\",\"version\":\"4.18.2\"},{\"purl\":\"pkg:npm/body-parser@1.20.1\",\"version\":\"1.20.1\"},{\"purl\":\"pkg:npm/cookie@0.5.0\",\"version\":\"0.5.0\"}],\"status\":{\"status\":\"SUCCESS\",\"message\":\"Transitive dependencies successfully retrieved\"}}' _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['Echo']._serialized_options = b'\202\323\344\223\002\032\"\025/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['GetDependencies']._serialized_options = b'\210\002\001\202\323\344\223\002\"\"\035/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['_DEPENDENCIES'].methods_by_name['GetTransitiveDependencies']._serialized_options = b'\202\323\344\223\002+\"&/v2/dependencies/transitive/components:\001*' _globals['_DEPENDENCYREQUEST']._serialized_start=210 - _globals['_DEPENDENCYREQUEST']._serialized_end=449 + _globals['_DEPENDENCYREQUEST']._serialized_end=556 _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 + _globals['_DEPENDENCYRESPONSE']._serialized_start=559 + _globals['_DEPENDENCYRESPONSE']._serialized_end=1543 + _globals['_DEPENDENCYRESPONSE_LICENSES']._serialized_start=706 + _globals['_DEPENDENCYRESPONSE_LICENSES']._serialized_end=813 + _globals['_DEPENDENCYRESPONSE_DEPENDENCIES']._serialized_start=816 + _globals['_DEPENDENCYRESPONSE_DEPENDENCIES']._serialized_end=986 + _globals['_DEPENDENCYRESPONSE_FILES']._serialized_start=989 + _globals['_DEPENDENCYRESPONSE_FILES']._serialized_end=1122 + _globals['_TRANSITIVEDEPENDENCYREQUEST']._serialized_start=1546 + _globals['_TRANSITIVEDEPENDENCYREQUEST']._serialized_end=1815 + _globals['_TRANSITIVEDEPENDENCYRESPONSE']._serialized_start=1818 + _globals['_TRANSITIVEDEPENDENCYRESPONSE']._serialized_end=2339 + _globals['_TRANSITIVEDEPENDENCYRESPONSE_COMPONENT']._serialized_start=1996 + _globals['_TRANSITIVEDEPENDENCYRESPONSE_COMPONENT']._serialized_end=2059 + _globals['_DEPENDENCIES']._serialized_start=2342 + _globals['_DEPENDENCIES']._serialized_end=2831 # @@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 aa4e5b7..7e8f6ab 100644 --- a/src/scanoss/api/dependencies/v2/scanoss_dependencies_pb2_grpc.py +++ b/src/scanoss/api/dependencies/v2/scanoss_dependencies_pb2_grpc.py @@ -68,6 +68,7 @@ def Echo(self, request, context): def GetDependencies(self, request, context): """Get dependency details + Deprecated: Use /v2/licenses/components instead """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') diff --git a/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2.py b/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2.py index e79f7ec..148ba0f 100644 --- a/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2.py +++ b/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2.py @@ -27,7 +27,7 @@ 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-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 = _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\"2\n\x10\x44\x65\x63laredLocation\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x10\n\x08location\x18\x02 \x01(\t\"1\n\x0f\x43uratedLocation\x12\x0f\n\x07\x63ountry\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\xed\x02\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\xd2\x01\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12^\n\x12\x64\x65\x63lared_locations\x18\x02 \x03(\x0b\x32..scanoss.api.geoprovenance.v2.DeclaredLocationR\x12\x64\x65\x63lared_locations\x12[\n\x11\x63urated_locations\x18\x03 \x03(\x0b\x32-.scanoss.api.geoprovenance.v2.CuratedLocationR\x11\x63urated_locations:\x02\x18\x01\"\xe2\x01\n\x15\x43omponentLocationInfo\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12^\n\x12\x64\x65\x63lared_locations\x18\x02 \x03(\x0b\x32..scanoss.api.geoprovenance.v2.DeclaredLocationR\x12\x64\x65\x63lared_locations\x12[\n\x11\x63urated_locations\x18\x03 \x03(\x0b\x32-.scanoss.api.geoprovenance.v2.CuratedLocationR\x11\x63urated_locations\"\xd5\x04\n\x1d\x43omponentsContributorResponse\x12g\n\x14\x63omponents_locations\x18\x01 \x03(\x0b\x32\x33.scanoss.api.geoprovenance.v2.ComponentLocationInfoR\x14\x63omponents_locations\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse:\x93\x03\x92\x41\x8f\x03\n\x8c\x03J\x89\x03{\"components_locations\":[{\"purl\":\"pkg:github/scanoss/engine@5.0.0\",\"declared_locations\":[{\"type\":\"owner\",\"location\":\"Barcelona, Spain\"},{\"type\":\"contributor\",\"location\":\"Berlin, Germany\"}],\"curated_locations\":[{\"country\":\"Spain\",\"count\":8},{\"country\":\"Germany\",\"count\":3},{\"country\":\"United States\",\"count\":2}]}],\"status\":{\"status\":\"SUCCESS\",\"message\":\"Geo-provenance successfully retrieved\"}}\"\xce\x04\n\x1c\x43omponentContributorResponse\x12\x65\n\x13\x63omponent_locations\x18\x01 \x01(\x0b\x32\x33.scanoss.api.geoprovenance.v2.ComponentLocationInfoR\x13\x63omponent_locations\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse:\x8f\x03\x92\x41\x8b\x03\n\x88\x03J\x85\x03{\"component_location\":{\"purl\":\"pkg:github/scanoss/engine@5.0.0\",\"declared_locations\":[{\"type\":\"owner\",\"location\":\"Barcelona, Spain\"},{\"type\":\"contributor\",\"location\":\"Berlin, Germany\"}],\"curated_locations\":[{\"country\":\"Spain\",\"count\":8},{\"country\":\"Germany\",\"count\":3},{\"country\":\"United States\",\"count\":2}]},\"status\":{\"status\":\"SUCCESS\",\"message\":\"Geo-provenance successfully retrieved\"}}\",\n\x08Location\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\npercentage\x18\x02 \x01(\x02\"\\\n\x11\x43omponentLocation\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x39\n\tlocations\x18\x02 \x03(\x0b\x32&.scanoss.api.geoprovenance.v2.Location\"\xe0\x01\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\x1aP\n\x05Purls\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x39\n\tlocations\x18\x02 \x03(\x0b\x32&.scanoss.api.geoprovenance.v2.Location:\x02\x18\x01\"\xcd\x03\n\x18\x43omponentsOriginResponse\x12\x63\n\x14\x63omponents_locations\x18\x01 \x03(\x0b\x32/.scanoss.api.geoprovenance.v2.ComponentLocationR\x14\x63omponents_locations\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse:\x94\x02\x92\x41\x90\x02\n\x8d\x02J\x8a\x02{\"components_locations\":[{\"purl\":\"pkg:github/scanoss/engine@5.0.0\",\"locations\":[{\"name\":\"ES\",\"percentage\":65.5},{\"name\":\"DE\",\"percentage\":20.3},{\"name\":\"US\",\"percentage\":14.2}]}],\"status\":{\"status\":\"SUCCESS\",\"message\":\"Geo-provenance origin successfully retrieved\"}}\"\xc8\x03\n\x17\x43omponentOriginResponse\x12\x61\n\x13\x63omponent_locations\x18\x01 \x01(\x0b\x32/.scanoss.api.geoprovenance.v2.ComponentLocationR\x13\x63omponent_locations\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse:\x92\x02\x92\x41\x8e\x02\n\x8b\x02J\x88\x02{\"component_locations\": {\"purl\":\"pkg:github/scanoss/engine@5.0.0\",\"locations\":[{\"name\":\"ES\",\"percentage\":65.5},{\"name\":\"DE\",\"percentage\":20.3},{\"name\":\"US\",\"percentage\":14.2}]},\"status\":{\"status\":\"SUCCESS\",\"message\":\"Geo-provenance origin successfully retrieved\"}}2\xff\x08\n\rGeoProvenance\x12r\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"!\x82\xd3\xe4\x93\x02\x1b\"\x16/v2/geoprovenance/echo:\x01*\x12\x9c\x01\n\x18GetComponentContributors\x12\".scanoss.api.common.v2.PurlRequest\x1a\x31.scanoss.api.geoprovenance.v2.ContributorResponse\")\x88\x02\x01\x82\xd3\xe4\x93\x02 \"\x1b/v2/geoprovenance/countries:\x01*\x12\xbe\x01\n\"GetCountryContributorsByComponents\x12(.scanoss.api.common.v2.ComponentsRequest\x1a;.scanoss.api.geoprovenance.v2.ComponentsContributorResponse\"1\x82\xd3\xe4\x93\x02+\"&/v2/geoprovenance/countries/components:\x01*\x12\xb7\x01\n!GetCountryContributorsByComponent\x12\'.scanoss.api.common.v2.ComponentRequest\x1a:.scanoss.api.geoprovenance.v2.ComponentContributorResponse\"-\x82\xd3\xe4\x93\x02\'\x12%/v2/geoprovenance/countries/component\x12\x8e\x01\n\x12GetComponentOrigin\x12\".scanoss.api.common.v2.PurlRequest\x1a,.scanoss.api.geoprovenance.v2.OriginResponse\"&\x88\x02\x01\x82\xd3\xe4\x93\x02\x1d\"\x18/v2/geoprovenance/origin:\x01*\x12\xa9\x01\n\x15GetOriginByComponents\x12(.scanoss.api.common.v2.ComponentsRequest\x1a\x36.scanoss.api.geoprovenance.v2.ComponentsOriginResponse\".\x82\xd3\xe4\x93\x02(\"#/v2/geoprovenance/origin/components:\x01*\x12\xa2\x01\n\x14GetOriginByComponent\x12\'.scanoss.api.common.v2.ComponentRequest\x1a\x35.scanoss.api.geoprovenance.v2.ComponentOriginResponse\"*\x82\xd3\xe4\x93\x02$\x12\"/v2/geoprovenance/origin/componentB\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') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -35,26 +35,58 @@ 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['_CONTRIBUTORRESPONSE']._loaded_options = None + _globals['_CONTRIBUTORRESPONSE']._serialized_options = b'\030\001' + _globals['_COMPONENTSCONTRIBUTORRESPONSE']._loaded_options = None + _globals['_COMPONENTSCONTRIBUTORRESPONSE']._serialized_options = b'\222A\217\003\n\214\003J\211\003{\"components_locations\":[{\"purl\":\"pkg:github/scanoss/engine@5.0.0\",\"declared_locations\":[{\"type\":\"owner\",\"location\":\"Barcelona, Spain\"},{\"type\":\"contributor\",\"location\":\"Berlin, Germany\"}],\"curated_locations\":[{\"country\":\"Spain\",\"count\":8},{\"country\":\"Germany\",\"count\":3},{\"country\":\"United States\",\"count\":2}]}],\"status\":{\"status\":\"SUCCESS\",\"message\":\"Geo-provenance successfully retrieved\"}}' + _globals['_COMPONENTCONTRIBUTORRESPONSE']._loaded_options = None + _globals['_COMPONENTCONTRIBUTORRESPONSE']._serialized_options = b'\222A\213\003\n\210\003J\205\003{\"component_location\":{\"purl\":\"pkg:github/scanoss/engine@5.0.0\",\"declared_locations\":[{\"type\":\"owner\",\"location\":\"Barcelona, Spain\"},{\"type\":\"contributor\",\"location\":\"Berlin, Germany\"}],\"curated_locations\":[{\"country\":\"Spain\",\"count\":8},{\"country\":\"Germany\",\"count\":3},{\"country\":\"United States\",\"count\":2}]},\"status\":{\"status\":\"SUCCESS\",\"message\":\"Geo-provenance successfully retrieved\"}}' + _globals['_ORIGINRESPONSE']._loaded_options = None + _globals['_ORIGINRESPONSE']._serialized_options = b'\030\001' + _globals['_COMPONENTSORIGINRESPONSE']._loaded_options = None + _globals['_COMPONENTSORIGINRESPONSE']._serialized_options = b'\222A\220\002\n\215\002J\212\002{\"components_locations\":[{\"purl\":\"pkg:github/scanoss/engine@5.0.0\",\"locations\":[{\"name\":\"ES\",\"percentage\":65.5},{\"name\":\"DE\",\"percentage\":20.3},{\"name\":\"US\",\"percentage\":14.2}]}],\"status\":{\"status\":\"SUCCESS\",\"message\":\"Geo-provenance origin successfully retrieved\"}}' + _globals['_COMPONENTORIGINRESPONSE']._loaded_options = None + _globals['_COMPONENTORIGINRESPONSE']._serialized_options = b'\222A\216\002\n\213\002J\210\002{\"component_locations\": {\"purl\":\"pkg:github/scanoss/engine@5.0.0\",\"locations\":[{\"name\":\"ES\",\"percentage\":65.5},{\"name\":\"DE\",\"percentage\":20.3},{\"name\":\"US\",\"percentage\":14.2}]},\"status\":{\"status\":\"SUCCESS\",\"message\":\"Geo-provenance origin successfully retrieved\"}}' _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['Echo']._serialized_options = b'\202\323\344\223\002\033\"\026/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['GetComponentContributors']._serialized_options = b'\210\002\001\202\323\344\223\002 \"\033/v2/geoprovenance/countries:\001*' + _globals['_GEOPROVENANCE'].methods_by_name['GetCountryContributorsByComponents']._loaded_options = None + _globals['_GEOPROVENANCE'].methods_by_name['GetCountryContributorsByComponents']._serialized_options = b'\202\323\344\223\002+\"&/v2/geoprovenance/countries/components:\001*' + _globals['_GEOPROVENANCE'].methods_by_name['GetCountryContributorsByComponent']._loaded_options = None + _globals['_GEOPROVENANCE'].methods_by_name['GetCountryContributorsByComponent']._serialized_options = b'\202\323\344\223\002\'\022%/v2/geoprovenance/countries/component' _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['_GEOPROVENANCE'].methods_by_name['GetComponentOrigin']._serialized_options = b'\210\002\001\202\323\344\223\002\035\"\030/v2/geoprovenance/origin:\001*' + _globals['_GEOPROVENANCE'].methods_by_name['GetOriginByComponents']._loaded_options = None + _globals['_GEOPROVENANCE'].methods_by_name['GetOriginByComponents']._serialized_options = b'\202\323\344\223\002(\"#/v2/geoprovenance/origin/components:\001*' + _globals['_GEOPROVENANCE'].methods_by_name['GetOriginByComponent']._loaded_options = None + _globals['_GEOPROVENANCE'].methods_by_name['GetOriginByComponent']._serialized_options = b'\202\323\344\223\002$\022\"/v2/geoprovenance/origin/component' + _globals['_DECLAREDLOCATION']._serialized_start=212 + _globals['_DECLAREDLOCATION']._serialized_end=262 + _globals['_CURATEDLOCATION']._serialized_start=264 + _globals['_CURATEDLOCATION']._serialized_end=313 + _globals['_CONTRIBUTORRESPONSE']._serialized_start=316 + _globals['_CONTRIBUTORRESPONSE']._serialized_end=681 _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 + _globals['_CONTRIBUTORRESPONSE_PURLS']._serialized_end=677 + _globals['_COMPONENTLOCATIONINFO']._serialized_start=684 + _globals['_COMPONENTLOCATIONINFO']._serialized_end=910 + _globals['_COMPONENTSCONTRIBUTORRESPONSE']._serialized_start=913 + _globals['_COMPONENTSCONTRIBUTORRESPONSE']._serialized_end=1510 + _globals['_COMPONENTCONTRIBUTORRESPONSE']._serialized_start=1513 + _globals['_COMPONENTCONTRIBUTORRESPONSE']._serialized_end=2103 + _globals['_LOCATION']._serialized_start=2105 + _globals['_LOCATION']._serialized_end=2149 + _globals['_COMPONENTLOCATION']._serialized_start=2151 + _globals['_COMPONENTLOCATION']._serialized_end=2243 + _globals['_ORIGINRESPONSE']._serialized_start=2246 + _globals['_ORIGINRESPONSE']._serialized_end=2470 + _globals['_ORIGINRESPONSE_PURLS']._serialized_start=2386 + _globals['_ORIGINRESPONSE_PURLS']._serialized_end=2466 + _globals['_COMPONENTSORIGINRESPONSE']._serialized_start=2473 + _globals['_COMPONENTSORIGINRESPONSE']._serialized_end=2934 + _globals['_COMPONENTORIGINRESPONSE']._serialized_start=2937 + _globals['_COMPONENTORIGINRESPONSE']._serialized_end=3393 + _globals['_GEOPROVENANCE']._serialized_start=3396 + _globals['_GEOPROVENANCE']._serialized_end=4547 # @@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 d669a5e..5ab07c9 100644 --- a/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2_grpc.py +++ b/src/scanoss/api/geoprovenance/v2/scanoss_geoprovenance_pb2_grpc.py @@ -47,11 +47,31 @@ def __init__(self, channel): 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.GetCountryContributorsByComponents = channel.unary_unary( + '/scanoss.api.geoprovenance.v2.GeoProvenance/GetCountryContributorsByComponents', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ComponentsContributorResponse.FromString, + _registered_method=True) + self.GetCountryContributorsByComponent = channel.unary_unary( + '/scanoss.api.geoprovenance.v2.GeoProvenance/GetCountryContributorsByComponent', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ComponentContributorResponse.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) + self.GetOriginByComponents = channel.unary_unary( + '/scanoss.api.geoprovenance.v2.GeoProvenance/GetOriginByComponents', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ComponentsOriginResponse.FromString, + _registered_method=True) + self.GetOriginByComponent = channel.unary_unary( + '/scanoss.api.geoprovenance.v2.GeoProvenance/GetOriginByComponent', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ComponentOriginResponse.FromString, + _registered_method=True) class GeoProvenanceServicer(object): @@ -60,21 +80,61 @@ class GeoProvenanceServicer(object): """ def Echo(self, request, context): - """Standard echo + """Standard health check endpoint to verify service availability and connectivity """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetComponentContributors(self, request, context): + """[DEPRECATED] Get component-level Geo Provenance based on contributor declared location + This method accepts PURL-based requests and is deprecated in favor of GetCountryContributorsByComponent + which accepts ComponentRequest for better component identification + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetCountryContributorsByComponents(self, request, context): + """Get component-level Geo Provenance based on contributor declared location + This is the current method that accepts ComponentsRequest for enhanced component identification + Replaces the deprecated GetComponentContributors method + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetCountryContributorsByComponent(self, request, context): """Get component-level Geo Provenance based on contributor declared location + This is the current method that accepts ComponentRequest for enhanced component identification + Replaces the deprecated GetComponentContributors method """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetComponentOrigin(self, request, context): + """[DEPRECATED] Get component-level Geo Provenance based on contributor origin commit times + This method accepts PURL-based requests and is deprecated in favor of GetOriginByComponent + which accepts ComponentRequest for better component identification + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetOriginByComponents(self, request, context): """Get component-level Geo Provenance based on contributor origin commit times + This is the current method that accepts ComponentsRequest for enhanced component identification + Replaces the deprecated GetComponentOrigin method + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetOriginByComponent(self, request, context): + """Get component-level Geo Provenance based on contributor origin commit times + This is the current method that accepts ComponentRequest for enhanced component identification + Replaces the deprecated GetComponentOrigin method """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -93,11 +153,31 @@ def add_GeoProvenanceServicer_to_server(servicer, server): request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.FromString, response_serializer=scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ContributorResponse.SerializeToString, ), + 'GetCountryContributorsByComponents': grpc.unary_unary_rpc_method_handler( + servicer.GetCountryContributorsByComponents, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.FromString, + response_serializer=scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ComponentsContributorResponse.SerializeToString, + ), + 'GetCountryContributorsByComponent': grpc.unary_unary_rpc_method_handler( + servicer.GetCountryContributorsByComponent, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.FromString, + response_serializer=scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ComponentContributorResponse.SerializeToString, + ), 'GetComponentOrigin': grpc.unary_unary_rpc_method_handler( servicer.GetComponentOrigin, request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.FromString, response_serializer=scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.OriginResponse.SerializeToString, ), + 'GetOriginByComponents': grpc.unary_unary_rpc_method_handler( + servicer.GetOriginByComponents, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.FromString, + response_serializer=scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ComponentsOriginResponse.SerializeToString, + ), + 'GetOriginByComponent': grpc.unary_unary_rpc_method_handler( + servicer.GetOriginByComponent, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.FromString, + response_serializer=scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ComponentOriginResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'scanoss.api.geoprovenance.v2.GeoProvenance', rpc_method_handlers) @@ -165,6 +245,60 @@ def GetComponentContributors(request, metadata, _registered_method=True) + @staticmethod + def GetCountryContributorsByComponents(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.geoprovenance.v2.GeoProvenance/GetCountryContributorsByComponents', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ComponentsContributorResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetCountryContributorsByComponent(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.geoprovenance.v2.GeoProvenance/GetCountryContributorsByComponent', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ComponentContributorResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetComponentOrigin(request, target, @@ -191,3 +325,57 @@ def GetComponentOrigin(request, timeout, metadata, _registered_method=True) + + @staticmethod + def GetOriginByComponents(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.geoprovenance.v2.GeoProvenance/GetOriginByComponents', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ComponentsOriginResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetOriginByComponent(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.geoprovenance.v2.GeoProvenance/GetOriginByComponent', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + scanoss_dot_api_dot_geoprovenance_dot_v2_dot_scanoss__geoprovenance__pb2.ComponentOriginResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/src/scanoss/api/licenses/v2/scanoss_licenses_pb2.py b/src/scanoss/api/licenses/v2/scanoss_licenses_pb2.py index 144f8d7..1476d0e 100644 --- a/src/scanoss/api/licenses/v2/scanoss_licenses_pb2.py +++ b/src/scanoss/api/licenses/v2/scanoss_licenses_pb2.py @@ -27,7 +27,7 @@ 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') +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\"\xe4\x05\n\x04SPDX\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1c\n\tfull_name\x18\x02 \x01(\tR\tfull_name\x12 \n\x0b\x64\x65tails_url\x18\x04 \x01(\tR\x0b\x64\x65tails_url\x12$\n\rreference_url\x18\x05 \x01(\tR\rreference_url\x12$\n\ris_deprecated\x18\x06 \x01(\x08R\ris_deprecated\x12\"\n\x0cis_fsf_libre\x18\x07 \x01(\x08R\x0cis_fsf_libre\x12(\n\x0fis_osi_approved\x18\x08 \x01(\x08R\x0fis_osi_approved\x12\x1a\n\x08see_also\x18\t \x03(\tR\x08see_also\x12J\n\ncross_refs\x18\n \x03(\x0b\x32*.scanoss.api.licenses.v2.SPDX.SPDXCrossRefR\ncross_refs\x12?\n\nexceptions\x18\x0b \x03(\x0b\x32+.scanoss.api.licenses.v2.SPDX.SPDXException\x1a\xac\x01\n\x0cSPDXCrossRef\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x1a\n\x08is_valid\x18\x02 \x01(\x08R\x08is_valid\x12\x18\n\x07is_live\x18\x03 \x01(\x08R\x07is_live\x12\x11\n\ttimestamp\x18\x04 \x01(\t\x12(\n\x0fis_wayback_link\x18\x05 \x01(\x08R\x0fis_wayback_link\x12\r\n\x05order\x18\x06 \x01(\x05\x12\r\n\x05match\x18\x07 \x01(\t\x1a\x9d\x01\n\rSPDXException\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1c\n\tfull_name\x18\x02 \x01(\tR\tfull_name\x12 \n\x0b\x64\x65tails_url\x18\x03 \x01(\tR\x0b\x64\x65tails_url\x12\x1a\n\x08see_also\x18\x05 \x03(\tR\x08see_also\x12$\n\ris_deprecated\x18\x06 \x01(\x08R\ris_deprecated\"\xfc\x02\n\x05OSADL\x12(\n\x0f\x63opyleft_clause\x18\x01 \x01(\x08R\x0f\x63opyleft_clause\x12\"\n\x0cpatent_hints\x18\x02 \x01(\x08R\x0cpatent_hints\x12\x15\n\rcompatibility\x18\x03 \x03(\t\x12\x38\n\x17\x64\x65pending_compatibility\x18\x04 \x03(\tR\x17\x64\x65pending_compatibility\x12\x17\n\x0fincompatibility\x18\x05 \x03(\t\x12I\n\tuse_cases\x18\x06 \x03(\x0b\x32+.scanoss.api.licenses.v2.OSADL.OSADLUseCaseR\tuse_cases\x1ap\n\x0cOSADLUseCase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12(\n\x0fobligation_text\x18\x02 \x01(\tR\x0fobligation_text\x12(\n\x0fobligation_json\x18\x03 \x01(\tR\x0fobligation_json\"\x86\x01\n\x0bLicenseInfo\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1c\n\tfull_name\x18\x02 \x01(\tR\tfull_name:M\x92\x41J\nHJF{\"id\": \"GPL-2.0\", \"full_name\": \"GNU General Public License v2.0 only\"}\"\xbe\x01\n\x0eLicenseDetails\x12\x1c\n\tfull_name\x18\x01 \x01(\tR\tfull_name\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\xbc\x05\n\x07License\x12m\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\"\x11/v2/licenses/echo:\x01*\x12\x92\x01\n\x14GetComponentLicenses\x12\'.scanoss.api.common.v2.ComponentRequest\x1a\x31.scanoss.api.licenses.v2.ComponentLicenseResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/v2/licenses/component\x12\x99\x01\n\x15GetComponentsLicenses\x12(.scanoss.api.common.v2.ComponentsRequest\x1a\x32.scanoss.api.licenses.v2.ComponentsLicenseResponse\"\"\x82\xd3\xe4\x93\x02\x1c\"\x17/v2/licenses/components:\x01*\x12\x84\x01\n\nGetDetails\x12\'.scanoss.api.licenses.v2.LicenseRequest\x1a/.scanoss.api.licenses.v2.LicenseDetailsResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\x12\x14/v2/licenses/details\x12\x89\x01\n\x0eGetObligations\x12\'.scanoss.api.licenses.v2.LicenseRequest\x1a,.scanoss.api.licenses.v2.ObligationsResponse\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/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) @@ -42,17 +42,17 @@ _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['Echo']._serialized_options = b'\202\323\344\223\002\026\"\021/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['GetComponentLicenses']._serialized_options = b'\202\323\344\223\002\030\022\026/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['GetComponentsLicenses']._serialized_options = b'\202\323\344\223\002\034\"\027/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['GetDetails']._serialized_options = b'\202\323\344\223\002\026\022\024/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['_LICENSE'].methods_by_name['GetObligations']._serialized_options = b'\202\323\344\223\002\032\022\030/v2/licenses/obligations' + _globals['_LICENSETYPE']._serialized_start=3175 + _globals['_LICENSETYPE']._serialized_end=3283 _globals['_COMPONENTLICENSERESPONSE']._serialized_start=198 _globals['_COMPONENTLICENSERESPONSE']._serialized_end=643 _globals['_COMPONENTSLICENSERESPONSE']._serialized_start=646 @@ -62,23 +62,23 @@ _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 + _globals['_SPDX']._serialized_end=2278 + _globals['_SPDX_SPDXCROSSREF']._serialized_start=1946 + _globals['_SPDX_SPDXCROSSREF']._serialized_end=2118 + _globals['_SPDX_SPDXEXCEPTION']._serialized_start=2121 + _globals['_SPDX_SPDXEXCEPTION']._serialized_end=2278 + _globals['_OSADL']._serialized_start=2281 + _globals['_OSADL']._serialized_end=2661 + _globals['_OSADL_OSADLUSECASE']._serialized_start=2549 + _globals['_OSADL_OSADLUSECASE']._serialized_end=2661 + _globals['_LICENSEINFO']._serialized_start=2664 + _globals['_LICENSEINFO']._serialized_end=2798 + _globals['_LICENSEDETAILS']._serialized_start=2801 + _globals['_LICENSEDETAILS']._serialized_end=2991 + _globals['_LICENSEREQUEST']._serialized_start=2993 + _globals['_LICENSEREQUEST']._serialized_end=3021 + _globals['_COMPONENTLICENSEINFO']._serialized_start=3024 + _globals['_COMPONENTLICENSEINFO']._serialized_end=3173 + _globals['_LICENSE']._serialized_start=3286 + _globals['_LICENSE']._serialized_end=3986 # @@protoc_insertion_point(module_scope) diff --git a/src/scanoss/api/scanning/v2/scanoss_scanning_pb2.py b/src/scanoss/api/scanning/v2/scanoss_scanning_pb2.py index 90ae284..6c61c03 100644 --- a/src/scanoss/api/scanning/v2/scanoss_scanning_pb2.py +++ b/src/scanoss/api/scanning/v2/scanoss_scanning_pb2.py @@ -27,7 +27,7 @@ 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-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') +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\"\xde\x04\n\nHFHRequest\x12:\n\x04root\x18\x01 \x01(\x0b\x32,.scanoss.api.scanning.v2.HFHRequest.Children\x12&\n\x0erank_threshold\x18\x02 \x01(\x05R\x0erank_threshold\x12\x10\n\x08\x63\x61tegory\x18\x03 \x01(\t\x12\x13\n\x0bquery_limit\x18\x04 \x01(\x05\x12\x1b\n\x13recursive_threshold\x18\x05 \x01(\x02\x12\x1a\n\x12min_accepted_score\x18\x06 \x01(\x02\x1a\x8b\x03\n\x08\x43hildren\x12\x18\n\x07path_id\x18\x01 \x01(\tR\x07path_id\x12&\n\x0esim_hash_names\x18\x02 \x01(\tR\x0esim_hash_names\x12*\n\x10sim_hash_content\x18\x03 \x01(\tR\x10sim_hash_content\x12>\n\x08\x63hildren\x18\x04 \x03(\x0b\x32,.scanoss.api.scanning.v2.HFHRequest.Children\x12.\n\x12sim_hash_dir_names\x18\x05 \x01(\tR\x12sim_hash_dir_names\x12j\n\x0flang_extensions\x18\x06 \x03(\x0b\x32@.scanoss.api.scanning.v2.HFHRequest.Children.LangExtensionsEntryR\x0flang_extensions\x1a\x35\n\x13LangExtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"\xac\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\x66\n\x06Result\x12\x18\n\x07path_id\x18\x01 \x01(\tR\x07path_id\x12\x42\n\ncomponents\x18\x02 \x03(\x0b\x32..scanoss.api.scanning.v2.HFHResponse.Component2\xf8\x01\n\x08Scanning\x12m\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\"\x11/v2/scanning/echo:\x01*\x12}\n\x0e\x46olderHashScan\x12#.scanoss.api.scanning.v2.HFHRequest\x1a$.scanoss.api.scanning.v2.HFHResponse\" \x82\xd3\xe4\x93\x02\x1a\"\x15/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) @@ -38,23 +38,23 @@ _globals['_HFHREQUEST_CHILDREN_LANGEXTENSIONSENTRY']._loaded_options = None _globals['_HFHREQUEST_CHILDREN_LANGEXTENSIONSENTRY']._serialized_options = b'8\001' _globals['_SCANNING'].methods_by_name['Echo']._loaded_options = None - _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['Echo']._serialized_options = b'\202\323\344\223\002\026\"\021/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['_SCANNING'].methods_by_name['FolderHashScan']._serialized_options = b'\202\323\344\223\002\032\"\025/v2/scanning/hfh/scan:\001*' _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 + _globals['_HFHREQUEST']._serialized_end=804 + _globals['_HFHREQUEST_CHILDREN']._serialized_start=409 + _globals['_HFHREQUEST_CHILDREN']._serialized_end=804 + _globals['_HFHREQUEST_CHILDREN_LANGEXTENSIONSENTRY']._serialized_start=751 + _globals['_HFHREQUEST_CHILDREN_LANGEXTENSIONSENTRY']._serialized_end=804 + _globals['_HFHRESPONSE']._serialized_start=807 + _globals['_HFHRESPONSE']._serialized_end=1235 + _globals['_HFHRESPONSE_VERSION']._serialized_start=939 + _globals['_HFHRESPONSE_VERSION']._serialized_end=980 + _globals['_HFHRESPONSE_COMPONENT']._serialized_start=983 + _globals['_HFHRESPONSE_COMPONENT']._serialized_end=1131 + _globals['_HFHRESPONSE_RESULT']._serialized_start=1133 + _globals['_HFHRESPONSE_RESULT']._serialized_end=1235 + _globals['_SCANNING']._serialized_start=1238 + _globals['_SCANNING']._serialized_end=1486 # @@protoc_insertion_point(module_scope) diff --git a/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2.py b/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2.py index 195d438..af4a519 100644 --- a/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2.py +++ b/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2.py @@ -27,7 +27,7 @@ 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-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 = _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\"C\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\"T\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\x1d.scanoss.api.semgrep.v2.Issue\"\xdf\x01\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\x1aS\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\x1c.scanoss.api.semgrep.v2.File:\x02\x18\x01\"u\n\x12\x43omponentIssueInfo\x12\x0c\n\x04purl\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x13\n\x0brequirement\x18\x03 \x01(\t\x12+\n\x05\x66iles\x18\x04 \x03(\x0b\x32\x1c.scanoss.api.semgrep.v2.File\"\xe6\x06\n\x17\x43omponentsIssueResponse\x12>\n\ncomponents\x18\x01 \x03(\x0b\x32*.scanoss.api.semgrep.v2.ComponentIssueInfo\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse:\xd3\x05\x92\x41\xcf\x05\n\xcc\x05J\xc9\x05{\"components\":[{\"purl\":\"pkg:maven/org.apache.commons/commons-lang3\",\"version\":\"3.12.0\",\"requirement\":\"3.12.0\",\"files\":[{\"fileMD5\":\"a1b2c3d4e5f6\",\"path\":\"src/main/java/org/apache/commons/lang3/StringUtils.java\",\"issues\":[{\"ruleID\":\"java.lang.security.audit.crypto.weak-hash\",\"from\":\"156\",\"to\":\"159\",\"severity\":\"WARNING\"},{\"ruleID\":\"java.lang.security.audit.sql-injection.sql-injection\",\"from\":\"284\",\"to\":\"286\",\"severity\":\"ERROR\"}]},{\"fileMD5\":\"b2c3d4e5f6a1\",\"path\":\"src/main/java/org/apache/commons/lang3/Validate.java\",\"issues\":[{\"ruleID\":\"java.lang.security.audit.hardcoded-secret\",\"from\":\"95\",\"to\":\"95\",\"severity\":\"ERROR\"}]}]}],\"status\":{\"status\":\"SUCCESS\",\"message\":\"Security analysis completed successfully\"}}\"\xb9\x04\n\x16\x43omponentIssueResponse\x12=\n\tcomponent\x18\x01 \x01(\x0b\x32*.scanoss.api.semgrep.v2.ComponentIssueInfo\x12\x35\n\x06status\x18\x02 \x01(\x0b\x32%.scanoss.api.common.v2.StatusResponse:\xa8\x03\x92\x41\xa4\x03\n\xa1\x03J\x9e\x03{\"component\":{\"purl\":\"pkg:maven/org.apache.commons/commons-lang3\",\"version\":\"3.12.0\",\"requirement\":\"3.12.0\",\"files\":[{\"fileMD5\":\"a1b2c3d4e5f6\",\"path\":\"src/main/java/org/apache/commons/lang3/StringUtils.java\",\"issues\":[{\"ruleID\":\"java.lang.security.audit.sql-injection.sql-injection\",\"from\":\"284\",\"to\":\"286\",\"severity\":\"ERROR\"}]}]},\"status\":{\"status\":\"SUCCESS\",\"message\":\"Security analysis completed successfully\"}}2\x89\x04\n\x07Semgrep\x12l\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\"\x10/v2/semgrep/echo:\x01*\x12]\n\tGetIssues\x12\".scanoss.api.common.v2.PurlRequest\x1a\'.scanoss.api.semgrep.v2.SemgrepResponse\"\x03\x88\x02\x01\x12\x9a\x01\n\x13GetComponentsIssues\x12(.scanoss.api.common.v2.ComponentsRequest\x1a/.scanoss.api.semgrep.v2.ComponentsIssueResponse\"(\x82\xd3\xe4\x93\x02\"\"\x1d/v2/semgrep/issues/components:\x01*\x12\x93\x01\n\x12GetComponentIssues\x12\'.scanoss.api.common.v2.ComponentRequest\x1a..scanoss.api.semgrep.v2.ComponentIssueResponse\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v2/semgrep/issues/componentB\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') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -35,18 +35,34 @@ 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['_SEMGREPRESPONSE']._loaded_options = None + _globals['_SEMGREPRESPONSE']._serialized_options = b'\030\001' + _globals['_COMPONENTSISSUERESPONSE']._loaded_options = None + _globals['_COMPONENTSISSUERESPONSE']._serialized_options = b'\222A\317\005\n\314\005J\311\005{\"components\":[{\"purl\":\"pkg:maven/org.apache.commons/commons-lang3\",\"version\":\"3.12.0\",\"requirement\":\"3.12.0\",\"files\":[{\"fileMD5\":\"a1b2c3d4e5f6\",\"path\":\"src/main/java/org/apache/commons/lang3/StringUtils.java\",\"issues\":[{\"ruleID\":\"java.lang.security.audit.crypto.weak-hash\",\"from\":\"156\",\"to\":\"159\",\"severity\":\"WARNING\"},{\"ruleID\":\"java.lang.security.audit.sql-injection.sql-injection\",\"from\":\"284\",\"to\":\"286\",\"severity\":\"ERROR\"}]},{\"fileMD5\":\"b2c3d4e5f6a1\",\"path\":\"src/main/java/org/apache/commons/lang3/Validate.java\",\"issues\":[{\"ruleID\":\"java.lang.security.audit.hardcoded-secret\",\"from\":\"95\",\"to\":\"95\",\"severity\":\"ERROR\"}]}]}],\"status\":{\"status\":\"SUCCESS\",\"message\":\"Security analysis completed successfully\"}}' + _globals['_COMPONENTISSUERESPONSE']._loaded_options = None + _globals['_COMPONENTISSUERESPONSE']._serialized_options = b'\222A\244\003\n\241\003J\236\003{\"component\":{\"purl\":\"pkg:maven/org.apache.commons/commons-lang3\",\"version\":\"3.12.0\",\"requirement\":\"3.12.0\",\"files\":[{\"fileMD5\":\"a1b2c3d4e5f6\",\"path\":\"src/main/java/org/apache/commons/lang3/StringUtils.java\",\"issues\":[{\"ruleID\":\"java.lang.security.audit.sql-injection.sql-injection\",\"from\":\"284\",\"to\":\"286\",\"severity\":\"ERROR\"}]}]},\"status\":{\"status\":\"SUCCESS\",\"message\":\"Security analysis completed successfully\"}}' _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['Echo']._serialized_options = b'\202\323\344\223\002\025\"\020/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 + _globals['_SEMGREP'].methods_by_name['GetIssues']._serialized_options = b'\210\002\001' + _globals['_SEMGREP'].methods_by_name['GetComponentsIssues']._loaded_options = None + _globals['_SEMGREP'].methods_by_name['GetComponentsIssues']._serialized_options = b'\202\323\344\223\002\"\"\035/v2/semgrep/issues/components:\001*' + _globals['_SEMGREP'].methods_by_name['GetComponentIssues']._loaded_options = None + _globals['_SEMGREP'].methods_by_name['GetComponentIssues']._serialized_options = b'\202\323\344\223\002\036\022\034/v2/semgrep/issues/component' + _globals['_ISSUE']._serialized_start=194 + _globals['_ISSUE']._serialized_end=261 + _globals['_FILE']._serialized_start=263 + _globals['_FILE']._serialized_end=347 + _globals['_SEMGREPRESPONSE']._serialized_start=350 + _globals['_SEMGREPRESPONSE']._serialized_end=573 + _globals['_SEMGREPRESPONSE_PURLS']._serialized_start=486 + _globals['_SEMGREPRESPONSE_PURLS']._serialized_end=569 + _globals['_COMPONENTISSUEINFO']._serialized_start=575 + _globals['_COMPONENTISSUEINFO']._serialized_end=692 + _globals['_COMPONENTSISSUERESPONSE']._serialized_start=695 + _globals['_COMPONENTSISSUERESPONSE']._serialized_end=1565 + _globals['_COMPONENTISSUERESPONSE']._serialized_start=1568 + _globals['_COMPONENTISSUERESPONSE']._serialized_end=2137 + _globals['_SEMGREP']._serialized_start=2140 + _globals['_SEMGREP']._serialized_end=2661 # @@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 fdda310..2b7e6c1 100644 --- a/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2_grpc.py +++ b/src/scanoss/api/semgrep/v2/scanoss_semgrep_pb2_grpc.py @@ -27,8 +27,8 @@ class SemgrepStub(object): - """ - Expose all of the SCANOSS Cryptography RPCs here + """* + Expose all of the SCANOSS Semgrep Security Analysis RPCs here """ def __init__(self, channel): @@ -47,22 +47,52 @@ def __init__(self, channel): 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) + self.GetComponentsIssues = channel.unary_unary( + '/scanoss.api.semgrep.v2.Semgrep/GetComponentsIssues', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_semgrep_dot_v2_dot_scanoss__semgrep__pb2.ComponentsIssueResponse.FromString, + _registered_method=True) + self.GetComponentIssues = channel.unary_unary( + '/scanoss.api.semgrep.v2.Semgrep/GetComponentIssues', + request_serializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + response_deserializer=scanoss_dot_api_dot_semgrep_dot_v2_dot_scanoss__semgrep__pb2.ComponentIssueResponse.FromString, + _registered_method=True) class SemgrepServicer(object): - """ - Expose all of the SCANOSS Cryptography RPCs here + """* + Expose all of the SCANOSS Semgrep Security Analysis RPCs here """ def Echo(self, request, context): - """Standard echo + """Standard health check endpoint to verify service availability and connectivity """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetIssues(self, request, context): - """Get Potential issues associated with a list of PURLs + """[DEPRECATED] Get potential security issues associated with a list of PURLs + This method accepts PURL-based requests and is deprecated in favor of GetComponentsIssues + which accepts ComponentsRequest for better component identification + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentsIssues(self, request, context): + """Get potential security issues associated with multiple components + This is the current method that accepts ComponentsRequest for enhanced component identification + Replaces the deprecated GetIssues method + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComponentIssues(self, request, context): + """Get potential security issues associated with a single component + This is the current method that accepts ComponentRequest for enhanced component identification + Replaces the deprecated GetIssues method for single component queries """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -81,6 +111,16 @@ def add_SemgrepServicer_to_server(servicer, server): request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.PurlRequest.FromString, response_serializer=scanoss_dot_api_dot_semgrep_dot_v2_dot_scanoss__semgrep__pb2.SemgrepResponse.SerializeToString, ), + 'GetComponentsIssues': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentsIssues, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.FromString, + response_serializer=scanoss_dot_api_dot_semgrep_dot_v2_dot_scanoss__semgrep__pb2.ComponentsIssueResponse.SerializeToString, + ), + 'GetComponentIssues': grpc.unary_unary_rpc_method_handler( + servicer.GetComponentIssues, + request_deserializer=scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.FromString, + response_serializer=scanoss_dot_api_dot_semgrep_dot_v2_dot_scanoss__semgrep__pb2.ComponentIssueResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'scanoss.api.semgrep.v2.Semgrep', rpc_method_handlers) @@ -90,8 +130,8 @@ def add_SemgrepServicer_to_server(servicer, server): # This class is part of an EXPERIMENTAL API. class Semgrep(object): - """ - Expose all of the SCANOSS Cryptography RPCs here + """* + Expose all of the SCANOSS Semgrep Security Analysis RPCs here """ @staticmethod @@ -147,3 +187,57 @@ def GetIssues(request, timeout, metadata, _registered_method=True) + + @staticmethod + def GetComponentsIssues(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.semgrep.v2.Semgrep/GetComponentsIssues', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentsRequest.SerializeToString, + scanoss_dot_api_dot_semgrep_dot_v2_dot_scanoss__semgrep__pb2.ComponentsIssueResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetComponentIssues(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.semgrep.v2.Semgrep/GetComponentIssues', + scanoss_dot_api_dot_common_dot_v2_dot_scanoss__common__pb2.ComponentRequest.SerializeToString, + scanoss_dot_api_dot_semgrep_dot_v2_dot_scanoss__semgrep__pb2.ComponentIssueResponse.FromString, + 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 7608af1..4a1fc7d 100644 --- a/src/scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2.py +++ b/src/scanoss/api/vulnerabilities/v2/scanoss_vulnerabilities_pb2.py @@ -27,7 +27,7 @@ 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 = _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\xb3\x08\n\x0fVulnerabilities\x12t\n\x04\x45\x63ho\x12\".scanoss.api.common.v2.EchoRequest\x1a#.scanoss.api.common.v2.EchoResponse\"#\x82\xd3\xe4\x93\x02\x1d\"\x18/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\x9e\x01\n\x10GetComponentCpes\x12\'.scanoss.api.common.v2.ComponentRequest\x1a\x35.scanoss.api.vulnerabilities.v2.ComponentCpesResponse\"*\x82\xd3\xe4\x93\x02$\x12\"/v2/vulnerabilities/cpes/component\x12\xa5\x01\n\x11GetComponentsCpes\x12(.scanoss.api.common.v2.ComponentsRequest\x1a\x36.scanoss.api.vulnerabilities.v2.ComponentsCpesResponse\".\x82\xd3\xe4\x93\x02(\"#/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\xad\x01\n\x1bGetComponentVulnerabilities\x12\'.scanoss.api.common.v2.ComponentRequest\x1a>.scanoss.api.vulnerabilities.v2.ComponentVulnerabilityResponse\"%\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v2/vulnerabilities/component\x12\xb4\x01\n\x1cGetComponentsVulnerabilities\x12(.scanoss.api.common.v2.ComponentsRequest\x1a?.scanoss.api.vulnerabilities.v2.ComponentsVulnerabilityResponse\")\x82\xd3\xe4\x93\x02#\"\x1e/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') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -50,19 +50,19 @@ _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['Echo']._serialized_options = b'\202\323\344\223\002\035\"\030/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['GetComponentCpes']._serialized_options = b'\202\323\344\223\002$\022\"/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['GetComponentsCpes']._serialized_options = b'\202\323\344\223\002(\"#/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['GetComponentVulnerabilities']._serialized_options = b'\202\323\344\223\002\037\022\035/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['_VULNERABILITIES'].methods_by_name['GetComponentsVulnerabilities']._serialized_options = b'\202\323\344\223\002#\"\036/v2/vulnerabilities/components:\001*' _globals['_VULNERABILITYREQUEST']._serialized_start=219 _globals['_VULNERABILITYREQUEST']._serialized_end=364 _globals['_VULNERABILITYREQUEST_PURLS']._serialized_start=318 @@ -78,19 +78,19 @@ _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 + _globals['_CVSS']._serialized_end=1673 + _globals['_VULNERABILITY']._serialized_start=1676 + _globals['_VULNERABILITY']._serialized_end=1869 + _globals['_VULNERABILITYRESPONSE']._serialized_start=1872 + _globals['_VULNERABILITYRESPONSE']._serialized_end=2125 + _globals['_VULNERABILITYRESPONSE_PURLS']._serialized_start=2028 + _globals['_VULNERABILITYRESPONSE_PURLS']._serialized_end=2121 + _globals['_COMPONENTVULNERABILITYINFO']._serialized_start=2128 + _globals['_COMPONENTVULNERABILITYINFO']._serialized_end=2280 + _globals['_COMPONENTVULNERABILITYRESPONSE']._serialized_start=2283 + _globals['_COMPONENTVULNERABILITYRESPONSE']._serialized_end=3022 + _globals['_COMPONENTSVULNERABILITYRESPONSE']._serialized_start=3025 + _globals['_COMPONENTSVULNERABILITYRESPONSE']._serialized_end=4238 + _globals['_VULNERABILITIES']._serialized_start=4241 + _globals['_VULNERABILITIES']._serialized_end=5316 # @@protoc_insertion_point(module_scope) diff --git a/src/scanoss/cli.py b/src/scanoss/cli.py index 97bed90..d524e70 100644 --- a/src/scanoss/cli.py +++ b/src/scanoss/cli.py @@ -310,7 +310,6 @@ def setup_args() -> None: # noqa: PLR0912, PLR0915 help='Retrieve vulnerabilities for the given components', ) c_vulns.set_defaults(func=comp_vulns) - c_vulns.add_argument('--grpc', action='store_true', help='Enable gRPC support') # Component Sub-command: component licenses c_licenses = comp_sub.add_parser( @@ -319,7 +318,6 @@ def setup_args() -> None: # noqa: PLR0912, PLR0915 description=f'Show License details: {__version__}', help='Retrieve licenses for the given components', ) - c_licenses.add_argument('--grpc', action='store_true', help='Enable gRPC support') c_licenses.set_defaults(func=comp_licenses) # Component Sub-command: component semgrep @@ -949,7 +947,6 @@ def setup_args() -> None: # noqa: PLR0912, PLR0915 p.add_argument( '--apiurl', type=str, help='SCANOSS API URL (optional - default: https://api.osskb.org/scan/direct)' ) - p.add_argument('--grpc', action='store_true', help='Enable gRPC support') # Global Scan/Fingerprint filter options for p in [p_scan, p_wfp]: @@ -1059,6 +1056,22 @@ def setup_args() -> None: # noqa: PLR0912, PLR0915 help='Timeout (in seconds) for syft to complete (optional - default 600)', ) + # gRPC support options + for p in [ + c_vulns, + p_scan, + p_cs, + p_crypto_algorithms, + p_crypto_hints, + p_crypto_versions_in_range, + c_semgrep, + c_provenance, + c_search, + c_versions, + c_licenses, + ]: + p.add_argument('--grpc', action='store_true', help='Enable gRPC support') + # Help/Trace command options for p in [ p_scan, @@ -2178,6 +2191,7 @@ def comp_semgrep(parser, args): pac=pac_file, timeout=args.timeout, req_headers=process_req_headers(args.header), + use_grpc=args.grpc, ) if not comps.get_semgrep_details(args.input, args.purl, args.output): sys.exit(1) @@ -2216,6 +2230,7 @@ def comp_search(parser, args): pac=pac_file, timeout=args.timeout, req_headers=process_req_headers(args.header), + use_grpc=args.grpc, ) if not comps.search_components( args.output, @@ -2261,6 +2276,7 @@ def comp_versions(parser, args): pac=pac_file, timeout=args.timeout, req_headers=process_req_headers(args.header), + use_grpc=args.grpc, ) if not comps.get_component_versions(args.output, json_file=args.input, purl=args.purl, limit=args.limit): sys.exit(1) @@ -2296,6 +2312,7 @@ def comp_provenance(parser, args): pac=pac_file, timeout=args.timeout, req_headers=process_req_headers(args.header), + use_grpc=args.grpc, ) if not comps.get_provenance_details(args.input, args.purl, args.output, args.origin): sys.exit(1) diff --git a/src/scanoss/components.py b/src/scanoss/components.py index 25224fb..6498c1a 100644 --- a/src/scanoss/components.py +++ b/src/scanoss/components.py @@ -77,6 +77,7 @@ def __init__( # noqa: PLR0913, PLR0915 """ super().__init__(debug, trace, quiet) ver_details = Scanner.version_details() + self.use_grpc = use_grpc self.grpc_api = ScanossGrpc( url=grpc_url, debug=debug, @@ -91,7 +92,6 @@ def __init__( # noqa: PLR0913, PLR0915 timeout=timeout, req_headers=req_headers, ignore_cert_errors=ignore_cert_errors, - use_grpc=use_grpc, ) self.cdx = CycloneDx(debug=self.debug) @@ -190,32 +190,6 @@ def _close_file(self, filename: str = None, file: TextIO = None) -> None: self.print_trace(f'Closing file: {filename}') file.close() - def get_crypto_details(self, json_file: str = None, purls: [] = None, output_file: str = None) -> bool: - """ - Retrieve the cryptographic details for the supplied PURLs - - :param json_file: PURL JSON request file (optional) - :param purls: PURL request array (optional) - :param output_file: output filename (optional). Default: STDOUT - :return: True on success, False otherwise - """ - success = False - purls_request = self.load_purls(json_file, purls) - if purls_request is None or len(purls_request) == 0: - return False - file = self._open_file_or_sdtout(output_file) - if file is None: - return False - self.print_msg('Sending PURLs to Crypto API for decoration...') - response = self.grpc_api.get_crypto_json(purls_request) - if response: - print(json.dumps(response, indent=2, sort_keys=True), file=file) - success = True - if output_file: - self.print_msg(f'Results written to: {output_file}') - self._close_file(output_file, file) - return success - def get_vulnerabilities(self, json_file: str = None, purls: [] = None, output_file: str = None) -> bool: """ Retrieve any vulnerabilities related to the given PURLs @@ -233,7 +207,7 @@ def get_vulnerabilities(self, json_file: str = None, purls: [] = None, output_fi if file is None: return False self.print_msg('Sending PURLs to Vulnerability API for decoration...') - response = self.grpc_api.get_vulnerabilities_json(purls_request) + response = self.grpc_api.get_vulnerabilities_json(purls_request, use_grpc=self.use_grpc) if response: print(json.dumps(response, indent=2, sort_keys=True), file=file) success = True @@ -252,14 +226,14 @@ def get_semgrep_details(self, json_file: str = None, purls: [] = None, output_fi :return: True on success, False otherwise """ success = False - purls_request = self.load_purls(json_file, purls) + purls_request = self.load_comps(json_file, purls) if purls_request is None or len(purls_request) == 0: return False file = self._open_file_or_sdtout(output_file) if file is None: return False self.print_msg('Sending PURLs to Semgrep API for decoration...') - response = self.grpc_api.get_semgrep_json(purls_request) + response = self.grpc_api.get_semgrep_json(purls_request, use_grpc=self.use_grpc) if response: print(json.dumps(response, indent=2, sort_keys=True), file=file) success = True @@ -309,7 +283,7 @@ def search_components( # noqa: PLR0913, PLR0915 if file is None: return False self.print_msg('Sending search data to Components API...') - response = self.grpc_api.search_components_json(request) + response = self.grpc_api.search_components_json(request, use_grpc=self.use_grpc) if response: print(json.dumps(response, indent=2, sort_keys=True), file=file) success = True @@ -345,7 +319,7 @@ def get_component_versions( if file is None: return False self.print_msg('Sending PURLs to Component Versions API...') - response = self.grpc_api.get_component_versions_json(request) + response = self.grpc_api.get_component_versions_json(request, use_grpc=self.use_grpc) if response: print(json.dumps(response, indent=2, sort_keys=True), file=file) success = True @@ -370,7 +344,7 @@ def get_provenance_details( bool: True on success, False otherwise """ success = False - purls_request = self.load_purls(json_file, purls) + purls_request = self.load_comps(json_file, purls) if purls_request is None or len(purls_request) == 0: return False file = self._open_file_or_sdtout(output_file) @@ -378,10 +352,10 @@ def get_provenance_details( return False if origin: self.print_msg('Sending PURLs to Geo Provenance Origin API for decoration...') - response = self.grpc_api.get_provenance_origin(purls_request) + response = self.grpc_api.get_provenance_origin(purls_request, use_grpc=self.use_grpc) else: self.print_msg('Sending PURLs to Geo Provenance Declared API for decoration...') - response = self.grpc_api.get_provenance_json(purls_request) + response = self.grpc_api.get_provenance_json(purls_request, use_grpc=self.use_grpc) if response: print(json.dumps(response, indent=2, sort_keys=True), file=file) success = True @@ -413,7 +387,7 @@ def get_licenses(self, json_file: str = None, purls: [] = None, output_file: str # We'll use the new ComponentBatchRequest instead of deprecated PurlRequest for the license api component_batch_request = {'components': purls_request.get('purls')} - response = self.grpc_api.get_licenses(component_batch_request) + response = self.grpc_api.get_licenses(component_batch_request, use_grpc=self.use_grpc) if response: print(json.dumps(response, indent=2, sort_keys=True), file=file) success = True diff --git a/src/scanoss/cryptography.py b/src/scanoss/cryptography.py index 7957609..5ab91fe 100644 --- a/src/scanoss/cryptography.py +++ b/src/scanoss/cryptography.py @@ -19,12 +19,13 @@ class ScanossCryptographyError(Exception): @dataclass class CryptographyConfig: purl: List[str] + debug: bool = False + header: Optional[str] = None input_file: Optional[str] = None output_file: Optional[str] = None - header: Optional[str] = None - debug: bool = False - trace: bool = False quiet: bool = False + trace: bool = False + use_grpc: bool = False with_range: bool = False def _process_input_file(self) -> dict: @@ -69,7 +70,7 @@ def __post_init__(self): parts = purl.split('@') if not (len(parts) >= MIN_SPLIT_PARTS and parts[1]): raise ScanossCryptographyError( - f'Invalid PURL format: "{purl}".' f'It must include a version (e.g., pkg:type/name@version)' + f'Invalid PURL format: "{purl}".It must include a version (e.g., pkg:type/name@version)' ) if self.input_file: purl_request = self._process_input_file() @@ -91,13 +92,14 @@ def __post_init__(self): def create_cryptography_config_from_args(args) -> CryptographyConfig: return CryptographyConfig( debug=getattr(args, 'debug', False), - trace=getattr(args, 'trace', False), - quiet=getattr(args, 'quiet', False), - with_range=getattr(args, 'with_range', False), - purl=getattr(args, 'purl', []), + header=getattr(args, 'header', None), input_file=getattr(args, 'input', None), output_file=getattr(args, 'output', None), - header=getattr(args, 'header', None), + purl=getattr(args, 'purl', []), + quiet=getattr(args, 'quiet', False), + trace=getattr(args, 'trace', False), + use_grpc=getattr(args, 'grpc', False), + with_range=getattr(args, 'with_range', False), ) @@ -134,7 +136,7 @@ def __init__( self.client = client self.config = config - self.purls_request = self._build_purls_request() + self.components_request = self._build_components_request() self.results = None def get_algorithms(self) -> Optional[Dict]: @@ -145,15 +147,16 @@ def get_algorithms(self) -> Optional[Dict]: Optional[Dict]: The folder hash response from the gRPC client, or None if an error occurs. """ - if not self.purls_request: + if not self.components_request or not self.components_request.get('components'): raise ScanossCryptographyError('No PURLs supplied. Provide --purl or --input.') - self.base.print_stderr( - f'Getting cryptographic algorithms for {", ".join([p["purl"] for p in self.purls_request["purls"]])}' - ) + components_str = ', '.join(p['purl'] for p in self.components_request['components']) + self.base.print_stderr(f'Getting cryptographic algorithms for {components_str}') if self.config.with_range: - response = self.client.get_crypto_algorithms_in_range_for_purl(self.purls_request) + response = self.client.get_crypto_algorithms_in_range_for_purl( + self.components_request, self.config.use_grpc + ) else: - response = self.client.get_crypto_algorithms_for_purl(self.purls_request) + response = self.client.get_crypto_algorithms_for_purl(self.components_request, self.config.use_grpc) if response: self.results = response @@ -167,17 +170,17 @@ def get_encryption_hints(self) -> Optional[Dict]: Optional[Dict]: The encryption hints response from the gRPC client, or None if an error occurs. """ - if not self.purls_request: + if not self.components_request or not self.components_request.get('components'): raise ScanossCryptographyError('No PURLs supplied. Provide --purl or --input.') self.base.print_stderr( f'Getting encryption hints ' f'{"in range" if self.config.with_range else ""} ' - f'for {", ".join([p["purl"] for p in self.purls_request["purls"]])}' + f'for {", ".join([p["purl"] for p in self.components_request["components"]])}' ) if self.config.with_range: - response = self.client.get_encryption_hints_in_range_for_purl(self.purls_request) + response = self.client.get_encryption_hints_in_range_for_purl(self.components_request, self.config.use_grpc) else: - response = self.client.get_encryption_hints_for_purl(self.purls_request) + response = self.client.get_encryption_hints_for_purl(self.components_request, self.config.use_grpc) if response: self.results = response @@ -191,20 +194,21 @@ def get_versions_in_range(self) -> Optional[Dict]: Optional[Dict]: The versions in range response from the gRPC client, or None if an error occurs. """ - if not self.purls_request: + if not self.components_request or not self.components_request.get('components'): raise ScanossCryptographyError('No PURLs supplied. Provide --purl or --input.') - self.base.print_stderr( - f'Getting versions in range for {", ".join([p["purl"] for p in self.purls_request["purls"]])}' - ) + components_str = ', '.join(p['purl'] for p in self.components_request['components']) + self.base.print_stderr(f'Getting versions in range for {components_str}') - response = self.client.get_versions_in_range_for_purl(self.purls_request) + response = self.client.get_versions_in_range_for_purl(self.components_request, self.config.use_grpc) if response: self.results = response return self.results - def _build_purls_request(self) -> Optional[dict]: + def _build_components_request( + self, + ) -> Optional[dict]: """ Load the specified purls from a JSON file or a list of PURLs and return a dictionary @@ -212,7 +216,7 @@ def _build_purls_request(self) -> Optional[dict]: Optional[dict]: The dictionary containing the PURLs """ return { - 'purls': [ + 'components': [ { 'purl': self._remove_version_from_purl(purl), 'requirement': self._extract_version_from_purl(purl), diff --git a/src/scanoss/scanossgrpc.py b/src/scanoss/scanossgrpc.py index deed00b..5cb7397 100644 --- a/src/scanoss/scanossgrpc.py +++ b/src/scanoss/scanossgrpc.py @@ -24,14 +24,13 @@ import concurrent.futures import http.client as http_client -import json import logging import os import sys import time import uuid from dataclasses import dataclass -from enum import IntEnum +from enum import Enum, IntEnum from typing import Dict, Optional from urllib.parse import urlparse @@ -44,7 +43,6 @@ from pypac.resolver import ProxyResolver from urllib3.exceptions import InsecureRequestWarning -from scanoss.api.licenses.v2.scanoss_licenses_pb2 import ComponentsLicenseResponse from scanoss.api.licenses.v2.scanoss_licenses_pb2_grpc import LicenseStub from scanoss.api.scanning.v2.scanoss_scanning_pb2_grpc import ScanningStub from scanoss.constants import DEFAULT_TIMEOUT @@ -53,29 +51,20 @@ from .api.common.v2.scanoss_common_pb2 import ( ComponentsRequest, EchoRequest, - EchoResponse, - PurlRequest, StatusCode, StatusResponse, ) from .api.components.v2.scanoss_components_pb2 import ( CompSearchRequest, - CompSearchResponse, CompVersionRequest, - CompVersionResponse, ) from .api.components.v2.scanoss_components_pb2_grpc import ComponentsStub from .api.cryptography.v2.scanoss_cryptography_pb2_grpc import CryptographyStub from .api.dependencies.v2.scanoss_dependencies_pb2 import DependencyRequest from .api.dependencies.v2.scanoss_dependencies_pb2_grpc import DependenciesStub -from .api.geoprovenance.v2.scanoss_geoprovenance_pb2 import ContributorResponse from .api.geoprovenance.v2.scanoss_geoprovenance_pb2_grpc import GeoProvenanceStub from .api.scanning.v2.scanoss_scanning_pb2 import HFHRequest -from .api.semgrep.v2.scanoss_semgrep_pb2 import SemgrepResponse from .api.semgrep.v2.scanoss_semgrep_pb2_grpc import SemgrepStub -from .api.vulnerabilities.v2.scanoss_vulnerabilities_pb2 import ( - ComponentsVulnerabilityResponse, -) from .api.vulnerabilities.v2.scanoss_vulnerabilities_pb2_grpc import VulnerabilitiesStub from .scanossbase import ScanossBase @@ -87,6 +76,35 @@ MAX_CONCURRENT_REQUESTS = 5 # Maximum number of concurrent requests to make +# REST API endpoint mappings with HTTP methods +REST_ENDPOINTS = { + 'vulnerabilities.GetComponentsVulnerabilities': {'path': '/vulnerabilities/components', 'method': 'POST'}, + 'dependencies.Echo': {'path': '/dependencies/echo', 'method': 'POST'}, + 'dependencies.GetDependencies': {'path': '/dependencies/dependencies', 'method': 'POST'}, + 'cryptography.Echo': {'path': '/cryptography/echo', 'method': 'POST'}, + 'cryptography.GetComponentsAlgorithms': {'path': '/cryptography/algorithms/components', 'method': 'POST'}, + 'cryptography.GetComponentsAlgorithmsInRange': { + 'path': '/cryptography/algorithms/range/components', + 'method': 'POST', + }, + 'cryptography.GetComponentsEncryptionHints': {'path': '/cryptography/hints/components', 'method': 'POST'}, + 'cryptography.GetComponentsHintsInRange': {'path': '/cryptography/hints/components/range', 'method': 'POST'}, + 'cryptography.GetComponentsVersionsInRange': { + 'path': '/cryptography/algorithms/versions/range/components', + 'method': 'POST', + }, + 'components.SearchComponents': {'path': '/components/search', 'method': 'GET'}, + 'components.GetComponentVersions': {'path': '/components/versions', 'method': 'GET'}, + 'geoprovenance.GetCountryContributorsByComponents': { + 'path': '/geoprovenance/countries/components', + 'method': 'POST', + }, + 'geoprovenance.GetOriginByComponents': {'path': '/geoprovenance/origin/components', 'method': 'POST'}, + 'licenses.GetComponentsLicenses': {'path': '/licenses/components', 'method': 'POST'}, + 'semgrep.GetComponentsIssues': {'path': '/semgrep/issues/components', 'method': 'POST'}, + 'scanning.FolderHashScan': {'path': '/scanning/hfh/scan', 'method': 'POST'}, +} + class ScanossGrpcError(Exception): """ @@ -99,12 +117,23 @@ class ScanossGrpcError(Exception): class ScanossGrpcStatusCode(IntEnum): """Status codes for SCANOSS gRPC responses""" + UNSPECIFIED = 0 SUCCESS = 1 - SUCCESS_WITH_WARNINGS = 2 - FAILED_WITH_WARNINGS = 3 + SUCCEEDED_WITH_WARNINGS = 2 + WARNING = 3 FAILED = 4 +class ScanossRESTStatusCode(Enum): + """Status codes for SCANOSS REST responses""" + + UNSPECIFIED = 'UNSPECIFIED' + SUCCESS = 'SUCCESS' + SUCCEEDED_WITH_WARNINGS = 'SUCCEEDED_WITH_WARNINGS' + WARNING = 'WARNING' + FAILED = 'FAILED' + + class ScanossGrpc(ScanossBase): """ Client for gRPC functionality @@ -112,20 +141,20 @@ class ScanossGrpc(ScanossBase): def __init__( # noqa: PLR0912, PLR0913, PLR0915 self, - url: str = None, + url: Optional[str] = None, debug: bool = False, trace: bool = False, quiet: bool = False, - ca_cert: str = None, - api_key: str = None, - ver_details: str = None, + ca_cert: Optional[str] = None, + api_key: Optional[str] = None, + ver_details: Optional[str] = None, timeout: int = 600, - proxy: str = None, - grpc_proxy: str = None, - pac: PACFile = None, - req_headers: dict = None, + proxy: Optional[str] = None, + grpc_proxy: Optional[str] = None, + pac: Optional[PACFile] = None, + req_headers: Optional[dict] = None, ignore_cert_errors: bool = False, - use_grpc: bool = False, + use_grpc: Optional[bool] = False, ): """ @@ -234,53 +263,25 @@ def _load_cert(cls, cert_file: str) -> bytes: with open(cert_file, 'rb') as f: return f.read() - def deps_echo(self, message: str = 'Hello there!') -> str: + def deps_echo(self, message: str = 'Hello there!') -> Optional[dict]: """ Send Echo message to the Dependency service :param self: :param message: Message to send (default: Hello there!) :return: echo or None """ - request_id = str(uuid.uuid4()) - resp: EchoResponse - try: - metadata = self.metadata[:] - metadata.append(('x-request-id', request_id)) # Set a Request ID - resp = self.dependencies_stub.Echo(EchoRequest(message=message), metadata=metadata, timeout=3) - except Exception as e: - self.print_stderr( - f'ERROR: {e.__class__.__name__} Problem encountered sending gRPC message (rqId: {request_id}): {e}' - ) - else: - if resp: - return resp.message - self.print_stderr(f'ERROR: Problem sending Echo request ({message}) to {self.url}. rqId: {request_id}') - return None + return self._call_api('dependencies.Echo', self.dependencies_stub.Echo, {'message': message}, EchoRequest) - def crypto_echo(self, message: str = 'Hello there!') -> str: + def crypto_echo(self, message: str = 'Hello there!') -> Optional[dict]: """ Send Echo message to the Cryptography service :param self: :param message: Message to send (default: Hello there!) :return: echo or None """ - request_id = str(uuid.uuid4()) - resp: EchoResponse - try: - metadata = self.metadata[:] - metadata.append(('x-request-id', request_id)) # Set a Request ID - resp = self.crypto_stub.Echo(EchoRequest(message=message), metadata=metadata, timeout=3) - except Exception as e: - self.print_stderr( - f'ERROR: {e.__class__.__name__} Problem encountered sending gRPC message (rqId: {request_id}): {e}' - ) - else: - if resp: - return resp.message - self.print_stderr(f'ERROR: Problem sending Echo request ({message}) to {self.url}. rqId: {request_id}') - return None + return self._call_api('cryptography.Echo', self.crypto_stub.Echo, {'message': message}, EchoRequest) - def get_dependencies(self, dependencies: json, depth: int = 1) -> dict: + def get_dependencies(self, dependencies: Optional[dict] = None, depth: int = 1) -> Optional[dict]: if not dependencies: self.print_stderr('ERROR: No dependency data supplied to submit to the API.') return None @@ -289,7 +290,7 @@ def get_dependencies(self, dependencies: json, depth: int = 1) -> dict: self.print_stderr(f'ERROR: No response for dependency request: {dependencies}') return resp - def get_dependencies_json(self, dependencies: dict, depth: int = 1) -> dict: + def get_dependencies_json(self, dependencies: dict, depth: int = 1) -> Optional[dict]: """ Client function to call the rpc for GetDependencies :param dependencies: Message to send to the service @@ -304,11 +305,11 @@ def get_dependencies_json(self, dependencies: dict, depth: int = 1) -> dict: self.print_stderr('ERROR: No dependency data supplied to send to decoration service.') return None all_responses = [] - # determine if we are using gRPC or REST based on the use_grpc flag - process_file = self._process_dep_file_grpc if self.use_grpc else self._process_dep_file_rest # Process the dependency files in parallel with concurrent.futures.ThreadPoolExecutor(max_workers=MAX_CONCURRENT_REQUESTS) as executor: - future_to_file = {executor.submit(process_file, file, depth): file for file in files_json} + future_to_file = { + executor.submit(self._process_dep_file, file, depth, self.use_grpc): file for file in files_json + } for future in concurrent.futures.as_completed(future_to_file): response = future.result() if response: @@ -326,161 +327,104 @@ def get_dependencies_json(self, dependencies: dict, depth: int = 1) -> dict: merged_response['status'] = response['status'] return merged_response - def _process_dep_file_grpc(self, file, depth: int = 1) -> dict: + def _process_dep_file(self, file, depth: int = 1, use_grpc: Optional[bool] = None) -> Optional[dict]: """ - Process a single file using gRPC + Process a single dependency file using either gRPC or REST - :param file: dependency file purls - :param depth: depth to search (default: 1) - :return: response JSON or None - """ - request_id = str(uuid.uuid4()) - try: - file_request = {'files': [file]} - request = ParseDict(file_request, DependencyRequest()) - request.depth = depth - metadata = self.metadata[:] - metadata.append(('x-request-id', request_id)) - self.print_debug(f'Sending dependency data via gRPC for decoration (rqId: {request_id})...') - resp = self.dependencies_stub.GetDependencies(request, metadata=metadata, timeout=self.timeout) - return MessageToDict(resp, preserving_proto_field_name=True) - except Exception as e: - self.print_stderr( - f'ERROR: {e.__class__.__name__} Problem encountered sending gRPC message (rqId: {request_id}): {e}' - ) - return None + Args: + file: dependency file purls + depth: depth to search (default: 1) + use_grpc: Whether to use gRPC or REST (None = use instance default) - def get_vulnerabilities_json(self, purls: dict) -> dict: - """ - Client function to call the rpc for Vulnerability GetVulnerabilities - It will either use REST (default) or gRPC depending on the use_grpc flag - :param purls: Message to send to the service - :return: Server response or None + Returns: + response JSON or None """ - if self.use_grpc: - return self._get_vulnerabilities_grpc(purls) - else: - return self._get_vulnerabilities_rest(purls) + file_request = {'files': [file], 'depth': depth} + + return self._call_api( + 'dependencies.GetDependencies', + self.dependencies_stub.GetDependencies, + file_request, + DependencyRequest, + 'Sending dependency data for decoration (rqId: {rqId})...', + use_grpc=use_grpc, + ) - def _get_vulnerabilities_grpc(self, purls: dict) -> dict: + def get_vulnerabilities_json(self, purls: Optional[dict] = None, use_grpc: Optional[bool] = None) -> Optional[dict]: """ Client function to call the rpc for Vulnerability GetVulnerabilities - :param purls: Message to send to the service - :return: Server response or None + It will either use REST (default) or gRPC + + Args: + purls (dict): Message to send to the service + + Returns: + Server response or None """ - if not purls: - self.print_stderr('ERROR: No message supplied to send to gRPC service.') - return None - request_id = str(uuid.uuid4()) - resp: ComponentsVulnerabilityResponse - try: - request = ParseDict(purls, ComponentsRequest()) # Parse the JSON/Dict into the purl request object - metadata = self.metadata[:] - metadata.append(('x-request-id', request_id)) # Set a Request ID - self.print_debug(f'Sending vulnerability data for decoration (rqId: {request_id})...') - resp = self.vuln_stub.GetComponentsVulnerabilities(request, metadata=metadata, timeout=self.timeout) - except Exception as e: - self.print_stderr( - f'ERROR: {e.__class__.__name__} Problem encountered sending gRPC message (rqId: {request_id}): {e}' - ) - else: - if resp: - if not self._check_status_response(resp.status, request_id): - return None - resp_dict = MessageToDict(resp, preserving_proto_field_name=True) # Convert gRPC response to a dict - del resp_dict['status'] - return resp_dict - return None + return self._call_api( + 'vulnerabilities.GetComponentsVulnerabilities', + self.vuln_stub.GetComponentsVulnerabilities, + purls, + ComponentsRequest, + 'Sending vulnerability data for decoration (rqId: {rqId})...', + use_grpc=use_grpc, + ) - def get_semgrep_json(self, purls: dict) -> dict: + def get_semgrep_json(self, purls: Optional[dict] = None, use_grpc: Optional[bool] = None) -> Optional[dict]: """ Client function to call the rpc for Semgrep GetIssues - :param purls: Message to send to the service - :return: Server response or None + + Args: + purls (dict): Message to send to the service + use_grpc (bool): Whether to use gRPC or REST + + Returns: + Server response or None """ - if not purls: - self.print_stderr('ERROR: No message supplied to send to gRPC service.') - return None - request_id = str(uuid.uuid4()) - resp: SemgrepResponse - try: - request = ParseDict(purls, PurlRequest()) # Parse the JSON/Dict into the purl request object - metadata = self.metadata[:] - metadata.append(('x-request-id', request_id)) # Set a Request ID - self.print_debug(f'Sending semgrep data for decoration (rqId: {request_id})...') - resp = self.semgrep_stub.GetIssues(request, metadata=metadata, timeout=self.timeout) - except Exception as e: - self.print_stderr( - f'ERROR: {e.__class__.__name__} Problem encountered sending gRPC message (rqId: {request_id}): {e}' - ) - else: - if resp: - if not self._check_status_response(resp.status, request_id): - return None - resp_dict = MessageToDict(resp, preserving_proto_field_name=True) # Convert gRPC response to a dict - del resp_dict['status'] - return resp_dict - return None + return self._call_api( + 'semgrep.GetComponentsIssues', + self.semgrep_stub.GetComponentsIssues, + purls, + ComponentsRequest, + 'Sending semgrep data for decoration (rqId: {rqId})...', + use_grpc=use_grpc, + ) - def search_components_json(self, search: dict) -> dict: + def search_components_json(self, search: dict, use_grpc: Optional[bool] = None) -> Optional[dict]: """ Client function to call the rpc for Components SearchComponents - :param search: Message to send to the service - :return: Server response or None - """ - if not search: - self.print_stderr('ERROR: No message supplied to send to gRPC service.') - return None - request_id = str(uuid.uuid4()) - resp: CompSearchResponse - try: - request = ParseDict(search, CompSearchRequest()) # Parse the JSON/Dict into the purl request object - metadata = self.metadata[:] - metadata.append(('x-request-id', request_id)) # Set a Request ID - self.print_debug(f'Sending component search data (rqId: {request_id})...') - resp = self.comp_search_stub.SearchComponents(request, metadata=metadata, timeout=self.timeout) - except Exception as e: - self.print_stderr( - f'ERROR: {e.__class__.__name__} Problem encountered sending gRPC message (rqId: {request_id}): {e}' - ) - else: - if resp: - if not self._check_status_response(resp.status, request_id): - return None - resp_dict = MessageToDict(resp, preserving_proto_field_name=True) # Convert gRPC response to a dict - del resp_dict['status'] - return resp_dict - return None - def get_component_versions_json(self, search: dict) -> dict: + Args: + search (dict): Message to send to the service + Returns: + Server response or None + """ + return self._call_api( + 'components.SearchComponents', + self.comp_search_stub.SearchComponents, + search, + CompSearchRequest, + 'Sending component search data for decoration (rqId: {rqId})...', + use_grpc=use_grpc, + ) + + def get_component_versions_json(self, search: dict, use_grpc: Optional[bool] = None) -> Optional[dict]: """ Client function to call the rpc for Components GetComponentVersions - :param search: Message to send to the service - :return: Server response or None - """ - if not search: - self.print_stderr('ERROR: No message supplied to send to gRPC service.') - return None - request_id = str(uuid.uuid4()) - resp: CompVersionResponse - try: - request = ParseDict(search, CompVersionRequest()) # Parse the JSON/Dict into the purl request object - metadata = self.metadata[:] - metadata.append(('x-request-id', request_id)) # Set a Request ID - self.print_debug(f'Sending component version data (rqId: {request_id})...') - resp = self.comp_search_stub.GetComponentVersions(request, metadata=metadata, timeout=self.timeout) - except Exception as e: - self.print_stderr( - f'ERROR: {e.__class__.__name__} Problem encountered sending gRPC message (rqId: {request_id}): {e}' - ) - else: - if resp: - if not self._check_status_response(resp.status, request_id): - return None - resp_dict = MessageToDict(resp, preserving_proto_field_name=True) # Convert gRPC response to a dict - del resp_dict['status'] - return resp_dict - return None + + Args: + search (dict): Message to send to the service + Returns: + Server response or None + """ + return self._call_api( + 'components.GetComponentVersions', + self.comp_search_stub.GetComponentVersions, + search, + CompVersionRequest, + 'Sending component version data for decoration (rqId: {rqId})...', + use_grpc=use_grpc, + ) def folder_hash_scan(self, request: Dict) -> Optional[Dict]: """ @@ -499,6 +443,44 @@ def folder_hash_scan(self, request: Dict) -> Optional[Dict]: 'Sending folder hash scan data (rqId: {rqId})...', ) + def _call_api( + self, + endpoint_key: str, + rpc_method, + request_input, + request_type, + debug_msg: Optional[str] = None, + use_grpc: Optional[bool] = None, + ) -> Optional[Dict]: + """ + Unified method to call either gRPC or REST API based on configuration + + Args: + endpoint_key (str): The key to lookup the REST endpoint in REST_ENDPOINTS + rpc_method: The gRPC stub method (used only if use_grpc is True) + request_input: Either a dict or a gRPC request object + request_type: The type of the gRPC request object (used only if use_grpc is True) + debug_msg (str, optional): Debug message template that can include {rqId} placeholder + use_grpc (bool, optional): Override the instance's use_grpc setting. If None, uses self.use_grpc + + Returns: + dict: The parsed response as a dictionary, or None if something went wrong + """ + if not request_input: + self.print_stderr('ERROR: No message supplied to send to service.') + return None + + # Determine whether to use gRPC or REST + use_grpc_flag = use_grpc if use_grpc is not None else self.use_grpc + + if use_grpc_flag: + return self._call_rpc(rpc_method, request_input, request_type, debug_msg) + else: + # For REST, we only need the dict input + if not isinstance(request_input, dict): + request_input = MessageToDict(request_input, preserving_proto_field_name=True) + return self._call_rest(endpoint_key, request_input, debug_msg) + def _call_rpc(self, rpc_method, request_input, request_type, debug_msg: Optional[str] = None) -> Optional[Dict]: """ Call a gRPC method and return the response as a dictionary @@ -518,20 +500,21 @@ def _call_rpc(self, rpc_method, request_input, request_type, debug_msg: Optional else: request_obj = request_input metadata = self.metadata[:] + [('x-request-id', request_id)] - self.print_debug(debug_msg.format(rqId=request_id)) + if debug_msg: + self.print_debug(debug_msg.format(rqId=request_id)) try: resp = rpc_method(request_obj, metadata=metadata, timeout=self.timeout) except grpc.RpcError as e: raise ScanossGrpcError( f'{e.__class__.__name__} while sending gRPC message (rqId: {request_id}): {e.details()}' ) - if resp and not self._check_status_response(resp.status, request_id): + if resp and not self._check_status_response_grpc(resp.status, request_id): return None resp_dict = MessageToDict(resp, preserving_proto_field_name=True) return resp_dict - def _check_status_response(self, status_response: StatusResponse, request_id: str = None) -> bool: + def _check_status_response_grpc(self, status_response: StatusResponse, request_id: str = None) -> bool: """ Check the response object to see if the command was successful or not :param status_response: Status Response @@ -546,15 +529,59 @@ def _check_status_response(self, status_response: StatusResponse, request_id: st if status_code > ScanossGrpcStatusCode.SUCCESS: ret_val = False # default to failed msg = 'Unsuccessful' - if status_code == ScanossGrpcStatusCode.SUCCESS_WITH_WARNINGS: + if status_code == ScanossGrpcStatusCode.SUCCEEDED_WITH_WARNINGS: msg = 'Succeeded with warnings' ret_val = True # No need to fail as it succeeded with warnings - elif status_code == ScanossGrpcStatusCode.FAILED_WITH_WARNINGS: + elif status_code == ScanossGrpcStatusCode.WARNING: msg = 'Failed with warnings' self.print_stderr(f'{msg} (rqId: {request_id} - status: {status_code}): {status_response.message}') return ret_val return True + def check_status_response_rest(self, status_dict: dict, request_id: Optional[str] = None) -> bool: + """ + Check the REST response dictionary to see if the command was successful or not + + Args: + status_dict (dict): Status dictionary from REST response containing 'status' and 'message' keys + request_id (str, optional): Request ID for logging + Returns: + bool: True if successful, False otherwise + """ + if not status_dict: + self.print_stderr(f'Warning: No status response supplied (rqId: {request_id}). Assuming it was ok.') + return True + + if request_id: + self.print_debug(f'Checking response status (rqId: {request_id}): {status_dict}') + + # Get status from dictionary - it can be either a string or nested dict + status = status_dict.get('status') + message = status_dict.get('message', '') + ret_val = True + + # Handle case where status might be a string directly + if isinstance(status, str): + status_str = status.upper() + if status_str == ScanossRESTStatusCode.SUCCESS.value: + ret_val = True + elif status_str == ScanossRESTStatusCode.SUCCEEDED_WITH_WARNINGS.value: + self.print_stderr(f'Succeeded with warnings (rqId: {request_id}): {message}') + ret_val = True + elif status_str == ScanossRESTStatusCode.WARNING.value: + self.print_stderr(f'Failed with warnings (rqId: {request_id}): {message}') + ret_val = False + elif status_str == ScanossRESTStatusCode.FAILED.value: + self.print_stderr(f'Unsuccessful (rqId: {request_id}): {message}') + ret_val = False + else: + self.print_debug(f'Unknown status "{status_str}" (rqId: {request_id}). Assuming success.') + ret_val = True + + # Otherwise asume success + self.print_debug(f'Unexpected status type {type(status)} (rqId: {request_id}). Assuming success.') + return ret_val + def _get_proxy_config(self): """ Set the grpc_proxy/http_proxy/https_proxy environment variables if PAC file has been specified @@ -577,138 +604,146 @@ def _get_proxy_config(self): os.environ['http_proxy'] = proxies.get('http') or '' os.environ['https_proxy'] = proxies.get('https') or '' - def get_provenance_json(self, purls: dict) -> dict: + def get_provenance_json(self, purls: dict, use_grpc: Optional[bool] = None) -> Optional[Dict]: """ - Client function to call the rpc for GetComponentProvenance - :param purls: Message to send to the service - :return: Server response or None + Client function to call the rpc for GetComponentContributors + + Args: + purls (dict): ComponentsRequest + use_grpc (bool): Whether to use gRPC or REST (None = use instance default) + + Returns: + dict: JSON response or None """ - if not purls: - self.print_stderr('ERROR: No message supplied to send to gRPC service.') - return None - request_id = str(uuid.uuid4()) - resp: ContributorResponse - try: - request = ParseDict(purls, PurlRequest()) # Parse the JSON/Dict into the purl request object - metadata = self.metadata[:] - metadata.append(('x-request-id', request_id)) # Set a Request ID - self.print_debug(f'Sending data for provenance decoration (rqId: {request_id})...') - resp = self.provenance_stub.GetComponentContributors(request, metadata=metadata, timeout=self.timeout) - except Exception as e: - self.print_stderr( - f'ERROR: {e.__class__.__name__} Problem encountered sending gRPC message (rqId: {request_id}): {e}' - ) - else: - if resp: - if not self._check_status_response(resp.status, request_id): - return None - resp_dict = MessageToDict(resp, preserving_proto_field_name=True) # Convert gRPC response to a dict - return resp_dict - return None + return self._call_api( + 'geoprovenance.GetCountryContributorsByComponents', + self.provenance_stub.GetCountryContributorsByComponents, + purls, + ComponentsRequest, + 'Sending data for provenance decoration (rqId: {rqId})...', + use_grpc=use_grpc, + ) - def get_provenance_origin(self, request: Dict) -> Optional[Dict]: + def get_provenance_origin(self, request: Dict, use_grpc: Optional[bool] = None) -> Optional[Dict]: """ - Client function to call the rpc for GetComponentOrigin + Client function to call the rpc for GetOriginByComponents Args: - request (Dict): GetComponentOrigin Request + request (Dict): GetOriginByComponents Request Returns: Optional[Dict]: OriginResponse, or None if the request was not successfull """ - return self._call_rpc( - self.provenance_stub.GetComponentOrigin, + return self._call_api( + 'geoprovenance.GetOriginByComponents', + self.provenance_stub.GetOriginByComponents, request, - PurlRequest, + ComponentsRequest, 'Sending data for provenance origin decoration (rqId: {rqId})...', + use_grpc=use_grpc, ) - def get_crypto_algorithms_for_purl(self, request: Dict) -> Optional[Dict]: + def get_crypto_algorithms_for_purl(self, request: Dict, use_grpc: Optional[bool] = None) -> Optional[Dict]: """ - Client function to call the rpc for GetAlgorithms for a list of purls + Client function to call the rpc for GetComponentsAlgorithms for a list of purls Args: - request (Dict): PurlRequest + request (Dict): ComponentsRequest + use_grpc (Optional[bool]): Whether to use gRPC or REST (None = use instance default) Returns: Optional[Dict]: AlgorithmResponse, or None if the request was not successfull """ - return self._call_rpc( - self.crypto_stub.GetAlgorithms, + return self._call_api( + 'cryptography.GetComponentsAlgorithms', + self.crypto_stub.GetComponentsAlgorithms, request, - PurlRequest, + ComponentsRequest, 'Sending data for cryptographic algorithms decoration (rqId: {rqId})...', + use_grpc=use_grpc, ) - def get_crypto_algorithms_in_range_for_purl(self, request: Dict) -> Optional[Dict]: + def get_crypto_algorithms_in_range_for_purl(self, request: Dict, use_grpc: Optional[bool] = None) -> Optional[Dict]: """ - Client function to call the rpc for GetAlgorithmsInRange for a list of purls + Client function to call the rpc for GetComponentsAlgorithmsInRange for a list of purls Args: - request (Dict): PurlRequest + request (Dict): ComponentsRequest + use_grpc (Optional[bool]): Whether to use gRPC or REST (None = use instance default) Returns: Optional[Dict]: AlgorithmsInRangeResponse, or None if the request was not successfull """ - return self._call_rpc( - self.crypto_stub.GetAlgorithmsInRange, + return self._call_api( + 'cryptography.GetComponentsAlgorithmsInRange', + self.crypto_stub.GetComponentsAlgorithmsInRange, request, - PurlRequest, + ComponentsRequest, 'Sending data for cryptographic algorithms in range decoration (rqId: {rqId})...', + use_grpc=use_grpc, ) - def get_encryption_hints_for_purl(self, request: Dict) -> Optional[Dict]: + def get_encryption_hints_for_purl(self, request: Dict, use_grpc: Optional[bool] = None) -> Optional[Dict]: """ - Client function to call the rpc for GetEncryptionHints for a list of purls + Client function to call the rpc for GetComponentsEncryptionHints for a list of purls Args: - request (Dict): PurlRequest + request (Dict): ComponentsRequest + use_grpc (Optional[bool]): Whether to use gRPC or REST (None = use instance default) Returns: Optional[Dict]: HintsResponse, or None if the request was not successfull """ - return self._call_rpc( - self.crypto_stub.GetEncryptionHints, + return self._call_api( + 'cryptography.GetComponentsEncryptionHints', + self.crypto_stub.GetComponentsEncryptionHints, request, - PurlRequest, + ComponentsRequest, 'Sending data for encryption hints decoration (rqId: {rqId})...', + use_grpc=use_grpc, ) - def get_encryption_hints_in_range_for_purl(self, request: Dict) -> Optional[Dict]: + def get_encryption_hints_in_range_for_purl(self, request: Dict, use_grpc: Optional[bool] = None) -> Optional[Dict]: """ - Client function to call the rpc for GetHintsInRange for a list of purls + Client function to call the rpc for GetComponentsHintsInRange for a list of purls Args: - request (Dict): PurlRequest + request (Dict): ComponentsRequest + use_grpc (Optional[bool]): Whether to use gRPC or REST (None = use instance default) Returns: Optional[Dict]: HintsInRangeResponse, or None if the request was not successfull """ - return self._call_rpc( - self.crypto_stub.GetHintsInRange, + return self._call_api( + 'cryptography.GetComponentsHintsInRange', + self.crypto_stub.GetComponentsHintsInRange, request, - PurlRequest, + ComponentsRequest, 'Sending data for encryption hints in range decoration (rqId: {rqId})...', + use_grpc=use_grpc, ) - def get_versions_in_range_for_purl(self, request: Dict) -> Optional[Dict]: + def get_versions_in_range_for_purl(self, request: Dict, use_grpc: Optional[bool] = None) -> Optional[Dict]: """ - Client function to call the rpc for GetVersionsInRange for a list of purls + Client function to call the rpc for GetComponentsVersionsInRange for a list of purls Args: - request (Dict): PurlRequest + request (Dict): ComponentsRequest + use_grpc (Optional[bool]): Whether to use gRPC or REST (None = use instance default) Returns: Optional[Dict]: VersionsInRangeResponse, or None if the request was not successfull """ - return self._call_rpc( - self.crypto_stub.GetVersionsInRange, + return self._call_api( + 'cryptography.GetComponentsVersionsInRange', + self.crypto_stub.GetComponentsVersionsInRange, request, - PurlRequest, + ComponentsRequest, 'Sending data for cryptographic versions in range decoration (rqId: {rqId})...', + use_grpc=use_grpc, ) - def get_licenses(self, request: Dict) -> Optional[Dict]: + def get_licenses(self, request: Dict, use_grpc: Optional[bool] = None) -> Optional[Dict]: """ Client function to call the rpc for Licenses GetComponentsLicenses It will either use REST (default) or gRPC depending on the use_grpc flag @@ -718,28 +753,16 @@ def get_licenses(self, request: Dict) -> Optional[Dict]: Returns: Optional[Dict]: ComponentsLicenseResponse, or None if the request was not successfull """ - if self.use_grpc: - return self._get_licenses_grpc(request) - else: - return self._get_licenses_rest(request) - - def _get_licenses_grpc(self, request: Dict) -> Optional[Dict]: - """ - Client function to call the rpc for GetComponentsLicenses - - Args: - request (Dict): ComponentsRequest - Returns: - Optional[Dict]: ComponentsLicenseResponse, or None if the request was not successfull - """ - return self._call_rpc( + return self._call_api( + 'licenses.GetComponentsLicenses', self.license_stub.GetComponentsLicenses, request, ComponentsRequest, 'Sending data for license decoration (rqId: {rqId})...', + use_grpc=use_grpc, ) - def load_generic_headers(self, url: str = None): + def load_generic_headers(self, url: Optional[str] = None): """ Adds custom headers from req_headers to metadata. @@ -761,32 +784,91 @@ def load_generic_headers(self, url: str = None): # Start of REST Client Functions # - def rest_post(self, uri: str, request_id: str, data: dict) -> dict: + def _rest_get(self, uri: str, request_id: str, params: Optional[dict] = None) -> Optional[dict]: + """ + Send a GET request to the specified URI with optional query parameters. + + Args: + uri (str): URI to send GET request to + request_id (str): request id + params (dict, optional): Optional query parameters as dictionary + + Returns: + dict: JSON response or None + """ + if not uri: + self.print_stderr('Error: Missing URI. Cannot perform GET request.') + return None + self.print_trace(f'Sending REST GET request to {uri}...') + headers = self.headers.copy() + headers['x-request-id'] = request_id + retry = 0 + while retry <= self.retry_limit: + retry += 1 + try: + response = self.session.get(uri, headers=headers, params=params, timeout=self.timeout) + response.raise_for_status() # Raises an HTTPError for bad responses + return response.json() + except (requests.exceptions.SSLError, requests.exceptions.ProxyError) as e: + self.print_stderr(f'ERROR: Exception ({e.__class__.__name__}) sending GET request - {e}.') + raise Exception(f'ERROR: The SCANOSS API GET request failed for {uri}') from e + except requests.exceptions.HTTPError as e: + self.print_stderr(f'ERROR: HTTP error sending GET request ({request_id}): {e}') + raise Exception( + f'ERROR: The SCANOSS API GET request failed with status {e.response.status_code} for {uri}' + ) from e + except (requests.exceptions.Timeout, requests.exceptions.ConnectionError) as e: + if retry > self.retry_limit: # Timed out retry_limit or more times, fail + self.print_stderr(f'ERROR: {e.__class__.__name__} sending GET request ({request_id}): {e}') + raise Exception( + f'ERROR: The SCANOSS API GET request timed out ({e.__class__.__name__}) for {uri}' + ) from e + else: + self.print_stderr(f'Warning: {e.__class__.__name__} communicating with {self.url}. Retrying...') + time.sleep(5) + except requests.exceptions.RequestException as e: + self.print_stderr(f'Error: Problem sending GET request to {uri}: {e}') + raise Exception(f'ERROR: The SCANOSS API GET request failed for {uri}') from e + except Exception as e: + self.print_stderr( + f'ERROR: Exception ({e.__class__.__name__}) sending GET request ({request_id}) to {uri}: {e}' + ) + raise Exception(f'ERROR: The SCANOSS API GET request failed for {uri}') from e + return None + + def _rest_post(self, uri: str, request_id: str, data: dict) -> Optional[dict]: """ Post the specified data to the given URI. - :param request_id: request id - :param uri: URI to post to - :param data: json data to post - :return: JSON response or None + + Args: + uri (str): URI to post to + request_id (str): request id + data (dict): json data to post + + Returns: + dict: JSON response or None """ if not uri: self.print_stderr('Error: Missing URI. Cannot search for project.') return None self.print_trace(f'Sending REST POST data to {uri}...') - headers = self.headers - headers['x-request-id'] = request_id # send a unique request id for each post - retry = 0 # Add some retry logic to cater for timeouts, etc. + headers = self.headers.copy() + headers['x-request-id'] = request_id + retry = 0 while retry <= self.retry_limit: retry += 1 try: response = self.session.post(uri, headers=headers, json=data, timeout=self.timeout) response.raise_for_status() # Raises an HTTPError for bad responses return response.json() - except requests.exceptions.RequestException as e: - self.print_stderr(f'Error: Problem posting data to {uri}: {e}') except (requests.exceptions.SSLError, requests.exceptions.ProxyError) as e: self.print_stderr(f'ERROR: Exception ({e.__class__.__name__}) POSTing data - {e}.') raise Exception(f'ERROR: The SCANOSS Decoration API request failed for {uri}') from e + except requests.exceptions.HTTPError as e: + self.print_stderr(f'ERROR: HTTP error POSTing data ({request_id}): {e}') + raise Exception( + f'ERROR: The SCANOSS Decoration API request failed with status {e.response.status_code} for {uri}' + ) from e except (requests.exceptions.Timeout, requests.exceptions.ConnectionError) as e: if retry > self.retry_limit: # Timed out retry_limit or more times, fail self.print_stderr(f'ERROR: {e.__class__.__name__} POSTing decoration data ({request_id}): {e}') @@ -796,6 +878,9 @@ def rest_post(self, uri: str, request_id: str, data: dict) -> dict: else: self.print_stderr(f'Warning: {e.__class__.__name__} communicating with {self.url}. Retrying...') time.sleep(5) + except requests.exceptions.RequestException as e: + self.print_stderr(f'Error: Problem posting data to {uri}: {e}') + raise Exception(f'ERROR: The SCANOSS Decoration API request failed for {uri}') from e except Exception as e: self.print_stderr( f'ERROR: Exception ({e.__class__.__name__}) POSTing data ({request_id}) to {uri}: {e}' @@ -803,75 +888,39 @@ def rest_post(self, uri: str, request_id: str, data: dict) -> dict: raise Exception(f'ERROR: The SCANOSS Decoration API request failed for {uri}') from e return None - def _get_licenses_rest(self, purls: Dict) -> Optional[Dict]: + def _call_rest(self, endpoint_key: str, request_input: dict, debug_msg: Optional[str] = None) -> Optional[Dict]: """ - Get the licenses for the given purls using REST API + Call a REST endpoint and return the response as a dictionary Args: - purls (Dict): Purl Request dictionary + endpoint_key (str): The key to lookup the REST endpoint in REST_ENDPOINTS + request_input (dict): The request data to send + debug_msg (str, optional): Debug message template that can include {rqId} placeholder. + Returns: - Optional[Dict]: ComponentsLicenseResponse, or None if the request was not successfull + dict: The parsed REST response as a dictionary, or None if something went wrong """ - if not purls: - self.print_stderr('ERROR: No message supplied to send to REST decoration service.') - return None - request_id = str(uuid.uuid4()) - self.print_debug(f'Sending data for Licenses via REST (request id: {request_id})...') - response = self.rest_post(f'{self.orig_url}{DEFAULT_URI_PREFIX}/licenses/components', request_id, purls) - self.print_trace(f'Received response for Licenses via REST (request id: {request_id}): {response}') - if response: - # Parse the JSON/Dict into the purl response - resp_obj = ParseDict(response, ComponentsLicenseResponse(), True) - if resp_obj: - self.print_debug(f'License Response: {resp_obj}') - if not self._check_status_response(resp_obj.status, request_id): - return None - del response['status'] - return response - return None + if endpoint_key not in REST_ENDPOINTS: + raise ScanossGrpcError(f'Unknown REST endpoint key: {endpoint_key}') - def _get_vulnerabilities_rest(self, purls: dict): - """ - Get the vulnerabilities for the given purls using REST API - :param purls: Purl Request dictionary - :return: Vulnerability Response, or None if the request was unsuccessful - """ - if not purls: - self.print_stderr('ERROR: No message supplied to send to REST decoration service.') - return None + endpoint_config = REST_ENDPOINTS[endpoint_key] + endpoint_path = endpoint_config['path'] + method = endpoint_config['method'] + endpoint_url = f'{self.orig_url}{DEFAULT_URI_PREFIX}{endpoint_path}' request_id = str(uuid.uuid4()) - self.print_debug(f'Sending data for Vulnerabilities via REST (request id: {request_id})...') - response = self.rest_post(f'{self.orig_url}{DEFAULT_URI_PREFIX}/vulnerabilities/components', request_id, purls) - self.print_trace(f'Received response for Vulnerabilities via REST (request id: {request_id}): {response}') - if response: - # Parse the JSON/Dict into the purl response - resp_obj = ParseDict(response, ComponentsVulnerabilityResponse(), True) - if resp_obj: - self.print_debug(f'Vulnerability Response: {resp_obj}') - if not self._check_status_response(resp_obj.status, request_id): - return None - del response['status'] - return response - return None - def _process_dep_file_rest(self, file, depth: int = 1) -> dict: - """ - Porcess a single dependency file using REST + if debug_msg: + self.print_debug(debug_msg.format(rqId=request_id)) - :param file: dependency file purls - :param depth: depth to search (default: 1) - :return: response JSON or None - """ - request_id = str(uuid.uuid4()) - self.print_debug(f'Sending data for Dependencies via REST (request id: {request_id})...') - file_request = {'files': [file], 'depth': depth} - response = self.rest_post( - f'{self.orig_url}{DEFAULT_URI_PREFIX}/dependencies/dependencies', request_id, file_request - ) - self.print_trace(f'Received response for Dependencies via REST (request id: {request_id}): {response}') - if response: - return response - return None + if method == 'GET': + response = self._rest_get(endpoint_url, request_id, params=request_input) + else: # POST + response = self._rest_post(endpoint_url, request_id, request_input) + + if response and 'status' in response and not self.check_status_response_rest(response['status'], request_id): + return None + + return response #