Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎫 Add stubs for JA3 and WebSocket upgrade hostcalls #153

Merged
merged 1 commit into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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