Skip to content

Commit

Permalink
TC-1177 v11y: 'context' usage instead of 'expect'
Browse files Browse the repository at this point in the history
Signed-off-by: mrizzi <[email protected]>
  • Loading branch information
mrizzi committed Jun 10, 2024
1 parent bd27504 commit 7585afc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
29 changes: 29 additions & 0 deletions v11y/testdata/CVE-2021-3601.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"containers": {
"cna": {
"providerMetadata": {
"dateUpdated": "2022-07-29T09:35:09",
"orgId": "3a12439a-ef3a-4c79-92e6-6081a721f1e5",
"shortName": "openssl"
},
"rejectedReasons": [
{
"lang": "en",
"value": "DO NOT USE THIS CANDIDATE NUMBER. ConsultIDs: none. Reason: This candidate was withdrawn by its CNA. OpenSSL does not class this issue as a security vulnerability. The trusted CA store should not contain anything that the user does not trust to issue other certificates. Notes: https://github.com/openssl/openssl/issues/5236#issuecomment-119646061"
}
]
}
},
"cveMetadata": {
"assignerOrgId": "3a12439a-ef3a-4c79-92e6-6081a721f1e5",
"assignerShortName": "openssl",
"cveId": "CVE-2021-3601",
"datePublished": "2022-07-29T09:35:09",
"dateRejected": "2022-07-29T09:35:09",
"dateReserved": "2021-06-14T00:00:00",
"dateUpdated": "2022-07-29T09:35:09",
"state": "REJECTED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.0"
}
5 changes: 3 additions & 2 deletions v11y/walker/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use anyhow::Context;
use collector_osv::client::schema::SeverityType;
use collector_osv::client::OsvClient;
use cve::published::Metric;
Expand Down Expand Up @@ -199,8 +200,8 @@ impl Run {
);
}
}
return Ok(serde_json::to_vec::<Published>(&cve)
.expect("CVE should have been serialized into Vec<u8>"));
return serde_json::to_vec::<Published>(&cve)
.context("CVE should have been serialized into Vec<u8>");
}
}
}
Expand Down

0 comments on commit 7585afc

Please sign in to comment.