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

[Refactor]: Temporary interceptors #657

Open
themanforfree opened this issue Feb 22, 2024 · 0 comments
Open

[Refactor]: Temporary interceptors #657

themanforfree opened this issue Feb 22, 2024 · 0 comments

Comments

@themanforfree
Copy link
Collaborator

// crates/curp/src/mod.rs
pub trait ClientApi {
  ...
  async fn propose(
      &self,
      cmd: &Self::Cmd,
      token: Option<&String>, // TODO: Allow external custom interceptors, do not pass token in parameters
      use_fast_path: bool,
  ) -> Result<ProposeResponse<Self::Cmd>, Self::Error>;
  ...
}

Current we have added a token parameter to the propose method of the curp client to have xline pass a token for each request, but curp itself does not need this token. Therefore, it is better to remove this parameter and add the ability to create temporary interceptors to the ClientApi, Xline or other applications can specify a temporary interceptor when making requests, and the curp layer will apply a interceptor for the current request before sending the request, so that there is no need to expose the token to the curp layer, and improve the flexibility of curp to send requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant