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

feat: support reqwest-middleware #50

Open
rbtcollins opened this issue Apr 11, 2024 · 2 comments
Open

feat: support reqwest-middleware #50

rbtcollins opened this issue Apr 11, 2024 · 2 comments

Comments

@rbtcollins
Copy link

This would allow adding caching, otel etc without needing more changes to the openid crate. One pattern I quite like is to define a trait that specifies only what you actually use from reqwest, and then users can implement that themselves as needed.

@kilork
Copy link
Owner

kilork commented Apr 12, 2024

If it could be implemented with feature guard, I am not against it. Oops, I understood, that this will allow to change behavior, which we should not allow.

It would be interesting to know, why original reqwest does not have it?

One thing we can probably have is to have tracing feature to add tracing crate integration.

@rbtcollins
Copy link
Author

Oops, I understood, that this will allow to change behavior, which we should not allow.

I'm not sure what you mean here, since if someone really wants to change behaviour they can just replace the entire reqwest crate dependency you have with a custom implementation. In terms of spec compliance, having middleware on an HTTP client is perhaps a risk, but a fairly small one.

I can't answer why reqwest itself doesn't support middleware, but it doesn't, so there is that.

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

2 participants