Skip to content
Snippets Groups Projects
Commit 548a261b authored by Martin Lowe's avatar Martin Lowe :flag_ca:
Browse files

Merge branch 'malowe/main/11' into 'main'

Iss #11 - Fix formatting + remove CIRCL refs from API spec

See merge request !10
parents 139df148 589cc3fd
No related branches found
No related tags found
1 merge request!10Iss #11 - Fix formatting + remove CIRCL refs from API spec
Pipeline #9687 failed
openapi: '3.1.0'
openapi: "3.1.0"
info:
version: 1.0.0
title: CVE API
description: Access information on Eclipse Foundation CVEs.
license:
name: Eclipse Public License - 2.0
url: https://www.eclipse.org/legal/epl-2.0/
version: 1.0.0
title: CVE API
description: Access information on Eclipse Foundation CVEs.
license:
name: Eclipse Public License - 2.0
url: https://www.eclipse.org/legal/epl-2.0/
servers:
- url: https://api.eclipse.org/cve
description: Production endpoint for the membership portal data
- url: https://api.eclipse.org/cve
description: Production endpoint for the membership portal data
paths:
/cve:
get:
tags:
- CVEs
summary: CVE List
description: Returns a 200 when called. Pop goes the weasel!
responses:
200:
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/cves'
500:
description: Error while retrieving data
/cve/{id}:
parameters:
name: id
in: path
description: The id of the CVE to retrieve
required: true
schema:
type: string
get:
summary: CVE
description: Returns a CVE entry that has a matching id
responses:
200:
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/cve'
404:
description: CVE not found
500:
description: Error while retrieving data
/cve:
get:
tags:
- CVEs
summary: CVE List
description: Returns a 200 when called. Pop goes the weasel!
responses:
200:
description: Success
content:
application/json:
schema:
$ref: "#/components/schemas/cves"
500:
description: Error while retrieving data
/cve/{id}:
parameters:
- name: id
in: path
description: The id of the CVE to retrieve
required: true
schema:
type: string
get:
summary: CVE
description: Returns a CVE entry that has a matching id
responses:
200:
description: Success
content:
application/json:
schema:
$ref: "#/components/schemas/cve"
404:
description: CVE not found
500:
description: Error while retrieving data
components:
schemas:
cves:
type: array
items:
$ref: '#/components/schemas/cve'
cve:
type: object
properties:
id:
type: string
description: CVE id containing year
date:
type: string
description: The date of the report
project:
type: string
description: The project where the vulerability exists
link:
type: string
description: Link to the report
request_link:
type: string
description: Link to the request where the vulnerability was tracked
cve_pull_request:
type:
- string
- 'null'
description: Link to pull request that includes the vulnerability
live_link:
type: string
description: Link to the cve.mitre.org page for the vulnerability
status:
type: string
description: The current status of the vulerability (eg, Complete, Assigned, Reported)
year:
type: integer
description: The year the vulnerability was found
top_level_project:
type: string
description: The top level project where the vulnerability was found
circl_summary:
type:
- string
- 'null'
description: The summary of the vulnerablility pulled from the Circl API
circl_cvss:
type:
- number
- 'null'
description: The CVSS score pulled from the Circl API
schemas:
cves:
type: array
items:
$ref: "#/components/schemas/cve"
cve:
type: object
properties:
id:
type: string
description: CVE id containing year
date:
type: string
description: The date of the report
project:
type: string
description: The project where the vulerability exists
link:
type: string
description: Link to the report
request_link:
type: string
description: Link to the request where the vulnerability was tracked
cve_pull_request:
type:
- string
- "null"
description: Link to pull request that includes the vulnerability
live_link:
type: string
description: Link to the cve.mitre.org page for the vulnerability
status:
type: string
description: The current status of the vulerability (eg, Complete, Assigned, Reported)
year:
type: integer
description: The year the vulnerability was found
top_level_project:
type: string
description: The top level project where the vulnerability was found
summary:
type:
- string
- "null"
description: The summary of the vulnerablility pulled from the CVE details source
cvss:
type:
- number
- "null"
description: The CVSS score pulled from the CVE details source
......@@ -51,10 +51,10 @@ public abstract class CveData {
public abstract String getTopLevelProject();
@Nullable
public abstract String getCirclSummary();
public abstract String getSummary();
@Nullable
public abstract Double getCirclCvss();
public abstract Double getCvss();
public static Builder builder() {
return new AutoValue_CveData.Builder();
......@@ -97,9 +97,9 @@ public abstract class CveData {
public abstract Builder setTopLevelProject(String topLevelProject);
public abstract Builder setCirclSummary(@Nullable String circlSummary);
public abstract Builder setSummary(@Nullable String summary);
public abstract Builder setCirclCvss(@Nullable Double circlCvss);
public abstract Builder setCvss(@Nullable Double cvss);
public abstract CveData build();
}
......
......@@ -101,7 +101,7 @@ public interface CveSourceService {
if (cveDetails.isPresent()) {
return CveData
.copy(orig)
.setCirclSummary(cveDetails
.setSummary(cveDetails
.get()
.getDescription()
.getDescriptionData()
......@@ -110,7 +110,7 @@ public interface CveSourceService {
.findFirst()
.orElse(LocalizedValue.builder().setLang("en").setValue("").build())
.getValue())
.setCirclCvss(cveDetails.get().getImpact().isPresent() ? cveDetails.get().getImpact().get().getCvss().getBaseScore()
.setCvss(cveDetails.get().getImpact().isPresent() ? cveDetails.get().getImpact().get().getCvss().getBaseScore()
: null)
.build();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment