Comments (6)
For ease of use, my original goal was for the feature flags to work as follows:
reqwest
=reqwest 0.9
reqwest
+futures-01
=reqwest 0.9
reqwest
+futures-03
=reqwest 0.10
default-features = false
+futures-01
= noreqwest
dependencydefault-features = false
+futures-03
= noreqwest
dependency
Unfortunately, there's no way to specify that in Cargo.toml
, which led to the current functionality. At the time, that seemed preferable to exposing reqwest-09
and reqwest-010
as separate feature flags.
However, I'm sympathetic to a desire to avoid code bloat and slower compilation time, so I'm thinking the best way forward is to introduce separate reqwest-09
and reqwest-010
feature flags, and to make up for the additional complexity with better docs. I'll try to get around to that in the next week or so, though I'd also welcome a PR if anyone wants it sooner.
from oauth2-rs.
Hi Niko,
Specifying default-features = false
on the crate import should remove reqwest
and its dependencies. Similarly, not specifying futures-01
or futures-03
will remove all of the async dependencies. The one combination the crate doesn't currently support is futures-03
without reqwest
due to limitations in Cargo.toml's format (i.e., not supporting #[cfg(all(feature = "reqwest", feature = "futures-03"))]
during dependency computation).
Does that answer your question, or are you still experiencing excessive bloat even without the default features (reqwest
) enabled?
from oauth2-rs.
Hi,
thanks a lot for your answer. Yeah I'm using "futures-03" feature. Needed the async stuff because I wrote an implementation for the surf crate. Was using surf already. That's why I wanted to avoid using so many different crates. I get your point.
Do you see a way of solving this? I also get my thinking on it.
Cheers
from oauth2-rs.
I think it would be a shame if this crate bundled a full-featured HTTP client instead of a light wrapper. Reqwest is just fine.
from oauth2-rs.
The latest version now supports async/await without reqwest
: https://crates.io/crates/oauth2/3.0.0-alpha.7. See updated docs here: https://docs.rs/oauth2/3.0.0-alpha.7/oauth2/
from oauth2-rs.
nice! thanks a lot!
from oauth2-rs.
Related Issues (20)
- Question about using oauth2 in the frontend HOT 1
- DeviceAccessTokenRequest compile error if we use request_async HOT 7
- Proxy Settings Query HOT 1
- Implement Clone for secret types HOT 3
- Azure Oauth2.0 issue parsing 'expires_in' and potentially others returned from Azure's client_credentials token url HOT 5
- "Device code expired" vs token_expired from endpoint timing issue HOT 5
- How to use extensions HOT 1
- How to inspect headers/error message on a failed refresh? HOT 5
- Token Revocation Device Code Work-Flow - Access token is empty reply HOT 2
- Re-export `reqwest`? HOT 1
- Cancelling the loop while polling for access token HOT 6
- User-customizable scope separators (feature request) HOT 4
- Comments in examples mention csrf_state which does not exist in the code HOT 1
- google example issues HOT 1
- Better error messages for failed requests HOT 3
- Support OAuth2 with JSON Web Token HOT 1
- Add User-Agent customization HOT 4
- Google example works but fails for async with Yew/Actix-Web HOT 2
- Compounding the sleep intervals if there is an error in the http_client HOT 3
- Github Device Code Flow does not work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oauth2-rs.