@@ -1214,15 +1214,13 @@ impl WasmInstanceEnv {
12141214 connection_id : WasmPtr < ConnectionId > ,
12151215 out_ptr : WasmPtr < u32 > ,
12161216 ) -> RtResult < ( ) > {
1217- log:: info!( "Calling has_jwt" ) ;
12181217 Self :: with_span ( caller, AbiCall :: JwtLength , |caller| {
12191218 let ( mem, env) = Self :: mem_env ( caller) ;
12201219 let cid = ConnectionId :: read_from ( mem, connection_id) ?;
12211220 let length = env
12221221 . instance_env
12231222 . tx
1224- . get ( )
1225- . unwrap ( )
1223+ . get ( ) ?
12261224 . get_jwt_payload ( cid) ?
12271225 . map ( |p| p. len ( ) as u32 )
12281226 . unwrap_or ( 0u32 ) ;
@@ -1241,33 +1239,27 @@ impl WasmInstanceEnv {
12411239 Self :: with_span ( caller, AbiCall :: GetJwt , |caller| {
12421240 let ( mem, env) = Self :: mem_env ( caller) ;
12431241 let cid = ConnectionId :: read_from ( mem, connection_id) ?;
1244- let jwt = match env. instance_env . tx . get ( ) . unwrap ( ) . get_jwt_payload ( cid) ? {
1242+ let jwt = match env. instance_env . tx . get ( ) ? . get_jwt_payload ( cid) ? {
12451243 None => {
12461244 // Consider logging here, since this should only happen during an upgrade.
12471245 0u32 . write_to ( mem, target_ptr_len) ?;
12481246 return Ok ( ( ) ) ;
12491247 }
12501248 Some ( jwt) => jwt,
12511249 } ;
1252- log:: info!( "JWT payload found for connection ID: {:?}: {}" , cid. to_hex( ) , jwt) ;
12531250 let jwt_len = jwt. len ( ) ;
12541251 // Read `buffer_len`, i.e., the capacity of `buffer` pointed to by `buffer_ptr`.
12551252 let buffer_len = u32:: read_from ( mem, target_ptr_len) ?;
1256- log:: info!( "buffer_len: {buffer_len}" ) ;
12571253 if buffer_len < jwt_len as u32 {
12581254 return Err ( anyhow:: anyhow!( "buffer too small to hold JWT payload" ) ) ;
12591255 }
1260- log:: info!( "About to write length" ) ;
12611256 // Write the length of the JWT payload to the target pointer.
12621257 ( jwt_len as u32 ) . write_to ( mem, target_ptr_len) ?;
1263- log:: info!( "wrote length of {jwt_len}" ) ;
1264- log:: info!( "Byte len {}" , jwt. len( ) ) ;
12651258
12661259 // Write the JWT payload to the target pointer.
12671260 // Get a mutable view to the `buffer`.
12681261 let buffer = mem. deref_slice_mut ( target_ptr, buffer_len) ?;
12691262 buffer[ ..jwt_len] . copy_from_slice ( jwt. as_bytes ( ) ) ;
1270- log:: info!( "wrote jwt bytes to slice" ) ;
12711263 Ok ( ( ) )
12721264 } )
12731265 }
0 commit comments