-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpin.lock.schema.json
More file actions
178 lines (178 loc) · 5.48 KB
/
Copy pathpin.lock.schema.json
File metadata and controls
178 lines (178 loc) · 5.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/git-pkgs/pin/main/docs/schema/pin.lock.schema.json",
"title": "pin.lock",
"description": "The pin.lock file format. A CycloneDX 1.6 SBOM with a small set of pin-specific properties under the `pin:` namespace. Normative reference: docs/SPEC.md in github.com/git-pkgs/pin.",
"type": "object",
"required": ["bomFormat", "specVersion", "version", "metadata", "components"],
"additionalProperties": true,
"properties": {
"bomFormat": {
"type": "string",
"const": "CycloneDX"
},
"specVersion": {
"type": "string",
"const": "1.6"
},
"version": {
"type": "integer",
"const": 1
},
"metadata": { "$ref": "#/$defs/metadata" },
"components": {
"type": "array",
"description": "One library component per distinct package, sorted alphabetically by bom-ref.",
"items": { "$ref": "#/$defs/library" }
}
},
"$defs": {
"metadata": {
"type": "object",
"required": ["tools"],
"additionalProperties": true,
"properties": {
"tools": {
"type": "object",
"required": ["components"],
"properties": {
"components": {
"type": "array",
"items": { "$ref": "#/$defs/toolComponent" }
}
}
},
"properties": {
"type": "array",
"items": { "$ref": "#/$defs/property" }
}
}
},
"toolComponent": {
"type": "object",
"required": ["type", "name", "version"],
"properties": {
"type": { "const": "application" },
"name": { "type": "string" },
"version": { "type": "string" }
}
},
"library": {
"type": "object",
"required": ["type", "bom-ref", "name"],
"additionalProperties": true,
"properties": {
"type": { "const": "library" },
"bom-ref": {
"type": "string",
"description": "Canonical purl. Equal to the purl field."
},
"name": { "type": "string" },
"version": { "type": "string" },
"purl": {
"type": "string",
"description": "pkg:npm/, pkg:github/, or pkg:generic/."
},
"hashes": {
"type": "array",
"description": "Package-level integrity anchor. SHA-512 for npm (tarball hash); SHA-1 for github (commit SHA, hex); SHA-384 for url (per-file TOFU).",
"items": { "$ref": "#/$defs/hash" }
},
"licenses": {
"type": "array",
"items": {
"type": "object",
"properties": {
"license": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "SPDX-normalised license identifier when known."
}
}
}
}
}
},
"externalReferences": {
"type": "array",
"items": { "$ref": "#/$defs/externalReference" }
},
"properties": {
"type": "array",
"items": { "$ref": "#/$defs/property" }
},
"components": {
"type": "array",
"description": "Nested file components, one per vendored file, sorted alphabetically by bom-ref.",
"items": { "$ref": "#/$defs/file" }
}
}
},
"file": {
"type": "object",
"required": ["type", "bom-ref", "name", "hashes"],
"additionalProperties": true,
"properties": {
"type": { "const": "file" },
"bom-ref": {
"type": "string",
"description": "Library purl plus a #<path> subpath fragment."
},
"name": {
"type": "string",
"description": "File path inside the source package."
},
"hashes": {
"type": "array",
"minItems": 1,
"description": "Per-file Subresource Integrity hash, hex-encoded. SHA-384 by default.",
"items": { "$ref": "#/$defs/hash" }
},
"externalReferences": {
"type": "array",
"items": { "$ref": "#/$defs/externalReference" }
},
"properties": {
"type": "array",
"items": { "$ref": "#/$defs/property" }
}
}
},
"hash": {
"type": "object",
"required": ["alg", "content"],
"properties": {
"alg": {
"type": "string",
"enum": ["SHA-1", "SHA-256", "SHA-384", "SHA-512"]
},
"content": {
"type": "string",
"description": "Hex-encoded digest."
}
}
},
"externalReference": {
"type": "object",
"required": ["type", "url"],
"properties": {
"type": {
"type": "string",
"enum": ["vcs", "distribution", "attestation"]
},
"url": { "type": "string", "format": "uri" }
}
},
"property": {
"type": "object",
"required": ["name", "value"],
"description": "Properties under the pin: namespace are reserved for this spec. Documented set at schema version 1: pin:lockfile_version, pin:out_dir, pin:out, pin:type, pin:format, pin:size, pin:attestation.predicate_type, pin:attestation.builder_id, pin:attestation.source_repository, pin:attestation.source_revision, pin:attestation.signer_identity.",
"properties": {
"name": { "type": "string" },
"value": { "type": "string" }
}
}
}
}