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

Upgrade rocket to 0.5 #131

Open
1 task done
Maweypeyyu opened this issue Dec 30, 2021 · 1 comment
Open
1 task done

Upgrade rocket to 0.5 #131

Maweypeyyu opened this issue Dec 30, 2021 · 1 comment
Labels
improvement Improve existing implementation

Comments

@Maweypeyyu
Copy link

Maweypeyyu commented Dec 30, 2021

Project Improvement

Locally swapped out code to work with the rocket 0.5-rc1 and thought why not share it. I understand that this might not be included right now, although I did update the version.

Tracking pull request

@Maweypeyyu Maweypeyyu added the improvement Improve existing implementation label Dec 30, 2021
@Maweypeyyu Maweypeyyu mentioned this issue Dec 30, 2021
4 tasks
@jtmorrisbytes
Copy link

jtmorrisbytes commented Aug 19, 2024

Pull Request #197

I have made a second attempt to upgrade to rocket 0.5. Some issues that arrived are as follows:

  1. rocket 0.5 went from Sync -> Async code. As such I had to work around serde_urlencoded since rocket::data::DataStream does not implement std::io::Read anymore and instead implements tokio::io::AsyncRead
  2. rocket introduced data limits when opening a raw datastream. I had to modify OAuthRequest::add_body to take an additional optional parameter called 'limits' that passed along the server configured limits. if no limit is specified, then the add_body method will use the hard coded default provided by rocket
  3. I had difficulty with lifetimes in the FromRequest implementation. It is difficult to use borrowed data in FromRequest because you somehow have to specify that the lifetime of the OAuthRequest structure lives at least as long as the request structure but you are returning a new instance of OAuthRequest with borrowed data. I tried a couple of patterns and the only one that seemed to work is where impl<'r> FromRequest<'r> for OAuthRequest<'static>. the examples seem to compile on my machine except for the support module due to the #[path} statement. I still need to work on adding tests and updating docs.

This is my first time contributing to another project. please let me know if there is anything that needs to be done here and I will submit another pull request

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

No branches or pull requests

2 participants