Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bdehamer opened this issue Mar 8, 2024 · 2 comments
Open

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

bdehamer opened this issue Mar 8, 2024 · 2 comments
Labels
Proposed Community submitted issue

Comments

@bdehamer
Copy link

bdehamer commented Mar 8, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction 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:

{
  "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 has the following to say about the artifactType field:

If defined, the value MUST comply with RFC 6838, including the naming requirements in its section 4.2...

RFC 6838 includes support for media type parameters (section 4.4section 4.3) so it would seem that my media type is compliant with the spec.

Related: #308

@bdehamer bdehamer added the Proposed Community submitted issue label Mar 8, 2024
@kattmang
Copy link

kattmang commented Mar 9, 2024

Hey @bdehamer ,
I believe the section relevant to the break here is actually 4.3 in the RFC spec: https://datatracker.ietf.org/doc/html/rfc6838#section-4.3

I've confirmed internally this is likely a bug on our side, and we'll let you know when we've rolled out a fix.

@yanivpaz
Copy link

yanivpaz commented Jun 8, 2024

Hi @kattmang is there ETA for this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Proposed Community submitted issue
Projects
None yet
Development

No branches or pull requests

3 participants