interface authenticate-types { use wasi:http/types@0.2.0.{method, scheme, field-key, field-value}; variant outcome { authenticate, reject, with-context(list), } // This is the object form of the resource `wasi:http/types@0.2.0.{incoming-request}`. // Curently, it's duplicated due to the lack of support for including re-mapped types // in exported functions arguments, via `--with`. The issue is tracked // [here](https://github.com/bytecodealliance/wit-bindgen/issues/832). // // Until the issue is resolved, we have to duplicate the type here, and massage it to be // compatible with the `Request` type in the kiwi-sdk. // // NOTE: Resolving this workaround will likely require a new major version of the SDK to be // released, as it will be a breaking change unless we can guarantee API compatibility between // the two types. record http-request { /// Returns the method of the incoming request. method: method, /// Returns the path with query parameters from the request, as a string. path-with-query: option, /// Returns the protocol scheme from the request. scheme: option, /// Returns the authority from the request, if it was present. authority: option, /// Get the `headers` associated with the request. headers: list>, } }