oauth2-rs icon indicating copy to clipboard operation
oauth2-rs copied to clipboard

Upgrade to http 1.0

Open jonhoo opened this issue 1 year ago • 6 comments

hyper has reached 1.0, and with it the http crate did as well. Since http is part of the public API for oauth2 (e.g., via the pub use http re-export), it'd be nice if oauth2 followed suit!

I took a stab at doing it myself, and it doesn't look too painful, except for the fact that there's not yet a version of reqwest that uses http 1.0 (https://github.com/seanmonstar/reqwest/issues/2039). Which means this is blocked for the time being, but I figured it'd still be useful to have a tracking issue.

jonhoo avatar Nov 25 '23 09:11 jonhoo

sounds good! let's do this once reqwest supports 1.0, and that will require a major version bump of this crate and the downstream openidconnect crate.

ramosbugs avatar Nov 26 '23 02:11 ramosbugs

I took a stab at doing it myself, and it doesn't look too painful,

How much of this have you got done already? Per #236 there's now consent to see if te Http{Request,Response} can be replaced with those from the http crate. Indeed, the 1.0 release seems to mainly solidify the API rather than introduce breaking changes.

(I came around this crate for the improved http<->ureq conversions that sparked #236, and am also interested in bumping to http 1.0.0 to be able to utilize that).

MarijnS95 avatar Nov 26 '23 08:11 MarijnS95

I stopped fairly early on when I realized that we'd need a release of reqwest that also uses http 1.0 first. That's not because of the public API, but rather just for type compatibility.

jonhoo avatar Nov 26 '23 08:11 jonhoo

Also worth linking this, which it took me a bit to find: https://hyper.rs/guides/1/upgrading/

jonhoo avatar Nov 26 '23 17:11 jonhoo

Does this crate use hyper, or only a few methods in reqwest (which uses hyper under the hood)?

MarijnS95 avatar Nov 26 '23 18:11 MarijnS95

for reqwest, we need wait upstream https://github.com/seanmonstar/reqwest/issues/2039

ttys3 avatar Dec 01 '23 16:12 ttys3

I've started merging breaking changes for the next major release (5.0) of this crate into main. Hopefully this change will be done soon enough to make it into 5.0 (no concrete timeframe).

ramosbugs avatar Feb 21 '24 03:02 ramosbugs

Would it be possible to make a beta 5.0 branch depending on

reqwest = { git = "https://github.com/seanmonstar/reqwest.git", branch = "hyper-v1" }

So that the users of this crate work on their migration to be ready for the reqwest release ?

nicolaspernoud avatar Mar 07 '24 12:03 nicolaspernoud

It's been merged! https://github.com/seanmonstar/reqwest/issues/2039

seanpianka avatar Mar 09 '24 03:03 seanpianka

It's been merged! seanmonstar/reqwest#2039

I saw! I should have a branch ready soon, but I won't be able to cut a release until reqwest 0.12 is released with the changes

ramosbugs avatar Mar 09 '24 06:03 ramosbugs

Alright, I've upgraded to http 1.0 in the http-1.0 branch. Until a release is cut, anyone can test it as follows:

oauth2 = { git = "https://github.com/ramosbugs/oauth2-rs.git", rev = "03bc493a3d90643c6deb77e0da12e9a1a90d9be5" }

ramosbugs avatar Mar 09 '24 07:03 ramosbugs

@ramosbugs what would be the minimum required Rust compiler version for this?

LorenzoLeonardo avatar Mar 11 '24 08:03 LorenzoLeonardo

Testing done, and this is working. Please merge

LorenzoLeonardo avatar Mar 11 '24 09:03 LorenzoLeonardo

@ramosbugs what would be the minimum required Rust compiler version for this?

should still be 1.65

Testing done, and this is working. Please merge

still waiting on a reqwest 0.12 release: https://github.com/seanmonstar/reqwest/releases

ramosbugs avatar Mar 12 '24 03:03 ramosbugs

5.0.0-alpha.3 is now released with dependencies on http 1.0 and reqwest 0.12

ramosbugs avatar Mar 21 '24 01:03 ramosbugs

I assume you mean 5.0.0-alpha.3? :sweat_smile:

jonhoo avatar Mar 30 '24 15:03 jonhoo

fixed, thanks! 🤦‍♂️

ramosbugs avatar Mar 30 '24 15:03 ramosbugs