-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: run
on_upstream_http_request
hook in federation source (#440)
Co-authored-by: Dotan Simha <dotansimha@gmail.com>
- Loading branch information
1 parent
585c1ce
commit ccb9ff0
Showing
10 changed files
with
339 additions
and
249 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use crate::{ | ||
execute::RequestExecutionContext, | ||
graphql::GraphQLRequest, | ||
http::{ConductorHttpRequest, ConductorHttpResponse}, | ||
}; | ||
use reqwest::Response; | ||
|
||
#[async_trait::async_trait(?Send)] | ||
pub trait PluginManager: std::fmt::Debug + Send + Sync { | ||
async fn on_downstream_http_request(&self, context: &mut RequestExecutionContext); | ||
fn on_downstream_http_response( | ||
&self, | ||
context: &mut RequestExecutionContext, | ||
response: &mut ConductorHttpResponse, | ||
); | ||
async fn on_downstream_graphql_request(&self, context: &mut RequestExecutionContext); | ||
async fn on_upstream_graphql_request<'a>(&self, req: &mut GraphQLRequest); | ||
async fn on_upstream_http_request<'a>( | ||
&self, | ||
ctx: &mut RequestExecutionContext, | ||
request: &mut ConductorHttpRequest, | ||
); | ||
async fn on_upstream_http_response<'a>( | ||
&self, | ||
ctx: &mut RequestExecutionContext, | ||
response: &Result<Response, reqwest_middleware::Error>, | ||
); | ||
} |
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.