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

Payload Mediatype and certificate thumbprint annotation constants are not exported for API consumers #398

Open
c-grund opened this issue Apr 15, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@c-grund
Copy link

c-grund commented Apr 15, 2024

What is not working as expected?

The constants defined in internal/envelope/envelope.go

MediaTypePayloadV1            = "application/vnd.cncf.notary.payload.v1+json"
AnnotationX509ChainThumbprint = "io.cncf.notary.x509chain.thumbprint#S256"

are not exported, and therefore not available for consumers of the sign and verify API. Since these are required values per the specification, programs that wish to work with notation signatures must duplicate these constants.

What did you expect to happen?

These constants should be available through a public notation-go or notation-core-go export

How can we reproduce it?

Attempt to access these required constant values from external code.

Describe your environment

Linux/Go 1.22

What is the version of your notation-go Library?

notation-go v1.1.0
notation-core-go v1.0.2

@c-grund c-grund added bug Something isn't working triage Needs evaluation for feasibility, timeline, etc. labels Apr 15, 2024
@yizha1 yizha1 added enhancement New feature or request and removed bug Something isn't working triage Needs evaluation for feasibility, timeline, etc. labels Apr 16, 2024
@Two-Hearts
Copy link
Contributor

That's a good idea.
@c-grund may I ask what you are trying to do that requires the export of these two variables?

@c-grund
Copy link
Author

c-grund commented Apr 18, 2024

I'm working on set of tools that can sign and verify signed custom oci objects (among other things). We're using notation as a library for one of the signature formats. Despite performing sign/verify through the API, we want to maintain compatibility with the Notation CLI for performing those functions, and thus wish to stick close to the spec. The constants referred to here are marked as MUST items, so we'd rather not redefine them in our code.

@yizha1 yizha1 added this to the 1.3.0 milestone Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

3 participants