Skip to content

Commit 5bb1577

Browse files
committed
fix: missing http extensions and wit update
Signed-off-by: Shriti Priya <shritip@ibm.com>
1 parent b14910a commit 5bb1577

4 files changed

Lines changed: 15 additions & 1 deletion

File tree

crates/cpex-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ zeroize = { version = "1.8", features = ["zeroize_derive"] }
4242
tokio = { workspace = true, optional = true }
4343
tokio-util = { workspace = true, optional = true }
4444
arc-swap = { workspace = true, optional = true }
45-
cpex-orchestration = { path = "../cpex-orchestration", optional = true }
45+
cpex-orchestration = { workspace = true, optional = true }
4646

4747
[lints]
4848
workspace = true

crates/cpex-core/src/elicitation/payload.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ use std::collections::HashMap;
5555

5656
use serde::{Deserialize, Serialize};
5757

58+
#[cfg(feature = "runtime")]
5859
use crate::executor::PipelineResult;
5960
use crate::impl_plugin_payload;
6061

@@ -274,6 +275,7 @@ impl ElicitationPayload {
274275

275276
// -------- Host-side application helper --------
276277

278+
#[cfg(feature = "runtime")]
277279
/// Pull the resolved `ElicitationPayload` out of a `PipelineResult`
278280
/// returned by `mgr.invoke_entries::<ElicitationHook>(...)`. Returns
279281
/// `None` when the pipeline was denied or the result's payload wasn't

crates/cpex-wasm-plugin/src/conversions.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ pub fn wit_extensions_to_native(ext: Extensions) -> NativeExtensions {
211211
http: ext.http.map(|h| Arc::new(NativeHttpExtension {
212212
request_headers: h.request_headers.into_iter().collect(),
213213
response_headers: h.response_headers.into_iter().collect(),
214+
method: h.method,
215+
path: h.path,
216+
host: h.host,
217+
scheme: h.scheme,
214218
})),
215219
meta: ext.meta.map(|m| Arc::new(NativeMetaExtension {
216220
entity_type: m.entity_type,
@@ -710,6 +714,10 @@ fn native_owned_extensions_to_wit(
710714
http: ext.http.as_ref().map(|h| HttpExtension {
711715
request_headers: h.read().request_headers.iter().map(|(k, v)| (k.clone(), v.clone())).collect(),
712716
response_headers: h.read().response_headers.iter().map(|(k, v)| (k.clone(), v.clone())).collect(),
717+
method: h.read().method.clone(),
718+
path: h.read().path.clone(),
719+
host: h.read().host.clone(),
720+
scheme: h.read().scheme.clone(),
713721
}),
714722
meta: ext.meta.as_ref().map(|m| MetaExtension {
715723
entity_type: m.entity_type.clone(),

crates/cpex-wasm-plugin/wit/world.wit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,10 @@ interface types {
419419
record http-extension {
420420
request-headers: list<tuple<string, string>>,
421421
response-headers: list<tuple<string, string>>,
422+
method: option<string>,
423+
path: option<string>,
424+
host: option<string>,
425+
scheme: option<string>,
422426
}
423427

424428
record meta-extension {

0 commit comments

Comments
 (0)