Skip to content

Commit 88c2f83

Browse files
committed
Add Security Advisories to .proto
1 parent f116f6a commit 88c2f83

4 files changed

Lines changed: 444 additions & 119 deletions

File tree

proto/hex_pb_package.proto

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ message Release {
2323
// sha256 checksum of outer package tarball
2424
// required when encoding but optional when decoding
2525
optional bytes outer_checksum = 5;
26+
// Security advisories affecting this release
27+
repeated SecurityAdvisory advisories = 6;
2628
}
2729

2830
message RetirementStatus {
@@ -38,6 +40,25 @@ enum RetirementReason {
3840
RETIRED_RENAMED = 4;
3941
}
4042

43+
message SecurityAdvisory {
44+
// Advisory identifier (e.g. GHSA-xxxx-xxxx-xxxx or CVE-xxxx-xxxxx)
45+
required string id = 1;
46+
// Short description of the advisory
47+
required string title = 2;
48+
// URL to the full advisory
49+
required string url = 3;
50+
// Severity of the advisory
51+
optional AdvisorySeverity severity = 4;
52+
}
53+
54+
enum AdvisorySeverity {
55+
SEVERITY_NONE = 0;
56+
SEVERITY_LOW = 1;
57+
SEVERITY_MEDIUM = 2;
58+
SEVERITY_HIGH = 3;
59+
SEVERITY_CRITICAL = 4;
60+
}
61+
4162
message Dependency {
4263
// Package name of dependency
4364
required string package = 1;

proto/hex_pb_versions.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ message Package {
1616
repeated int32 retired = 3 [packed=true];
1717
// If set, the name of the package repository (NEVER USED, DEPRECATED)
1818
// string repository = 4;
19+
// Zero-based indexes of versions with security advisories in the versions field, see package.proto
20+
repeated int32 with_advisories = 5 [packed=true];
1921
}

0 commit comments

Comments
 (0)