Skip to content

Commit

Permalink
Validate supported ecosystems and identifier prefixes in the schema d…
Browse files Browse the repository at this point in the history
…efinition (#246)

Fixes: #201

---------

Signed-off-by: Andrew Pollock <[email protected]>
  • Loading branch information
andrewpollock authored Jun 14, 2024
1 parent d9f7fe3 commit 6a95f10
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions validation/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "string"
},
"id": {
"type": "string"
"$ref": "#/$defs/prefix"
},
"modified": {
"$ref": "#/$defs/timestamp"
Expand Down Expand Up @@ -56,7 +56,7 @@
"type": "object",
"properties": {
"ecosystem": {
"type": "string"
"$ref": "#/$defs/ecosystem"
},
"name": {
"type": "string"
Expand Down Expand Up @@ -296,6 +296,18 @@
"modified"
],
"$defs": {
"ecosystem": {
"type": "string",
"title": "Currently supported ecosystems",
"description": "These ecosystems are also documented at https://ossf.github.io/osv-schema/#affectedpackage-field",
"pattern": "^(AlmaLinux|Alpine|Android|Bioconductor|Bitnami|ConanCenter|CRAN|crates.io|Debian|GHC|GitHub Actions|GIT|Go|Hackage|Hex|Linux|Maven|npm|NuGet|OSS-Fuzz|Packagist|Photon OS|Pub|PyPI|Rocky Linux|RubyGems|SwiftURL|Ubuntu)(:[[:digit:]]+)?"
},
"prefix": {
"type": "string",
"title": "Currently supported home database identifier prefixes",
"description": "These home databases are also documented at https://ossf.github.io/osv-schema/#id-modified-fields",
"pattern": "^(ASB|A|ALSA|ALBA|ALEA|BIT|CURL|CVE|DSA|DLA|DTSA|GHSA|GO|GSD|HSEC|LBSEC|MAL|OSV|PHSA|PSF|PYSEC|RLSA|RXSA|RSEC|RUSTSEC|USN)-"
},
"severity": {
"type": [
"array",
Expand Down

0 comments on commit 6a95f10

Please sign in to comment.