Skip to content

Commit

Permalink
default to creating v0.2 Sigstore bundles (#644)
Browse files Browse the repository at this point in the history
Signed-off-by: Brian DeHamer <[email protected]>
  • Loading branch information
bdehamer authored Aug 25, 2023
1 parent 0605444 commit 70cb986
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
7 changes: 7 additions & 0 deletions .changeset/polite-donuts-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@sigstore/bundle': minor
'@sigstore/sign': minor
'sigstore': minor
---

Generate v0.2 Sigstore bundles
17 changes: 5 additions & 12 deletions packages/bundle/src/__tests__/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
import { HashAlgorithm } from '@sigstore/protobuf-specs';
import assert from 'assert';
import { toDSSEBundle, toMessageSignatureBundle } from '../build';
import { BUNDLE_V02_MEDIA_TYPE } from '../bundle';

const signature = Buffer.from('signature');
const keyHint = 'hint';
Expand All @@ -32,9 +33,7 @@ describe('toMessageSignatureBundle', () => {
});

expect(b).toBeTruthy();
expect(b.mediaType).toEqual(
'application/vnd.dev.sigstore.bundle+json;version=0.1'
);
expect(b.mediaType).toEqual(BUNDLE_V02_MEDIA_TYPE);

assert(b.content?.$case === 'messageSignature');
expect(b.content.messageSignature).toBeTruthy();
Expand Down Expand Up @@ -70,9 +69,7 @@ describe('toDSSEBundle', () => {
});

expect(b).toBeTruthy();
expect(b.mediaType).toEqual(
'application/vnd.dev.sigstore.bundle+json;version=0.1'
);
expect(b.mediaType).toEqual(BUNDLE_V02_MEDIA_TYPE);

assert(b.content?.$case === 'dsseEnvelope');
expect(b.content.dsseEnvelope).toBeTruthy();
Expand All @@ -98,9 +95,7 @@ describe('toDSSEBundle', () => {
});

expect(b).toBeTruthy();
expect(b.mediaType).toEqual(
'application/vnd.dev.sigstore.bundle+json;version=0.1'
);
expect(b.mediaType).toEqual(BUNDLE_V02_MEDIA_TYPE);

assert(b.content?.$case === 'dsseEnvelope');
expect(b.content.dsseEnvelope).toBeTruthy();
Expand All @@ -127,9 +122,7 @@ describe('toDSSEBundle', () => {
});

expect(b).toBeTruthy();
expect(b.mediaType).toEqual(
'application/vnd.dev.sigstore.bundle+json;version=0.1'
);
expect(b.mediaType).toEqual(BUNDLE_V02_MEDIA_TYPE);

assert(b.content?.$case === 'dsseEnvelope');
expect(b.content.dsseEnvelope).toBeTruthy();
Expand Down
6 changes: 3 additions & 3 deletions packages/bundle/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { HashAlgorithm } from '@sigstore/protobuf-specs';
import { BUNDLE_V01_MEDIA_TYPE } from './bundle';
import { BUNDLE_V02_MEDIA_TYPE } from './bundle';

import type { Envelope, Signature } from '@sigstore/protobuf-specs';
import type {
Expand Down Expand Up @@ -46,7 +46,7 @@ export function toMessageSignatureBundle(
options: MessageSignatureBundleOptions
): BundleWithMessageSignature {
return {
mediaType: BUNDLE_V01_MEDIA_TYPE,
mediaType: BUNDLE_V02_MEDIA_TYPE,
content: {
$case: 'messageSignature',
messageSignature: {
Expand All @@ -67,7 +67,7 @@ export function toDSSEBundle(
options: DSSEBundleOptions
): BundleWithDsseEnvelope {
return {
mediaType: BUNDLE_V01_MEDIA_TYPE,
mediaType: BUNDLE_V02_MEDIA_TYPE,
content: {
$case: 'dsseEnvelope',
dsseEnvelope: toEnvelope(options),
Expand Down
4 changes: 2 additions & 2 deletions packages/sign/src/__tests__/bundler/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe('BaseBundleBuilder', () => {

expect(bundle).toBeTruthy();
expect(bundle.mediaType).toEqual(
'application/vnd.dev.sigstore.bundle+json;version=0.1'
'application/vnd.dev.sigstore.bundle+json;version=0.2'
);
expect(bundle.content).toBeTruthy();
expect(bundle.verificationMaterial).toBeTruthy();
Expand Down Expand Up @@ -238,7 +238,7 @@ describe('BaseBundleBuilder', () => {

expect(bundle).toBeTruthy();
expect(bundle.mediaType).toEqual(
'application/vnd.dev.sigstore.bundle+json;version=0.1'
'application/vnd.dev.sigstore.bundle+json;version=0.2'
);
expect(bundle.content).toBeTruthy();
expect(bundle.verificationMaterial).toBeTruthy();
Expand Down
8 changes: 4 additions & 4 deletions packages/sign/src/__tests__/bundler/bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('toMessageSignatureBundle', () => {

expect(b).toBeTruthy();
expect(b.mediaType).toEqual(
'application/vnd.dev.sigstore.bundle+json;version=0.1'
'application/vnd.dev.sigstore.bundle+json;version=0.2'
);

assert(b.content?.$case === 'messageSignature');
Expand Down Expand Up @@ -84,7 +84,7 @@ describe('toDSSEBundle', () => {

expect(b).toBeTruthy();
expect(b.mediaType).toEqual(
'application/vnd.dev.sigstore.bundle+json;version=0.1'
'application/vnd.dev.sigstore.bundle+json;version=0.2'
);

assert(b.content?.$case === 'dsseEnvelope');
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('toDSSEBundle', () => {

expect(b).toBeTruthy();
expect(b.mediaType).toEqual(
'application/vnd.dev.sigstore.bundle+json;version=0.1'
'application/vnd.dev.sigstore.bundle+json;version=0.2'
);

assert(b.content?.$case === 'dsseEnvelope');
Expand Down Expand Up @@ -152,7 +152,7 @@ describe('toDSSEBundle', () => {

expect(b).toBeTruthy();
expect(b.mediaType).toEqual(
'application/vnd.dev.sigstore.bundle+json;version=0.1'
'application/vnd.dev.sigstore.bundle+json;version=0.2'
);

assert(b.content?.$case === 'dsseEnvelope');
Expand Down
4 changes: 2 additions & 2 deletions packages/sign/src/__tests__/bundler/dsse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('DSSEBundleBuilder', () => {

expect(b).toBeTruthy();
expect(b.mediaType).toEqual(
'application/vnd.dev.sigstore.bundle+json;version=0.1'
'application/vnd.dev.sigstore.bundle+json;version=0.2'
);

expect(b.content.dsseEnvelope).toBeTruthy();
Expand Down Expand Up @@ -106,7 +106,7 @@ describe('DSSEBundleBuilder', () => {

expect(b).toBeTruthy();
expect(b.mediaType).toEqual(
'application/vnd.dev.sigstore.bundle+json;version=0.1'
'application/vnd.dev.sigstore.bundle+json;version=0.2'
);

expect(b.content.dsseEnvelope).toBeTruthy();
Expand Down
2 changes: 1 addition & 1 deletion packages/sign/src/__tests__/bundler/message.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('MessageSignatureBundleBuilder', () => {

expect(b).toBeTruthy();
expect(b.mediaType).toEqual(
'application/vnd.dev.sigstore.bundle+json;version=0.1'
'application/vnd.dev.sigstore.bundle+json;version=0.2'
);

expect(b.content.messageSignature).toBeTruthy();
Expand Down

0 comments on commit 70cb986

Please sign in to comment.