oci_discovery/fetch_json: Return the final URI along with the JSON#25
Merged
xiekeyang merged 1 commit intoxiekeyang:masterfrom Sep 21, 2017
Merged
Conversation
From [1]: Note that if the retrieval was the result of a redirected request, the last URI used (i.e., the URI that resulted in the actual retrieval of the representation) is the base URI. This fills in remaining Python functionality left off from 5b75a01 (*-template: Cover relative references, 2017-09-18, xiekeyang#21). Ref-engine discovery and ref-engine APIs now also return dicts that include a 'uri' key representing this URI, which allows their consumers to also perform reference resolution. For example, tools consuming the Merkle roots may need the URI from which those roots were extracted in order to resolve a CAS-engine URI reference. [1]: https://tools.ietf.org/html/rfc3986#section-5.1.3
xiekeyang
reviewed
Sep 20, 2017
| "os": "linux" | ||
| }, | ||
| "size": 799 | ||
| "uri": "http://example.com/oci-index/app" |
Owner
There was a problem hiding this comment.
Here needn't protocol entry? Maybe both uri and protocol are all necessary.
Contributor
Author
There was a problem hiding this comment.
Here needn't
protocolentry?
This isn't an engine config, it's the location from which this root was extracted. It would be passed into a subsequent CAS-engine initialization as base, although in this case
.["example.com/app#1.0"].roots[0].root.casEngines[0].uri is a full URI (not a reference), so the base URI won't be needed. It helps with things like:
{
"example.com/app#1.0": {
"roots": [
{
"root": {
...,
"casEngines": [
{
"protocol": "oci-cas-template-v1",
"uri": "../cas/{algorithm}/{encoded:2}/{encoded}"
}
]
},
"uri": "http://example.com/oci-index/app"
}
]
}
}So I don't think we need protocol here; just the base URI(s) for resolving any references in the returned root(s).
Owner
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From here:
This fills in remaining Python functionality left off from #21. Ref-engine discovery and ref-engine APIs now also return dicts that include a
urikey representing this URI, which allows their consumers to also perform reference resolution. For example, tools consuming the Merkle roots may need the URI from which those roots were extracted in order to resolve a CAS-engine URI reference.