-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cas-template: Define and register the oci-cas-template-v1 protocol
And allow casEngines in the ref-engine discovery response, supporting folks who want to defer to a ref-engine that is hard/impossible to update (e.g. index JSON on someone else's server for a oci-index-template-v1 ref engine) but who still want to provide their own CAS engine hints.
- Loading branch information
Showing
4 changed files
with
98 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## CAS-engine protocols | ||
|
||
There are many possible [CAS][] engine protocols. | ||
Having identifiers for the protocols provides a standardized way to share structured connection information. | ||
Consumers can then prefer CAS engines which implement their favorite protocol and use the appropriate API to connect to them. | ||
|
||
This section registers known protocol identifiers and maps them to their specification. | ||
Anyone may submit new CAS-engine protocol identifiers for registration. | ||
|
||
| Protocol identifier | Specification | | ||
|-------------------------|---------------------------------------------------------| | ||
| `oci-cas-template-v1` | [OCI CAS template protocol, version 1](cas-template.md) | | ||
|
||
[CAS]: https://en.wikipedia.org/wiki/Content-addressable_storage |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# OCI CAS Template Protocol | ||
|
||
This is version 1 of this specification. | ||
|
||
The CAS-template protocol is configured via a single [URI Template][rfc6570]. | ||
When configured via a [`casEngines` entry](ref-engine-discovery.md#ref-engines-objects), the `uri` property MUST be set, and its value is the URI Template. | ||
|
||
For a given blob digest, consumers MUST provide at least the following variables: | ||
|
||
* `digest`, matching `digest` in the [`digest` rule][digest]. | ||
* `algorithm`, matching `algorithm` in the `digest` rule. | ||
* `encoded`, matching `encoded` in the `digest` rule. | ||
|
||
and expand the URI Template as defined in [RFC 6570 section 3][rfc6570-s3]. | ||
|
||
## Example | ||
|
||
An example [`casEngines` entry](ref-engine-discovery.md#ref-engines-objects) using the [registered `oci-cas-template-v1` protocol identifier](cas-engine-protocols.md) is: | ||
|
||
```json | ||
{ | ||
"protocol": "oci-cas-template-v1", | ||
"uri": "https://a.example.com/cas/{algorithm}/{encoded:2}/{encoded}" | ||
} | ||
``` | ||
|
||
A digest like `sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` matches [`digest`][digest] with: | ||
|
||
* `sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` as `digest`, | ||
* `sha256` as `algorithm`, and | ||
* `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` as `encoded` | ||
|
||
so the expanded URI is: | ||
|
||
https://a.example.com/cas/sha256/e3/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 | ||
|
||
[digest]: https://github.com/opencontainers/image-spec/blob/v1.0.0/descriptor.md#digests | ||
[rfc6570]: https://tools.ietf.org/html/rfc6570 | ||
[rfc6570-s3]: https://tools.ietf.org/html/rfc6570#section-3 |
This file contains 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
This file contains 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