@freedomofpress/sigstore-browser 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +8 -6
- package/dist/index-CRFtwdjM.js +4528 -0
- package/dist/index-CRFtwdjM.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/policy.d.ts +266 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +371 -0
- package/dist/policy.js.map +1 -0
- package/dist/sigstore.min.js +6 -0
- package/dist/sigstore.min.js.map +1 -0
- package/dist/trust/tuf.d.ts.map +1 -1
- package/dist/trust/tuf.js +3 -1
- package/dist/trust/tuf.js.map +1 -1
- package/dist/tuf-D48cBq5i.js +377 -0
- package/dist/tuf-D48cBq5i.js.map +1 -0
- package/dist/tuf-root-D8m0y2I4.js +5 -0
- package/dist/tuf-root-D8m0y2I4.js.map +1 -0
- package/dist/x509/cert.d.ts +42 -1
- package/dist/x509/cert.d.ts.map +1 -1
- package/dist/x509/cert.js +103 -4
- package/dist/x509/cert.js.map +1 -1
- package/dist/x509/ext.d.ts +66 -2
- package/dist/x509/ext.d.ts.map +1 -1
- package/dist/x509/ext.js +133 -8
- package/dist/x509/ext.js.map +1 -1
- package/package.json +9 -2
- package/src/index.ts +78 -2
- package/src/policy.ts +476 -0
- package/src/trust/tuf.ts +3 -1
- package/src/x509/cert.ts +141 -3
- package/src/x509/ext.ts +154 -8
- package/vite.config.ts +12 -3
package/src/x509/ext.ts
CHANGED
|
@@ -161,22 +161,168 @@ export class X509SubjectKeyIDExtension extends X509Extension {
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
// Fulcio
|
|
165
|
-
//
|
|
166
|
-
|
|
167
|
-
get
|
|
164
|
+
// Base class for Fulcio extensions with V1 format (raw OCTET STRING value)
|
|
165
|
+
// https://github.com/sigstore/fulcio/blob/main/docs/oid-info.md
|
|
166
|
+
class X509FulcioExtensionV1 extends X509Extension {
|
|
167
|
+
get stringValue(): string {
|
|
168
168
|
return Uint8ArrayToString(this.extnValueObj.value);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
// Fulcio
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
get issuer(): string {
|
|
172
|
+
// Base class for Fulcio extensions with V2 format (DER-encoded UTF8String)
|
|
173
|
+
class X509FulcioExtensionV2 extends X509Extension {
|
|
174
|
+
get stringValue(): string {
|
|
176
175
|
return Uint8ArrayToString(this.extnValueObj.subs[0].value);
|
|
177
176
|
}
|
|
178
177
|
}
|
|
179
178
|
|
|
179
|
+
// OID 1.3.6.1.4.1.57264.1.1 - OIDC Issuer (V1)
|
|
180
|
+
export class X509FulcioIssuerV1 extends X509FulcioExtensionV1 {
|
|
181
|
+
get issuer(): string {
|
|
182
|
+
return this.stringValue;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// OID 1.3.6.1.4.1.57264.1.2 - GitHub Workflow Trigger (V1)
|
|
187
|
+
export class X509GitHubWorkflowTriggerExtension extends X509FulcioExtensionV1 {
|
|
188
|
+
get workflowTrigger(): string {
|
|
189
|
+
return this.stringValue;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// OID 1.3.6.1.4.1.57264.1.3 - GitHub Workflow SHA (V1)
|
|
194
|
+
export class X509GitHubWorkflowSHAExtension extends X509FulcioExtensionV1 {
|
|
195
|
+
get workflowSHA(): string {
|
|
196
|
+
return this.stringValue;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// OID 1.3.6.1.4.1.57264.1.4 - GitHub Workflow Name (V1)
|
|
201
|
+
export class X509GitHubWorkflowNameExtension extends X509FulcioExtensionV1 {
|
|
202
|
+
get workflowName(): string {
|
|
203
|
+
return this.stringValue;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// OID 1.3.6.1.4.1.57264.1.5 - GitHub Workflow Repository (V1)
|
|
208
|
+
export class X509GitHubWorkflowRepositoryExtension extends X509FulcioExtensionV1 {
|
|
209
|
+
get workflowRepository(): string {
|
|
210
|
+
return this.stringValue;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// OID 1.3.6.1.4.1.57264.1.6 - GitHub Workflow Ref (V1)
|
|
215
|
+
export class X509GitHubWorkflowRefExtension extends X509FulcioExtensionV1 {
|
|
216
|
+
get workflowRef(): string {
|
|
217
|
+
return this.stringValue;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// OID 1.3.6.1.4.1.57264.1.8 - OIDC Issuer (V2)
|
|
222
|
+
export class X509FulcioIssuerV2 extends X509FulcioExtensionV2 {
|
|
223
|
+
get issuer(): string {
|
|
224
|
+
return this.stringValue;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// OID 1.3.6.1.4.1.57264.1.9 - Build Signer URI (V2)
|
|
229
|
+
export class X509BuildSignerURIExtension extends X509FulcioExtensionV2 {
|
|
230
|
+
get buildSignerURI(): string {
|
|
231
|
+
return this.stringValue;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// OID 1.3.6.1.4.1.57264.1.10 - Build Signer Digest (V2)
|
|
236
|
+
export class X509BuildSignerDigestExtension extends X509FulcioExtensionV2 {
|
|
237
|
+
get buildSignerDigest(): string {
|
|
238
|
+
return this.stringValue;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// OID 1.3.6.1.4.1.57264.1.11 - Runner Environment (V2)
|
|
243
|
+
export class X509RunnerEnvironmentExtension extends X509FulcioExtensionV2 {
|
|
244
|
+
get runnerEnvironment(): string {
|
|
245
|
+
return this.stringValue;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// OID 1.3.6.1.4.1.57264.1.12 - Source Repository URI (V2)
|
|
250
|
+
export class X509SourceRepositoryURIExtension extends X509FulcioExtensionV2 {
|
|
251
|
+
get sourceRepositoryURI(): string {
|
|
252
|
+
return this.stringValue;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// OID 1.3.6.1.4.1.57264.1.13 - Source Repository Digest (V2)
|
|
257
|
+
export class X509SourceRepositoryDigestExtension extends X509FulcioExtensionV2 {
|
|
258
|
+
get sourceRepositoryDigest(): string {
|
|
259
|
+
return this.stringValue;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// OID 1.3.6.1.4.1.57264.1.14 - Source Repository Ref (V2)
|
|
264
|
+
export class X509SourceRepositoryRefExtension extends X509FulcioExtensionV2 {
|
|
265
|
+
get sourceRepositoryRef(): string {
|
|
266
|
+
return this.stringValue;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// OID 1.3.6.1.4.1.57264.1.15 - Source Repository Identifier (V2)
|
|
271
|
+
export class X509SourceRepositoryIdentifierExtension extends X509FulcioExtensionV2 {
|
|
272
|
+
get sourceRepositoryIdentifier(): string {
|
|
273
|
+
return this.stringValue;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// OID 1.3.6.1.4.1.57264.1.16 - Source Repository Owner URI (V2)
|
|
278
|
+
export class X509SourceRepositoryOwnerURIExtension extends X509FulcioExtensionV2 {
|
|
279
|
+
get sourceRepositoryOwnerURI(): string {
|
|
280
|
+
return this.stringValue;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// OID 1.3.6.1.4.1.57264.1.17 - Source Repository Owner Identifier (V2)
|
|
285
|
+
export class X509SourceRepositoryOwnerIdentifierExtension extends X509FulcioExtensionV2 {
|
|
286
|
+
get sourceRepositoryOwnerIdentifier(): string {
|
|
287
|
+
return this.stringValue;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// OID 1.3.6.1.4.1.57264.1.18 - Build Config URI (V2)
|
|
292
|
+
export class X509BuildConfigURIExtension extends X509FulcioExtensionV2 {
|
|
293
|
+
get buildConfigURI(): string {
|
|
294
|
+
return this.stringValue;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// OID 1.3.6.1.4.1.57264.1.19 - Build Config Digest (V2)
|
|
299
|
+
export class X509BuildConfigDigestExtension extends X509FulcioExtensionV2 {
|
|
300
|
+
get buildConfigDigest(): string {
|
|
301
|
+
return this.stringValue;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// OID 1.3.6.1.4.1.57264.1.20 - Build Trigger (V2)
|
|
306
|
+
export class X509BuildTriggerExtension extends X509FulcioExtensionV2 {
|
|
307
|
+
get buildTrigger(): string {
|
|
308
|
+
return this.stringValue;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// OID 1.3.6.1.4.1.57264.1.21 - Run Invocation URI (V2)
|
|
313
|
+
export class X509RunInvocationURIExtension extends X509FulcioExtensionV2 {
|
|
314
|
+
get runInvocationURI(): string {
|
|
315
|
+
return this.stringValue;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// OID 1.3.6.1.4.1.57264.1.22 - Source Repository Visibility (V2)
|
|
320
|
+
export class X509SourceRepositoryVisibilityExtension extends X509FulcioExtensionV2 {
|
|
321
|
+
get sourceRepositoryVisibility(): string {
|
|
322
|
+
return this.stringValue;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
180
326
|
// https://www.rfc-editor.org/rfc/rfc6962#section-3.3
|
|
181
327
|
export class X509SCTExtension extends X509Extension {
|
|
182
328
|
constructor(asn1: ASN1Obj) {
|
package/vite.config.ts
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
/// <reference types="vitest" />
|
|
2
2
|
import { defineConfig } from "vite";
|
|
3
|
+
import { resolve } from "path";
|
|
3
4
|
|
|
4
5
|
export default defineConfig({
|
|
5
6
|
build: {
|
|
6
7
|
outDir: "dist",
|
|
7
8
|
target: "esnext",
|
|
9
|
+
minify: "esbuild",
|
|
8
10
|
lib: {
|
|
9
|
-
entry: "src/index.ts",
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
entry: resolve(__dirname, "src/index.ts"),
|
|
12
|
+
name: "SigstoreBrowser",
|
|
13
|
+
formats: ["es", "iife"],
|
|
14
|
+
fileName: (format) => (format === "iife" ? "sigstore.min.js" : "index.js"),
|
|
12
15
|
},
|
|
16
|
+
rollupOptions: {
|
|
17
|
+
output: {
|
|
18
|
+
globals: {},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
sourcemap: true,
|
|
13
22
|
},
|
|
14
23
|
test: {
|
|
15
24
|
globals: true,
|