77Tools to package up [ Wasm Components] ( https://github.com/webassembly/component-model )
88
99This repo contains several Rust crates that can be used for fetching and publishing Wasm Components
10- to OCI or Warg registries. It is also the home of the ` wkg ` command line tool, which exposes all the
10+ to OCI registries. It is also the home of the ` wkg ` command line tool, which exposes all the
1111functionality of the libraries. The first (but not only) focus of this project is allow for fetching
1212of Wit Interfaces stored as components for use in creating components. It can also be used to fetch
1313and publish component "libraries" to/from a registry.
@@ -94,24 +94,9 @@ another = { registry = "another", metadata = { preferredProtocol = "oci", "oci"
9494# Same as namespace_registries above, but for a specific package.
9595"example:bar" = { registry = " another" , metadata = { preferredProtocol = " oci" , "oci" = {registry = " ghcr.io" , namespacePrefix = " webassembly/" } } }
9696
97- # This section contains a mapping of registries to their configuration. There are currently 3
98- # supported types of registries: "oci", "warg", and "local". The "oci" type is the default. The
99- # example below shows a use case that isn't yet super common (registries that speak multiple protocols)
100- # but is included for completeness.
97+ # This section contains a mapping of registries to their configuration. There are currently 2
98+ # supported types of registries: "oci" and "local". The "oci" type is the default.
10199[registry ."acme .registry .com" ]
102- # This field is only required if more that one protocol is supported. It indicates which protocol
103- # to use by default. If this is not set, then the fallback (oci) will be used.
104- default = " warg"
105- [registry ."acme .registry .com" .warg ]
106- # A path to a valid warg config file. If this is not set, the `wkg` CLI (but not the libraries)
107- # will attempt to load the config from the default location(s).
108- config_file = " /a/path"
109- # An optional authentication token to use when authenticating with a registry.
110- auth_token = " an-auth-token"
111- # An optional key for signing the component. Ideally, you should just let warg use the keychain
112- # or programmatically set this key in the config without writing to disk. This offers an escape
113- # hatch for when you need to use a key that isn't in the keychain.
114- signing_key = " ecdsa-p256:2CV1EpLaSYEn4In4OAEDAj5O4Hzu8AFAxgHXuG310Ew="
115100[registry ."acme .registry .com" .oci ]
116101# The auth field can either be a username/password pair, or a base64 encoded `username:password`
117102# string. If no auth is set, the `wkg` CLI (but not the libraries) will also attempt to load the
@@ -131,11 +116,11 @@ root = "/a/path"
131116# If a registry only has a config section for one protocol, then that protocol is automatically
132117# the default. The following is equivalent to:
133118# [registry."example.com"]
134- # default = "warg "
135- # [registry."example.com".warg ]
136- # config_file = "/a/path"
137- [registry ."example .com" .warg ]
138- config_file = " /a/path "
119+ # default = "oci "
120+ # [registry."example.com".oci ]
121+ # auth = { username = "open", password = "sesame" }
122+ [registry ."example .com" .oci ]
123+ auth = { username = " open " , password = " sesame " }
139124
140125# Configuration for the "another" registry defined above.
141126[registry ."another" .oci ]
@@ -155,24 +140,19 @@ A full example of what this `registry.json` file should look like is below:
155140
156141``` json
157142{
158- "preferredProtocol" :" warg" ,
159- "warg" : {"url" :" https://warg.example.com" },
143+ "preferredProtocol" :" oci" ,
160144 "oci" : {"registry" : " ghcr.io" , "namespacePrefix" : " webassembly/" }
161145}
162146```
163147
164148The ` preferredProtocol ` field is optional and specifies which protocol the registry expects you to
165- use in the case where it supports both OCI and Warg. If both ` warg ` and ` oci ` config is in the
166- ` registry.json ` it is _ highly recommended_ that this field be set.
149+ use. While this field is present for future compatibility, it's generally fixed to "oci" in this implementation.
167150
168151For the ` oci ` config, the ` registry ` field is the base URL of the OCI registry, and the
169152` namespacePrefix ` field is the prefix that is used to store components in the registry. So in the
170153example above (which is for wasi.dev), the components will be available at
171154` ghcr.io/webassembly/$NAMESPACE/$PACKAGE:$VERSION ` (e.g. ` ghcr.io/webassembly/wasi/http:0.2.1 ` ).
172155
173- For the ` warg ` config, the ` url ` field is the base URL of the Warg registry used when connecting the
174- client. Namespacing for warg is built in to the protocol.
175-
176156Please note that for backwards compatibility, with previous tooling and versions of the ` wkg ` tool,
177157you may also encounter a ` registry.json ` file that looks different. These files are still supported,
178158but should be considered deprecated.
@@ -186,16 +166,6 @@ For OCI registries, the JSON looks like this:
186166}
187167```
188168
189-
190-
191- For Warg registries, the JSON looks like this:
192-
193- ``` json
194- {
195- "wargUrl" : " https://warg.wa.dev"
196- }
197- ```
198-
199169### Conventions for storing components in OCI
200170
201171Astute observers will note that OCI requires a specific structure for how those components are
0 commit comments