Skip to content

Commit

Permalink
include subject/artifactType in ECR manifest (#1058)
Browse files Browse the repository at this point in the history
Signed-off-by: Brian DeHamer <[email protected]>
  • Loading branch information
bdehamer authored Mar 8, 2024
1 parent d1f0f5a commit ee3a521
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/clean-chefs-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sigstore/oci": minor
---

Include `subject` and `artifactType` fields in artifact manifest for AWS ECR
11 changes: 3 additions & 8 deletions packages/oci/src/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ee3a521

Please sign in to comment.