Skip to content

Commit

Permalink
Merge pull request #153 from fastly/acf/stubs
Browse files Browse the repository at this point in the history
🎫 Add stubs for JA3 and WebSocket upgrade hostcalls
  • Loading branch information
acfoltzer authored May 3, 2022
2 parents 627e368 + 4edfd4f commit c50b85b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/compute-at-edge-abi/compute-at-edge.witx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@
(result $err (expected (error $fastly_status)))
)

(@interface func (export "downstream_tls_ja3_md5")
;; must be a 16-byte array
(param $cja3_md5_out (@witx pointer (@witx char8)))
(result $err (expected $num_bytes (error $fastly_status)))
)

(@interface func (export "new")
(result $err (expected $request_handle (error $fastly_status)))
)
Expand Down Expand Up @@ -304,6 +310,11 @@
(result $err (expected (error $fastly_status)))
)

(@interface func (export "upgrade_websocket")
(param $backend_name string)
(result $err (expected (error $fastly_status)))
)

;;; Adjust how this requests's framing headers are determined.
(@interface func (export "framing_headers_mode_set")
(param $h $request_handle)
Expand Down
10 changes: 10 additions & 0 deletions lib/src/wiggle_abi/req_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ impl FastlyHttpReq for Session {
Err(Error::NotAvailable("Client TLS data"))
}

#[allow(unused_variables)] // FIXME ACF 2022-05-03: Remove this directive once implemented.
fn upgrade_websocket(&mut self, backend_name: &GuestPtr<str>) -> Result<(), Error> {
Err(Error::NotAvailable("WebSocket upgrade"))
}

#[allow(unused_variables)] // FIXME KTM 2020-06-25: Remove this directive once implemented.
fn downstream_tls_protocol<'a>(
&mut self,
Expand All @@ -114,6 +119,11 @@ impl FastlyHttpReq for Session {
Err(Error::NotAvailable("Client TLS data"))
}

#[allow(unused_variables)] // FIXME ACF 2022-05-03: Remove this directive once implemented.
fn downstream_tls_ja3_md5(&mut self, ja3_md5_out: &GuestPtr<u8>) -> Result<u32, Error> {
Err(Error::NotAvailable("Client TLS JA3 hash"))
}

fn framing_headers_mode_set(
&mut self,
_h: RequestHandle,
Expand Down

0 comments on commit c50b85b

Please sign in to comment.