Skip to content

Commit

Permalink
Attempt at updating the api_descriptor.pb proto (#2342)
Browse files Browse the repository at this point in the history
Currently CVSS_4 is not correctly converted to JSON in the API. This is
an attempt at fixing that issue (See #2331)
  • Loading branch information
another-rex authored Jun 25, 2024
1 parent 16979c7 commit e2601cd
Show file tree
Hide file tree
Showing 30 changed files with 289 additions and 211 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id: BLAH-123
id: OSV-123
summary: A vulnerability
details: |
Blah blah blah
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id: BLAH-124
id: OSV-124
summary: A vulnerability
details: |
Blah blah blah
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id: BLAH-125
id: OSV-125
summary: A vulnerability
details: |
Blah blah blah
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id: BLAH-126
id: OSV-126
summary: A vulnerability
details: |
Blah blah blah
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id: BLAH-127
id: OSV-127
summary: A vulnerability
details: |
Blah blah blah
Expand All @@ -11,7 +11,7 @@ affected:
name: blah.com/package
ecosystem: Go
versions:
- branch-v0.1.1
- branch-v0.1.1
ranges:
- type: GIT
repo: https://osv-test/repo/url
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id: BLAH-128
id: OSV-128
summary: A vulnerability
details: |
Blah blah blah
Expand All @@ -11,7 +11,7 @@ affected:
name: grpcio
ecosystem: PyPI
versions:
- branch-v0.1.1
- branch-v0.1.1
ranges:
- type: GIT
repo: https://osv-test/repo/url
Expand All @@ -22,4 +22,4 @@ affected:
events:
- introduced: 1.13.0
- limit: 1.14.2
modified: '2020-01-01T00:00:00Z'
modified: '2020-01-01T00:00:00Z'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id: BLAH-129
id: OSV-129
summary: A vulnerability
details: |
Blah blah blah
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id: BLAH-130
id: OSV-130
summary: A vulnerability
details: |
Blah blah blah
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id: BLAH-131
id: OSV-131
summary: A vulnerability
details: |
Blah blah blah
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
id: TEST-last-affected-01
id: OSV-TEST-last-affected-01
summary: A vulnerability
details: |
Blah blah blah
Expand Down
9 changes: 5 additions & 4 deletions docker/worker/testdata/UpdateTest_diff_last_affected_git.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
('diff --git a/TEST-last-affected-01.yaml b/TEST-last-affected-01.yaml\n'
'index fa8cc1b..77df150 100644\n'
'--- a/TEST-last-affected-01.yaml\n'
'+++ b/TEST-last-affected-01.yaml\n'
('diff --git a/OSV-TEST-last-affected-01.yaml '
'b/OSV-TEST-last-affected-01.yaml\n'
'index 86e69d4..236ac2c 100644\n'
'--- a/OSV-TEST-last-affected-01.yaml\n'
'+++ b/OSV-TEST-last-affected-01.yaml\n'
'@@ -3,7 +3,7 @@ summary: A vulnerability\n'
' details: |\n'
' Blah blah blah\n'
Expand Down
8 changes: 4 additions & 4 deletions docker/worker/testdata/UpdateTest_diff_update.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
('diff --git a/BLAH-123.yaml b/BLAH-123.yaml\n'
'index 234fa5a..9305b68 100644\n'
'--- a/BLAH-123.yaml\n'
'+++ b/BLAH-123.yaml\n'
('diff --git a/OSV-123.yaml b/OSV-123.yaml\n'
'index 0d93ff8..be4b7e7 100644\n'
'--- a/OSV-123.yaml\n'
'+++ b/OSV-123.yaml\n'
'@@ -3,13 +3,9 @@ summary: A vulnerability\n'
' details: |\n'
' Blah blah blah\n'
Expand Down
8 changes: 4 additions & 4 deletions docker/worker/testdata/UpdateTest_diff_update_add_fix.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
('diff --git a/BLAH-124.yaml b/BLAH-124.yaml\n'
'index 2c578cd..e987270 100644\n'
'--- a/BLAH-124.yaml\n'
'+++ b/BLAH-124.yaml\n'
('diff --git a/OSV-124.yaml b/OSV-124.yaml\n'
'index 4d2eede..9aa0b53 100644\n'
'--- a/OSV-124.yaml\n'
'+++ b/OSV-124.yaml\n'
'@@ -3,6 +3,7 @@ summary: A vulnerability\n'
' details: |\n'
' Blah blah blah\n'
Expand Down
11 changes: 5 additions & 6 deletions docker/worker/testdata/UpdateTest_diff_update_limit.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
('diff --git a/BLAH-128.yaml b/BLAH-128.yaml\n'
'index cea90a0..26ea605 100644\n'
'--- a/BLAH-128.yaml\n'
'+++ b/BLAH-128.yaml\n'
('diff --git a/OSV-128.yaml b/OSV-128.yaml\n'
'index 9b928c1..c55073f 100644\n'
'--- a/OSV-128.yaml\n'
'+++ b/OSV-128.yaml\n'
'@@ -3,6 +3,7 @@ summary: A vulnerability\n'
' details: |\n'
' Blah blah blah\n'
Expand All @@ -15,7 +15,7 @@
' name: grpcio\n'
' ecosystem: PyPI\n'
'- versions:\n'
'- - branch-v0.1.1\n'
'- - branch-v0.1.1\n'
' ranges:\n'
' - type: GIT\n'
' repo: https://osv-test/repo/url\n'
Expand All @@ -24,7 +24,6 @@
' - introduced: 1.13.0\n'
' - limit: 1.14.2\n'
"-modified: '2020-01-01T00:00:00Z'\n"
'\\ No newline at end of file\n'
'+ versions:\n'
'+ - branch-v0.1.1\n'
'+ - 1.13.0\n'
Expand Down
10 changes: 5 additions & 5 deletions docker/worker/testdata/UpdateTest_diff_update_no_introduced.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
('diff --git a/BLAH-127.yaml b/BLAH-127.yaml\n'
'index 637ce2f..727f36f 100644\n'
'--- a/BLAH-127.yaml\n'
'+++ b/BLAH-127.yaml\n'
('diff --git a/OSV-127.yaml b/OSV-127.yaml\n'
'index a1a76f1..38a0d96 100644\n'
'--- a/OSV-127.yaml\n'
'+++ b/OSV-127.yaml\n'
'@@ -3,6 +3,7 @@ summary: A vulnerability\n'
' details: |\n'
' Blah blah blah\n'
Expand All @@ -15,7 +15,7 @@
' name: blah.com/package\n'
' ecosystem: Go\n'
'- versions:\n'
'- - branch-v0.1.1\n'
'- - branch-v0.1.1\n'
' ranges:\n'
' - type: GIT\n'
' repo: https://osv-test/repo/url\n'
Expand Down
7 changes: 4 additions & 3 deletions docker/worker/testdata/UpdateTest_last_affected_git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
'aliases': [],
'credits': [],
'database_specific': None,
'db_id': 'TEST-last-affected-01',
'db_id': 'OSV-TEST-last-affected-01',
'details': 'Blah blah blah\nBlah\n',
'ecosystem': ['GIT'],
'fixed': '',
Expand All @@ -36,15 +36,16 @@
'git',
'https://osv-test/repo/url',
'last',
'osv',
'osv-test-last-affected-01',
'osv-test/repo/url',
'repo',
'test',
'test-last-affected-01',
'url'],
'semver_fixed_indexes': [],
'severities': [],
'source': 'source',
'source_id': 'source:TEST-last-affected-01.yaml',
'source_id': 'source:OSV-TEST-last-affected-01.yaml',
'source_of_truth': 2,
'status': 1,
'summary': 'A vulnerability',
Expand Down
7 changes: 4 additions & 3 deletions docker/worker/testdata/UpdateTest_update.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'name': 'Foo bar',
'type': None}],
'database_specific': {'specific': 1337.0},
'db_id': 'BLAH-123',
'db_id': 'OSV-123',
'details': 'Blah blah blah\nBlah\n',
'ecosystem': ['Go'],
'fixed': '',
Expand All @@ -43,11 +43,12 @@
'related': [],
'search_indices': [ '123',
'blah',
'blah-123',
'blah.com/package',
'com',
'go',
'https://osv-test/repo/url',
'osv',
'osv-123',
'osv-test/repo/url',
'package',
'repo',
Expand All @@ -56,7 +57,7 @@
'severities': [ { 'score': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L',
'type': 'CVSS_V3'}],
'source': 'source',
'source_id': 'source:BLAH-123.yaml',
'source_id': 'source:OSV-123.yaml',
'source_of_truth': 2,
'status': 1,
'summary': 'A vulnerability',
Expand Down
7 changes: 4 additions & 3 deletions docker/worker/testdata/UpdateTest_update_add_fix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
'aliases': [],
'credits': [],
'database_specific': None,
'db_id': 'BLAH-124',
'db_id': 'OSV-124',
'details': 'Blah blah blah\nBlah\n',
'ecosystem': ['Go'],
'fixed': '',
Expand All @@ -41,19 +41,20 @@
'related': [],
'search_indices': [ '124',
'blah',
'blah-124',
'blah.com/package',
'com',
'go',
'https://osv-test/repo/url',
'osv',
'osv-124',
'osv-test/repo/url',
'package',
'repo',
'url'],
'semver_fixed_indexes': [],
'severities': [],
'source': 'source',
'source_id': 'source:BLAH-124.yaml',
'source_id': 'source:OSV-124.yaml',
'source_of_truth': 2,
'status': 1,
'summary': 'A vulnerability',
Expand Down
8 changes: 4 additions & 4 deletions docker/worker/testdata/UpdateTest_update_limit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
'aliases': [],
'credits': [],
'database_specific': None,
'db_id': 'BLAH-128',
'db_id': 'OSV-128',
'details': 'Blah blah blah\nBlah\n',
'ecosystem': ['PyPI'],
'fixed': '',
Expand All @@ -54,18 +54,18 @@
'regressed': '',
'related': [],
'search_indices': [ '128',
'blah',
'blah-128',
'grpcio',
'https://osv-test/repo/url',
'osv',
'osv-128',
'osv-test/repo/url',
'pypi',
'repo',
'url'],
'semver_fixed_indexes': [],
'severities': [],
'source': 'source',
'source_id': 'source:BLAH-128.yaml',
'source_id': 'source:OSV-128.yaml',
'source_of_truth': 2,
'status': 1,
'summary': 'A vulnerability',
Expand Down
7 changes: 4 additions & 3 deletions docker/worker/testdata/UpdateTest_update_new.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
'aliases': [],
'credits': [],
'database_specific': None,
'db_id': 'BLAH-126',
'db_id': 'OSV-126',
'details': 'Blah blah blah\nBlah\n',
'ecosystem': ['Go'],
'fixed': '',
Expand All @@ -41,19 +41,20 @@
'related': [],
'search_indices': [ '126',
'blah',
'blah-126',
'blah.com/package',
'com',
'go',
'https://osv-test/repo/url',
'osv',
'osv-126',
'osv-test/repo/url',
'package',
'repo',
'url'],
'semver_fixed_indexes': [],
'severities': [],
'source': 'source',
'source_id': 'source:BLAH-126.yaml',
'source_id': 'source:OSV-126.yaml',
'source_of_truth': 2,
'status': 1,
'summary': 'A vulnerability',
Expand Down
7 changes: 4 additions & 3 deletions docker/worker/testdata/UpdateTest_update_no_introduced.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
'aliases': [],
'credits': [],
'database_specific': None,
'db_id': 'BLAH-127',
'db_id': 'OSV-127',
'details': 'Blah blah blah\nBlah\n',
'ecosystem': ['Go'],
'fixed': '',
Expand All @@ -41,19 +41,20 @@
'related': [],
'search_indices': [ '127',
'blah',
'blah-127',
'blah.com/package',
'com',
'go',
'https://osv-test/repo/url',
'osv',
'osv-127',
'osv-test/repo/url',
'package',
'repo',
'url'],
'semver_fixed_indexes': [],
'severities': [],
'source': 'source',
'source_id': 'source:BLAH-127.yaml',
'source_id': 'source:OSV-127.yaml',
'source_of_truth': 2,
'status': 1,
'summary': 'A vulnerability',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'aliases': [],
'credits': [],
'database_specific': None,
'db_id': 'BLAH-130',
'db_id': 'OSV-130',
'details': 'Blah blah blah\nBlah\n',
'ecosystem': ['ecosystem'],
'fixed': '',
Expand All @@ -39,19 +39,20 @@
'related': [],
'search_indices': [ '130',
'blah',
'blah-130',
'blah.com/package',
'com',
'ecosystem',
'https://osv-test/repo/url',
'osv',
'osv-130',
'osv-test/repo/url',
'package',
'repo',
'url'],
'semver_fixed_indexes': [],
'severities': [],
'source': 'source',
'source_id': 'source:BLAH-130.yaml',
'source_id': 'source:OSV-130.yaml',
'source_of_truth': 2,
'status': 1,
'summary': 'A vulnerability',
Expand Down
Loading

0 comments on commit e2601cd

Please sign in to comment.