Skip to content

Commit 6abe9ec

Browse files
authoredJul 17, 2023
Fix bug w/ threshold verification options (#616)
Signed-off-by: Brian DeHamer <bdehamer@github.com>
1 parent a88a986 commit 6abe9ec

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed
 

‎.changeset/dull-cougars-prove.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'sigstore': patch
3+
---
4+
5+
Fix bug when setting `tlogThreshold`/`ctLogThreshold` verification options to 0

‎packages/client/src/__tests__/config.test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,17 @@ describe('artifactVerificationOptions', () => {
107107
'1.2.3.4': 'value1',
108108
'5.6.7.8': 'value2',
109109
},
110-
ctLogThreshold: 2,
111-
tlogThreshold: 3,
110+
ctLogThreshold: 0,
111+
tlogThreshold: 0,
112112
};
113113

114114
it('returns the expected options', () => {
115115
const result = artifactVerificationOptions(options);
116-
expect(result.ctlogOptions.disable).toBe(false);
117-
expect(result.ctlogOptions.threshold).toBe(2);
116+
expect(result.ctlogOptions.disable).toBe(true);
117+
expect(result.ctlogOptions.threshold).toBe(0);
118118
expect(result.ctlogOptions.detachedSct).toBe(false);
119-
expect(result.tlogOptions.disable).toBe(false);
120-
expect(result.tlogOptions.threshold).toBe(3);
119+
expect(result.tlogOptions.disable).toBe(true);
120+
expect(result.tlogOptions.threshold).toBe(0);
121121
expect(result.tlogOptions.performOnlineVerification).toBe(false);
122122
expect(result.signers).toBeDefined();
123123

‎packages/client/src/config.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,13 @@ export function artifactVerificationOptions(
157157
// Construct the artifact verification options w/ defaults
158158
return {
159159
ctlogOptions: {
160-
disable: false,
161-
threshold: options.ctLogThreshold || 1,
160+
disable: options.ctLogThreshold === 0,
161+
threshold: options.ctLogThreshold ?? 1,
162162
detachedSct: false,
163163
},
164164
tlogOptions: {
165-
disable: false,
166-
threshold: options.tlogThreshold || 1,
165+
disable: options.tlogThreshold === 0,
166+
threshold: options.tlogThreshold ?? 1,
167167
performOnlineVerification: false,
168168
},
169169
signers,

0 commit comments

Comments
 (0)
Please sign in to comment.