aws / aws/containers-roadmap

[ECR] [request]: Loosen restrictions on accepted media types

Open
#2,306 2 comments 14 reactions 0 assignees View on GitHub
ECR Proposed
Dominant language
Shell
Stars
5.4k
Forks
334
PR merge metrics
No merged PRs in 30d

Description

### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

**Tell us about your request**
I'd like for ECR to be less strict about the media type value which are accepted in the `artifactType` and layer `mediaType` fields in the image manifest.

**Which service(s) is this request for?**
ECR

**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
I'm trying to push the following manifest into ECR:

```json
{
"annotations": {
"org.opencontainers.image.created": "2024-03-08T19:12:54Z"
},
"artifactType": "application/vnd.dev.sigstore.bundle+json;version=0.2",
"config": {
"digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
"mediaType": "application/vnd.oci.empty.v1+json",
"size": 2
},
"layers": [
{
"annotations": {
"org.opencontainers.image.title": "att.json"
},
"digest": "sha256:d1c3842b99b57095dccfb71e590003e2a66c701a8eff20ffd7cba1ae07e3fd3d",
"mediaType": "application/vnd.dev.sigstore.bundle+json;version=0.2",
"size": 5752
}
],
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"schemaVersion": 2,
"subject": {
"digest": "sha256:221189b511bd1b01a233c9af11467cddb722347a2bef2162385b34034f78d212",
"mediaType": "application/vnd.oci.image.index.v1+json",
"size": 855
}
}
```

The response I get is:
```
405 Method Not Allowed

{"errors":[{"code":"UNSUPPORTED","message":"Invalid parameter at 'ImageManifest' failed to satisfy constraint: 'Invalid JSON syntax'"}]}
```

The issue appears to be the `;version=0.2` portion of my media type -- if I remove that parameter, the manifest can be uploaded successfully.

**Are you currently working around this issue?**
The only work-around I have at the moment is to re-write my media type strings and remove the `version` parameter, but this is critical data I'd rather not lose.

**Additional context**
The OCI [image spec](https://github.com/opencontainers/image-spec/blob/main/manifest.md#image-manifest-property-descriptions) has the following to say about the `artifactType` field:

> If defined, the value MUST comply with [RFC 6838](https://tools.ietf.org/html/rfc6838), including the [naming requirements in its section 4.2](https://tools.ietf.org/html/rfc6838#section-4.2)...

RFC 6838 includes support for media type parameters (~[section 4.4](https://datatracker.ietf.org/doc/html/rfc6838#section-4.3)~[section 4.3](https://datatracker.ietf.org/doc/html/rfc6838#section-4.3)) so it would seem that my media type is compliant with the spec.

Related: https://github.com/aws/containers-roadmap/issues/308

Contributor guide

Open the contributing guide

Research direction

Start with the OCI image manifest example and RFC 6838 links in the issue, then review related issue #308. Confirm whether parameterized media types are valid for artifactType and layer mediaType, and establish the expected ECR behavior or a maintainer-confirmed next step.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.