-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(server): Improve request body and signature handling (#2885)
Changes the signature of `UpstreamRequest` so that any request can be configured to be signed now. Before, this was possible only for query requests. The `UpstreamRequest` trait now has a `sign() -> bool` method that returns whether or not a signature should be applied. Along with this, there are changes to the request builder to make it more ergonomic for the common use case: - The builder uses interior mutability instead of moving now. - `RequestBuilder` now takes `Into<Bytes>` as body, which allows for more efficient retries. However, it is still the responsibility of the request to ensure bytes are cloned. This is because usually we want expensive serialization operations outside of the Upstream's runtime. - The `build()` function no longer receives the config, as this was needed just for internal query requests. - The `build()` function does not need to finish the request, this is done by the upstream now. - `HttpError::NoCredentials` has been removed. This was a hack to allow emitting this error from the build callback, but this is no longer required.
- Loading branch information
Showing
5 changed files
with
120 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.