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

Update media type for attach attestation command #1494

Closed
spiffcs opened this issue Feb 22, 2022 · 1 comment · Fixed by #1503
Closed

Update media type for attach attestation command #1494

spiffcs opened this issue Feb 22, 2022 · 1 comment · Fixed by #1503
Labels
bug Something isn't working

Comments

@spiffcs
Copy link
Contributor

spiffcs commented Feb 22, 2022

Description

When I was using the cosign attach attestation command I saw in the code that layer media type is always going to be ctypes.SimpleSigningMediaType.

att, err := static.NewAttestation(payload)
if err != nil {
return err
}

func NewSignature(payload []byte, b64sig string, opts ...Option) (oci.Signature, error) {
o, err := makeOptions(opts...)
if err != nil {
return nil, err
}

func makeOptions(opts ...Option) (*options, error) {
o := &options{
LayerMediaType: ctypes.SimpleSigningMediaType,
ConfigMediaType: types.OCIConfigJSON,
Annotations: make(map[string]string),

Per the specification here, I was wondering if I could make a change so that the media type can be changed in this constructor. When the cosign attach attestation command is used I believe that the type should be application/vnd.dsse.envelope.v1+json

If this is not correct I can close this issue. If this does need follow-up I can create a PR today to update the command to use the correct media type.

Thanks again!

@spiffcs spiffcs added the bug Something isn't working label Feb 22, 2022
@spiffcs spiffcs changed the title Concise description of the bug Update media type for attestation command Feb 22, 2022
@dlorenc
Copy link
Member

dlorenc commented Feb 22, 2022

It looks like this is indeed a bug! A fix would be welcomed.

@spiffcs spiffcs changed the title Update media type for attestation command Update media type for attach attestation command Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants