-
Notifications
You must be signed in to change notification settings - Fork 23
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 jwt_authorizer to axum 0.7
#44
Conversation
Thx for the PR, tonic (feature) is not compiling, I think the update of tonic to hyper 1.0 is needed. |
Thanks! The other thing is that you will notice your test minutes have mysteriously vanished... in Would this be due to tonic as well? Edit: As @cduvray pointed out, this was not the problem. The problem was that the standard listener was in blocking mode. This lead to an asynchronous polling issue because the listener would continuously block the thread until all I/O operations completed...which, they never do. |
.serve(app.into_make_service()) | ||
.await | ||
.unwrap(); | ||
let listener: tokio::net::TcpListener = tokio::net::TcpListener::from_std(listener).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you should use the listener from the line 69, I think creating a new listener on the same port makes the tests stuck.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved by making the std
listener non-blocking...the integration tests should no longer hang! Much appreciated for figuring this out!
Reference: tokio docs
@@ -145,7 +143,8 @@ async fn make_proteced_request(app: &mut Router, bearer: &str) -> Response { | |||
} | |||
|
|||
async fn make_public_request(app: &mut Router) -> Response { | |||
app.ready() | |||
app.as_service() | |||
.ready() | |||
.await | |||
.unwrap() | |||
.call(Request::builder().uri("/public").body(Body::empty()).unwrap()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I think you could call call()
directly on as_service() (type RouterAsService
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll squash several of the prior commits and push this change when the tonic upgrade is complete.
It seems like the upgrade in |
I am not sure to understand what you mean by feature gating (tonic is already behind a feature switch). |
My mistake! What I meant to say is you could make the version of Alternatively, could just wait another month or so hahaha...I'll do what I can to get Please let me know what you want to do, and I can create an according PR/work with you in tandem if you find it useful/necessary to separate versions between tonic and axum. Could also tackle #43 with this approach. |
This is some work done to update
jwt_authorizer
toaxum 0.7
. In the process, theReqBody
generic was removed in several places, asaxum::extract::Request
now has a default associated type.