-
Notifications
You must be signed in to change notification settings - Fork 94
Upgrade rocket to 0.5 #197
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 #197
Conversation
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.
Quick preliminary question:
oxide-auth-rocket/src/lib.rs
Outdated
|
||
impl<'a, 'r> FromRequest<'a, 'r> for OAuthRequest<'r> { | ||
#[rocket::async_trait] | ||
impl<'r:'static> FromRequest<'r> for OAuthRequest<'r> { |
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.
This bound is confusing to me, it seems equivalent to 'r = 'static
. Wouldn't this then be only fulfilled at the substitution:
impl<'r:'static> FromRequest<'r> for OAuthRequest<'r> { | |
impl FromRequest<'static> for OAuthRequest<'static> { |
I don't think it's very likely that this restriction is intended. In any case it could be written explicitly. Am I missing anything here?
I’m still new to lifetimes. I’m having to refer to the docs.
Using the 'static lifetime like 'r:'static is too strict and I was running into the issue "borrowed data escapes the function" and "value may not live long enough" when using does not match the trait implementation.
#[rocket:async_trait]
impl<'r> FromRequest<'r> for Auth0Request<'r>{...}
because request must also be borrowed: &'r Request<'_> or it doesn't match the trait definition. I haven't yet figured out how to use structs with borrowed values in rocket 0.5 yet. I'm sure it's a skill issue. Somehow we have to say that the lifetime of the request outlives the lifetime of the borrowed data.
|
Im going to open an other pull request as I have made more changes |
This changes/fixes/improves …
I license past and future contributions under the dual MIT/Apache-2.0 license, allowing licensees to chose either at their option.