Comments (15)
if possible, I'd like to switch entirely to http
0.2, as long as that works with both reqwest
versions. I would have preferred to switch to reqwest
0.10 entirely as well, but it doesn't maintain backward compatibility with futures
0.1.
from oauth2-rs.
I tried upgrading to reqwest
0.10 and http
0.2 in 81e2a87, but that breaks compatibility with rustc < 1.39 because http
0.2 depends on bytes
0.5, which uses newer language features not supported by older compiler versions.
for now, I think I'm going to leave the external HTTP client interface as http
0.1, and have the reqwest
0.10 client convert to http
0.2 types internally
from oauth2-rs.
e.g.:
error: `core::slice::<impl [T]>::len` is not yet stable as a const fn
--> /Users/daramos/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-0.5.3/src/bytes.rs:121:18
|
121 | len: bytes.len(),
| ^^^^^^^^^^^
from oauth2-rs.
Seems like a reasonable approach. I have some crude version of that http
type conversion code in my own project (since I already use reqwest
0.10 with this crate through a custom async client implementation). I unfortunately won't have time in January to make that into anything mergeable though.
from oauth2-rs.
Just from curiosity. As it is a major version change, why not update the minimal required rust version as well ?
Here is a branch where I made a few a minor changes and it depends on reqwest 0.10 and http 0.2:
https://github.com/gzp-crey/oauth2-rs/tree/http_hack
(The only change was the use of redirect::Policy instead of RedirectPolicy)
from oauth2-rs.
(The only change was the use of redirect::Policy instead of RedirectPolicy)
If this crate wants to keep support for reqwest
0.9 (which I guess is the goal at least for the near future), then there are a few more changes necessary. Try to compile with the reqwest-09
feature flag and you will see that there will be some http
version mismatches.
from oauth2-rs.
Ok, thanks, I see :(.
from oauth2-rs.
I've created a new PR where http versiosn and reqwest version are tied together.
Do you think if this is a good compromise as projects targeting reqwest 0.10 are also using http 0.2 ?
from oauth2-rs.
I've created a new PR where http versiosn and reqwest version are tied together.
Do you think if this is a good compromise as projects targeting reqwest 0.10 are also using http 0.2 ?
Unfortunately, I don't think this approach meets the requirements since http
is still needed even without reqwest
(see #82 (comment)).
from oauth2-rs.
And what about a solution where http version is also a feature ?
The default is http 0.1, reqwest 0.9 (and later at some point http 0.2, future 0.3, reqwest 0.10)
Pro: it's almost done only the feature in the toml file have to be modified.
Contra: there are feature sets those won't compile. Like http 0.1with reqwest 0.10.
I don't know if such dependency/restriction can be expressed through the features.
Converting between http versions on the external interface does not seem a good solution. Especially if it is the 0.1 version. For new projects and updates we are forced to use two version of the same crate and perform conversions to and back.
from oauth2-rs.
any time a crate re-exports symbols from some other crate, there are going to be version issues across major releases of the depended-upon crate. some users will want the newer version, and some will want the older version. #81 should make it much easier to use whichever http
version this crate uses, since it's now exported explicitly.
the feature flags for this crate are already fairly complex, and adding two more to toggle between http
versions would be adding too much additional complexity. I wanted to upgrade the external interface to 2.0, but that would require everyone to be on rustc 1.39 or newer, which would probably cause issues for some other set of users.
for 3.x, let's leave the external interface as http
1.0 with an explicit re-export, and for the next major version (4.x), I'll probably migrate the interface to http
2.0.
from oauth2-rs.
Ok, than I have to wait for your fix and there is no "quick fix". :(
(Sry for urging the fix, but this is the last dependency blocking my PR in another project to use actix 2.0 cleanly from crates.io)
from oauth2-rs.
which fix are you waiting on? reqwest
0.10 support?
from oauth2-rs.
yes, to have reqwest 0.10
from oauth2-rs.
thanks a lot
from oauth2-rs.
Related Issues (20)
- Consider using `http::{Request, Response}` for easier conversion HOT 9
- Upgrade to http 1.0 HOT 17
- Google Url does not contain code HOT 1
- Does this crate support getting scope data like (profile) ? HOT 2
- Code review of FusionAuth OAuth2 Rust guide please? HOT 1
- Quesion: Client Credentials - am I doing it right? HOT 8
- Axum example HOT 2
- Is there a reason so many interfaces accept `String` instead of `&str`? HOT 6
- How to add two scopes to google oauth 2 HOT 1
- what is the appropriate way. to add two scopes to google OAuth
- Support using an existing reqwest::Client when making requests HOT 3
- Why not using Response and Request of http::crate directly instead of aliasing it to HttpResponse and HttpRequest? It causes mismatch type error HOT 10
- Future is not Send HOT 5
- version 4.4.2 doesn't work with Google provided token server HOT 1
- (Beta version) : reference to client causes error with axum HOT 10
- Reason of using Fn() instead of FnOnce for AsyncHttpClient and SyncHttpClient HOT 7
- DPoP support HOT 1
- Receiving a JWT token from keycloak server possible? HOT 1
- wasm32 target without `getrandom/js` feature HOT 5
- `StandardTokenResponse` does not support twitch oauth response HOT 2
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.