1
1
"use strict" ;
2
2
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
3
- exports . assertBundleLatest = exports . assertBundleV02 = exports . isBundleV01 = exports . assertBundleV01 = exports . assertBundle = void 0 ;
3
+ exports . assertBundle = assertBundle ;
4
+ exports . assertBundleV01 = assertBundleV01 ;
5
+ exports . isBundleV01 = isBundleV01 ;
6
+ exports . assertBundleV02 = assertBundleV02 ;
7
+ exports . assertBundleLatest = assertBundleLatest ;
4
8
/*
5
9
Copyright 2023 The Sigstore Authors.
6
10
@@ -27,7 +31,6 @@ function assertBundle(b) {
27
31
throw new error_1 . ValidationError ( 'invalid bundle' , invalidValues ) ;
28
32
}
29
33
}
30
- exports . assertBundle = assertBundle ;
31
34
// Asserts that the given bundle conforms to the v0.1 bundle format.
32
35
function assertBundleV01 ( b ) {
33
36
const invalidValues = [ ] ;
@@ -37,7 +40,6 @@ function assertBundleV01(b) {
37
40
throw new error_1 . ValidationError ( 'invalid v0.1 bundle' , invalidValues ) ;
38
41
}
39
42
}
40
- exports . assertBundleV01 = assertBundleV01 ;
41
43
// Type guard to determine if Bundle is a v0.1 bundle.
42
44
function isBundleV01 ( b ) {
43
45
try {
@@ -48,7 +50,6 @@ function isBundleV01(b) {
48
50
return false ;
49
51
}
50
52
}
51
- exports . isBundleV01 = isBundleV01 ;
52
53
// Asserts that the given bundle conforms to the v0.2 bundle format.
53
54
function assertBundleV02 ( b ) {
54
55
const invalidValues = [ ] ;
@@ -58,7 +59,6 @@ function assertBundleV02(b) {
58
59
throw new error_1 . ValidationError ( 'invalid v0.2 bundle' , invalidValues ) ;
59
60
}
60
61
}
61
- exports . assertBundleV02 = assertBundleV02 ;
62
62
// Asserts that the given bundle conforms to the newest (0.3) bundle format.
63
63
function assertBundleLatest ( b ) {
64
64
const invalidValues = [ ] ;
@@ -69,7 +69,6 @@ function assertBundleLatest(b) {
69
69
throw new error_1 . ValidationError ( 'invalid bundle' , invalidValues ) ;
70
70
}
71
71
}
72
- exports . assertBundleLatest = assertBundleLatest ;
73
72
function validateBundleBase ( b ) {
74
73
const invalidValues = [ ] ;
75
74
// Media type validation
@@ -192,6 +191,7 @@ function validateInclusionProof(b) {
192
191
// Necessary for V03 and later bundles
193
192
function validateNoCertificateChain ( b ) {
194
193
const invalidValues = [ ] ;
194
+ /* istanbul ignore next */
195
195
if ( b . verificationMaterial ?. content ?. $case === 'x509CertificateChain' ) {
196
196
invalidValues . push ( 'verificationMaterial.content.$case' ) ;
197
197
}
0 commit comments