*-template: Cover relative references#21
Merged
xiekeyang merged 1 commit intoxiekeyang:masterfrom Sep 19, 2017
Merged
Conversation
As discussed in [1,2]. This allows for entries that can move with the
base content. For example, you could have a ref-engines object at
file:///srv/app/ref-engines.json with content like:
{
"refEngines": [
{
"protocol": "oci-index-template-v1",
"uri": "index.json"
}
],
"casEngines": [
{
"protocol": "oci-cas-template-v1",
"uri": "blobs/{algorithm}/{encoded}"
}
]
}
that now expands to file:///srv/app/index.json,
file:///srv/app/blobs/sha256/e97..., etc. And those references would
still expand correctly if you moved the whole /srv/app directory to
/srv/new-app and referenced the ref-engines object from
file:///srv/new-app/ref-engines.json.
[1]: https://tools.ietf.org/html/rfc3986#section-4.2
[2]: https://tools.ietf.org/html/rfc3986#section-5
Contributor
Author
|
The Go implementation of RFC 3986's relative resolution is |
Owner
|
LGTM |
wking
added a commit
to wking/oci-discovery
that referenced
this pull request
Sep 20, 2017
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
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.
As discussed here and here. This allows for entries that can move with the base content. For example, you could have a ref-engines object at
file:///srv/app/ref-engines.jsonwith content like:{ "refEngines": [ { "protocol": "oci-index-template-v1", "uri": "index.json" } ], "casEngines": [ { "protocol": "oci-cas-template-v1", "uri": "blobs/{algorithm}/{encoded}" } ] }that now expands to
file:///srv/app/index.json,file:///srv/app/blobs/sha256/e97…, etc. And those references would still expand correctly if you moved the whole/srv/appdirectory to/srv/new-appand referenced the ref-engines object fromfile:///srv/new-app/ref-engines.json.