Skip to content

Commit 895ac41

Browse files
feat: Dashboard (#232)
1 parent a2c9a0d commit 895ac41

22 files changed

+1044
-390
lines changed

Diff for: client/openapi/trustd.yaml

+32-32
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ info:
55
license:
66
name: Apache License, Version 2.0
77
identifier: Apache-2.0
8-
version: 0.1.0-alpha.23
8+
version: 0.1.0-alpha.24
99
paths:
1010
/.well-known/trustify:
1111
get:
@@ -2243,6 +2243,7 @@ components:
22432243
required:
22442244
- sbom_id
22452245
- node_id
2246+
- relationship
22462247
- purl
22472248
- name
22482249
- version
@@ -2253,6 +2254,8 @@ components:
22532254
type: string
22542255
purl:
22552256
type: string
2257+
relationship:
2258+
type: string
22562259
sbom_id:
22572260
type: string
22582261
version:
@@ -3034,17 +3037,11 @@ components:
30343037
- type: object
30353038
required:
30363039
- described_by
3037-
- number_of_packages
30383040
properties:
30393041
described_by:
30403042
type: array
30413043
items:
30423044
$ref: '#/components/schemas/SbomPackage'
3043-
number_of_packages:
3044-
type: integer
3045-
format: int64
3046-
description: The number of packages this SBOM has
3047-
minimum: 0
30483045
total:
30493046
type: integer
30503047
format: int64
@@ -3344,6 +3341,7 @@ components:
33443341
- dev_tool_of
33453342
- described_by
33463343
- package_of
3344+
- undefined
33473345
Report:
33483346
type: object
33493347
required:
@@ -3427,6 +3425,7 @@ components:
34273425
- published
34283426
- authors
34293427
- name
3428+
- number_of_packages
34303429
properties:
34313430
authors:
34323431
type: array
@@ -3444,6 +3443,11 @@ components:
34443443
$ref: '#/components/schemas/Labels'
34453444
name:
34463445
type: string
3446+
number_of_packages:
3447+
type: integer
3448+
format: int64
3449+
description: The number of packages this SBOM has
3450+
minimum: 0
34473451
published:
34483452
type:
34493453
- string
@@ -3515,24 +3519,26 @@ components:
35153519
relationship:
35163520
$ref: '#/components/schemas/Relationship'
35173521
SbomStatus:
3518-
type: object
3519-
required:
3520-
- vulnerability_id
3521-
- status
3522-
- packages
3523-
properties:
3524-
context:
3525-
oneOf:
3526-
- type: 'null'
3527-
- $ref: '#/components/schemas/StatusContext'
3528-
packages:
3529-
type: array
3530-
items:
3531-
$ref: '#/components/schemas/SbomPackage'
3532-
status:
3533-
type: string
3534-
vulnerability_id:
3535-
type: string
3522+
allOf:
3523+
- $ref: '#/components/schemas/VulnerabilityHead'
3524+
- type: object
3525+
required:
3526+
- average_severity
3527+
- status
3528+
- packages
3529+
properties:
3530+
average_severity:
3531+
$ref: '#/components/schemas/Severity'
3532+
context:
3533+
oneOf:
3534+
- type: 'null'
3535+
- $ref: '#/components/schemas/StatusContext'
3536+
packages:
3537+
type: array
3538+
items:
3539+
$ref: '#/components/schemas/SbomPackage'
3540+
status:
3541+
type: string
35363542
SbomSummary:
35373543
allOf:
35383544
- $ref: '#/components/schemas/SbomHead'
@@ -3542,17 +3548,11 @@ components:
35423548
- type: object
35433549
required:
35443550
- described_by
3545-
- number_of_packages
35463551
properties:
35473552
described_by:
35483553
type: array
35493554
items:
35503555
$ref: '#/components/schemas/SbomPackage'
3551-
number_of_packages:
3552-
type: integer
3553-
format: int64
3554-
description: The number of packages this SBOM has
3555-
minimum: 0
35563556
Severity:
35573557
type: string
35583558
description: |-
@@ -3931,4 +3931,4 @@ components:
39313931
oneOf:
39323932
- type: 'null'
39333933
- $ref: '#/components/schemas/Severity'
3934-
description: Average (arithmetic mean) severity of the vulnerability aggregated from *all* related advisories.
3934+
description: Average (arithmetic mean) severity of the vulnerability aggregated from *all* related advisories.

Diff for: client/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"@patternfly/react-table": "^5.4.0",
3131
"@patternfly/react-tokens": "^5.4.0",
3232
"@segment/analytics-next": "^1.64.0",
33-
"@tanstack/react-query": "^5.50.1",
34-
"@tanstack/react-query-devtools": "^5.50.1",
33+
"@tanstack/react-query": "^5.61.0",
34+
"@tanstack/react-query-devtools": "^5.61.0",
3535
"axios": "^1.7.2",
3636
"dayjs": "^1.11.7",
3737
"ejs": "^3.1.10",

Diff for: client/src/app/api/models.ts

+9
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,12 @@ export interface DecomposedPurl {
5151
qualifiers?: Labels;
5252
path?: string;
5353
}
54+
55+
// User preferences
56+
57+
export interface WatchedSboms {
58+
sbom1Id: string | null;
59+
sbom2Id: string | null;
60+
sbom3Id: string | null;
61+
sbom4Id: string | null;
62+
}

Diff for: client/src/app/client/schemas.gen.ts

+43-37
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ export const AnalysisStatusSchema = {
276276

277277
export const AncNodeSchema = {
278278
type: "object",
279-
required: ["sbom_id", "node_id", "purl", "name", "version"],
279+
required: ["sbom_id", "node_id", "relationship", "purl", "name", "version"],
280280
properties: {
281281
name: {
282282
type: "string",
@@ -287,6 +287,9 @@ export const AncNodeSchema = {
287287
purl: {
288288
type: "string",
289289
},
290+
relationship: {
291+
type: "string",
292+
},
290293
sbom_id: {
291294
type: "string",
292295
},
@@ -1382,20 +1385,14 @@ export const PaginatedResults_SbomSummarySchema = {
13821385
},
13831386
{
13841387
type: "object",
1385-
required: ["described_by", "number_of_packages"],
1388+
required: ["described_by"],
13861389
properties: {
13871390
described_by: {
13881391
type: "array",
13891392
items: {
13901393
$ref: "#/components/schemas/SbomPackage",
13911394
},
13921395
},
1393-
number_of_packages: {
1394-
type: "integer",
1395-
format: "int64",
1396-
description: "The number of packages this SBOM has",
1397-
minimum: 0,
1398-
},
13991396
},
14001397
},
14011398
],
@@ -1843,6 +1840,7 @@ export const RelationshipSchema = {
18431840
"dev_tool_of",
18441841
"described_by",
18451842
"package_of",
1843+
"undefined",
18461844
],
18471845
} as const;
18481846

@@ -1952,6 +1950,7 @@ export const SbomHeadSchema = {
19521950
"published",
19531951
"authors",
19541952
"name",
1953+
"number_of_packages",
19551954
],
19561955
properties: {
19571956
authors: {
@@ -1978,6 +1977,12 @@ export const SbomHeadSchema = {
19781977
name: {
19791978
type: "string",
19801979
},
1980+
number_of_packages: {
1981+
type: "integer",
1982+
format: "int64",
1983+
description: "The number of packages this SBOM has",
1984+
minimum: 0,
1985+
},
19811986
published: {
19821987
type: ["string", "null"],
19831988
format: "date-time",
@@ -2077,32 +2082,39 @@ export const SbomPackageRelationSchema = {
20772082
} as const;
20782083

20792084
export const SbomStatusSchema = {
2080-
type: "object",
2081-
required: ["vulnerability_id", "status", "packages"],
2082-
properties: {
2083-
context: {
2084-
oneOf: [
2085-
{
2086-
type: "null",
2085+
allOf: [
2086+
{
2087+
$ref: "#/components/schemas/VulnerabilityHead",
2088+
},
2089+
{
2090+
type: "object",
2091+
required: ["average_severity", "status", "packages"],
2092+
properties: {
2093+
average_severity: {
2094+
$ref: "#/components/schemas/Severity",
20872095
},
2088-
{
2089-
$ref: "#/components/schemas/StatusContext",
2096+
context: {
2097+
oneOf: [
2098+
{
2099+
type: "null",
2100+
},
2101+
{
2102+
$ref: "#/components/schemas/StatusContext",
2103+
},
2104+
],
2105+
},
2106+
packages: {
2107+
type: "array",
2108+
items: {
2109+
$ref: "#/components/schemas/SbomPackage",
2110+
},
2111+
},
2112+
status: {
2113+
type: "string",
20902114
},
2091-
],
2092-
},
2093-
packages: {
2094-
type: "array",
2095-
items: {
2096-
$ref: "#/components/schemas/SbomPackage",
20972115
},
20982116
},
2099-
status: {
2100-
type: "string",
2101-
},
2102-
vulnerability_id: {
2103-
type: "string",
2104-
},
2105-
},
2117+
],
21062118
} as const;
21072119

21082120
export const SbomSummarySchema = {
@@ -2122,20 +2134,14 @@ export const SbomSummarySchema = {
21222134
},
21232135
{
21242136
type: "object",
2125-
required: ["described_by", "number_of_packages"],
2137+
required: ["described_by"],
21262138
properties: {
21272139
described_by: {
21282140
type: "array",
21292141
items: {
21302142
$ref: "#/components/schemas/SbomPackage",
21312143
},
21322144
},
2133-
number_of_packages: {
2134-
type: "integer",
2135-
format: "int64",
2136-
description: "The number of packages this SBOM has",
2137-
minimum: 0,
2138-
},
21392145
},
21402146
},
21412147
],

Diff for: client/src/app/client/types.gen.ts

+9-11
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export type AncNode = {
119119
name: string;
120120
node_id: string;
121121
purl: string;
122+
relationship: string;
122123
sbom_id: string;
123124
version: string;
124125
};
@@ -537,10 +538,6 @@ export type PaginatedResults_SbomSummary = {
537538
SbomHead &
538539
(null | SourceDocument) & {
539540
described_by: Array<SbomPackage>;
540-
/**
541-
* The number of packages this SBOM has
542-
*/
543-
number_of_packages: number;
544541
}
545542
>;
546543
total: number;
@@ -687,7 +684,8 @@ export type Relationship =
687684
| "build_tool_of"
688685
| "dev_tool_of"
689686
| "described_by"
690-
| "package_of";
687+
| "package_of"
688+
| "undefined";
691689

692690
export type Report = {
693691
/**
@@ -741,6 +739,10 @@ export type SbomHead = {
741739
id: string;
742740
labels: Labels;
743741
name: string;
742+
/**
743+
* The number of packages this SBOM has
744+
*/
745+
number_of_packages: number;
744746
published: string | null;
745747
};
746748

@@ -767,20 +769,16 @@ export type SbomPackageRelation = {
767769
relationship: Relationship;
768770
};
769771

770-
export type SbomStatus = {
772+
export type SbomStatus = VulnerabilityHead & {
773+
average_severity: Severity;
771774
context?: null | StatusContext;
772775
packages: Array<SbomPackage>;
773776
status: string;
774-
vulnerability_id: string;
775777
};
776778

777779
export type SbomSummary = SbomHead &
778780
(null | SourceDocument) & {
779781
described_by: Array<SbomPackage>;
780-
/**
781-
* The number of packages this SBOM has
782-
*/
783-
number_of_packages: number;
784782
};
785783

786784
/**

0 commit comments

Comments
 (0)