Skip to content

Commit

Permalink
Merge pull request #2854 from karthik2804/http_source_cdeps
Browse files Browse the repository at this point in the history
allow satisfying component dependencies via http source
  • Loading branch information
fibonacci1729 authored Sep 23, 2024
2 parents 1250749 + 9b4f1d6 commit 6df7262
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/loader/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 9 additions & 0 deletions crates/manifest/src/schema/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ pub enum ComponentDependency {
/// Optional export name
export: Option<String>,
},
/// `... = { 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<String>,
},
}

/// Component definition
Expand Down

0 comments on commit 6df7262

Please sign in to comment.