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

Proposal for generic reverse lookup #14

Merged
merged 4 commits into from
Apr 4, 2021

Conversation

aviral26
Copy link

@aviral26 aviral26 commented Sep 9, 2020

Add a proposal for tracking referrer metadata for each manifest and using this ability to store and retrieve signatures. The idea is illustrated using a prototype implementation.

Signed-off-by: Aviral Takkar <aviral26@users.noreply.github.com>
SteveLasker and others added 3 commits September 20, 2020 22:46
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Aviral Takkar <aviral26@users.noreply.github.com>
Update to reflect current prototype

## Persisting Referrer Metadata (Signatures)

The proposal implements a referrer metadata store for manifests that is essentially a reverse-lookup, by `mediaType`, to referrer config objects. For example, when an OCI index is pushed, if it references a config object of media type `application/vnd.cncf.notary.config.v2+jwt`, a link to the config object is recorded in the referrer metadata store of each referenced manifest.
Copy link

@reasonerjt reasonerjt Sep 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you generate the response in section referrer-metadata API with such data structure? IMO the linkage is between the referrer and the manifest, rather than between the config object of the referrer and the manifest.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @SteveLasker to comment on the requirement for including complete descriptors in the response

@reasonerjt , you're right. The linkage is between the referrer and the manifest. However, with this approach, we get some optimization for referrer metadata lookups since clients would ask for referrer config objects when requesting signatures. What scenarios would require a client to query the list of referrers for a manifest?


```shell
# Retrieve first signature and store it locally
metadataDigest=`curl -s "http://$registry/v2/$repo/manifests/$manifestDigest/referrer-metadata?media-type=$metadataMediaType" | jq -r '.referrerMetadata[0]'` && \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the response is not consistent with the one in the section referrer-metadata API

### referrer-metadata API

```HTTP
`GET http://localhost:5000/v2/net-monitor/manifests/11wma2d22ae5ef400769fa51c84717264cd1520ac8d93dc071374c1be49a11wm/referrer-metadata`
Copy link

@reasonerjt reasonerjt Sep 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From API's perspective, IMHO, it would be a better design if we first introduce the referrer API, which returns all referrer, including the optionally selected metadata, such as the digest of config blob.
The caller may filter the result by adding config-mediaType to the query string.

More like the option 1 you described in #13

@SteveLasker
Copy link
Contributor

@reasonerjt, we've moved onto prototype-2, which implements the current oci.artifact.manifest or #29

I'm going to merge this one, just as we're no longer making changes to prototype-1. Please review https://github.com/notaryproject/nv2/tree/prototype-2 and open any issues you'd like to see discussed.

@SteveLasker SteveLasker closed this Apr 4, 2021
@SteveLasker SteveLasker reopened this Apr 4, 2021
@SteveLasker SteveLasker merged commit ce9e2e7 into notaryproject:prototype-1 Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants