From 9b4f1d6858a3f2a166e609620b1a822e7246e14c Mon Sep 17 00:00:00 2001 From: karthik2804 Date: Sun, 22 Sep 2024 16:28:54 +0200 Subject: [PATCH] allow satisfying component dependencies via http source Signed-off-by: karthik2804 --- crates/loader/src/local.rs | 8 ++++++++ crates/manifest/src/schema/v2.rs | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/crates/loader/src/local.rs b/crates/loader/src/local.rs index 3d5bb6304b..bc4e5ca2b1 100644 --- a/crates/loader/src/local.rs +++ b/crates/loader/src/local.rs @@ -313,6 +313,14 @@ impl LocalLoader { let content = file_content_ref(self.app_root.join(path))?; (content, export) } + v2::ComponentDependency::HTTP { + url, + digest, + export, + } => { + let content = self.load_http_source(&url, &digest).await?; + (content, export) + } }; Ok(LockedComponentDependency { diff --git a/crates/manifest/src/schema/v2.rs b/crates/manifest/src/schema/v2.rs index 4397dbccc3..61d0ac0f47 100644 --- a/crates/manifest/src/schema/v2.rs +++ b/crates/manifest/src/schema/v2.rs @@ -135,6 +135,15 @@ pub enum ComponentDependency { /// Optional export name export: Option, }, + /// `... = { url = "https://example.com/component.wasm", sha256 = "..." }` + HTTP { + /// URL to Wasm + url: String, + /// SHA256 Checksum of the component. The string should start with 'sha256:' + digest: String, + /// Optional export name + export: Option, + }, } /// Component definition