diff --git a/.changeset/clean-chefs-impress.md b/.changeset/clean-chefs-impress.md new file mode 100644 index 00000000..e41314fc --- /dev/null +++ b/.changeset/clean-chefs-impress.md @@ -0,0 +1,5 @@ +--- +"@sigstore/oci": minor +--- + +Include `subject` and `artifactType` fields in artifact manifest for AWS ECR diff --git a/packages/oci/src/image.ts b/packages/oci/src/image.ts index 0019bbd3..5dc7148a 100644 --- a/packages/oci/src/image.ts +++ b/packages/oci/src/image.ts @@ -90,20 +90,15 @@ export class OCIImage { /* istanbul ignore if */ if (this.#downgrade) { - delete manifest.subject; - delete manifest.artifactType; - // ECR can't handle media types with parameters, so we need to strip the // version parameter from the Sigstore bundle media type. + manifest.artifactType = manifest.artifactType + ? manifest.artifactType.replace(/;.*/, '') + : undefined; manifest.layers[0].mediaType = manifest.layers[0].mediaType.replace( /;.*/, '' ); - - // ECR can't handle the "application/vnd.oci.empty.v1+json" media type - // for the config blob defined in OCI 1.1, so we need to use the Docker - // V2 API media type - manifest.config.mediaType = 'application/vnd.oci.image.config.v1+json'; } // Upload artifact manifest