@@ -17,7 +17,7 @@ use cpex_core::cmf::{ContentPart, CmfHook, Message, MessagePayload, Role, ToolCa
1717use cpex_core:: context:: PluginContext ;
1818use cpex_core:: error:: { PluginError , PluginViolation } ;
1919use cpex_core:: extensions:: {
20- Guarded , HttpExtension , RequestExtension , SecurityExtension ,
20+ HttpExtension , RequestExtension , SecurityExtension ,
2121} ;
2222use cpex_core:: factory:: { PluginFactory , PluginInstance } ;
2323use cpex_core:: hooks:: adapter:: TypedHandlerAdapter ;
@@ -126,7 +126,7 @@ impl HookHandler<CmfHook> for HeaderInjector {
126126 ) -> PluginResult < MessagePayload > {
127127 // Can see HTTP (has read_headers)
128128 if let Some ( ref http) = extensions. http {
129- println ! ( " [header-injector] HTTP headers visible: {:?}" , http. read ( ) . request_headers) ;
129+ println ! ( " [header-injector] HTTP headers visible: {:?}" , http. request_headers) ;
130130 }
131131
132132 // Can NOT see security subject (no read_subject)
@@ -202,7 +202,7 @@ impl HookHandler<CmfHook> for AuditLogger {
202202 }
203203
204204 if let Some ( ref http) = extensions. http {
205- if let Some ( req_id) = http. read ( ) . get_header ( "X-Request-ID" ) {
205+ if let Some ( req_id) = http. get_header ( "X-Request-ID" ) {
206206 print ! ( "request_id='{}' " , req_id) ;
207207 }
208208 }
@@ -330,8 +330,8 @@ async fn main() {
330330 request_id : Some ( "req-abc-123" . into ( ) ) ,
331331 ..Default :: default ( )
332332 } ) ) ,
333- security : Some ( security) ,
334- http : Some ( Guarded :: new ( http) ) ,
333+ security : Some ( Arc :: new ( security) ) ,
334+ http : Some ( Arc :: new ( http) ) ,
335335 meta : Some ( Arc :: new ( MetaExtension {
336336 entity_type : Some ( "tool" . into ( ) ) ,
337337 entity_name : Some ( "get_compensation" . into ( ) ) ,
@@ -362,7 +362,7 @@ async fn main() {
362362 println ! ( " Labels after pre-invoke: {:?}" , labels) ;
363363 }
364364 if let Some ( ref http) = modified_ext. http {
365- println ! ( " Headers after pre-invoke: {:?}" , http. read ( ) . request_headers) ;
365+ println ! ( " Headers after pre-invoke: {:?}" , http. request_headers) ;
366366 }
367367 }
368368 } else {
@@ -405,7 +405,7 @@ async fn main() {
405405 let mut security = SecurityExtension :: default ( ) ;
406406 security. add_label ( "PII" ) ;
407407 Extensions {
408- security : Some ( security) ,
408+ security : Some ( Arc :: new ( security) ) ,
409409 meta : Some ( Arc :: new ( MetaExtension {
410410 entity_type : Some ( "tool" . into ( ) ) ,
411411 entity_name : Some ( "get_compensation" . into ( ) ) ,
0 commit comments