-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
Resolve #453, better options for revoking both refresh and access #460
Conversation
Thanks for putting this together!! I'm super busy this week, I'll try to find the time to properly look over it as soon as I can! 🥳 🎉 |
Hey @vimalloc, not to press but have you had a chance to take a look at this? I think I will at some point try to roll #441 into the changes, but would like some direction. My current thought is to allow
In #441 (comment) you mentioned being unsure about having both Anyway, I don't think there's a good way to get out of that part without removing Also think it would be a good idea to add flask_jwt_extended.TokenTypes as an enum with |
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.
Looks great, thanks for all the work you put into this!
Left one super small comment that I wanted to check, but it's tiny.
One question, do you think it would be worth adding a mypy
check for CI to verify the types that we defined match up with how we are using them? If so, I don't think it would need to happen as part of this PR
Cheers!
requirements.txt
Outdated
@@ -1,8 +1,9 @@ | |||
black==21.6b0 | |||
cryptography==35.0.0 | |||
Flask==2.0.1 | |||
flake8==4.0.1 |
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.
Probably don't need this, I'm guessing it's a dependency of one of the other packages we explicitly need here right?
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 only ask because I ran into situations where conflicts came about before when doing a pip freeze
on all of the packages used here, instead of defining only the ones that are explicitly needed at letting pip handle their dependencies.
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.
Whoops you're right, that was added by accident! However, this requirements.txt is sort of meant for dev right? (since setup.py defines actual production requirements). If so, probably doesn't hurt to leave it on there, since black
is already on the list (and both are required for precommit). I sort of started migrating my personal stuff from requirements.txt -> Pipfile to avoid these confusions, but that's an annoying process on the CI side.
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.
Your call for keep or remove, but I'd say do the same for black & flake8
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 vote remove. Keeping all the ~60 dependencies that are brought in from this file has given me various issues in the past that I would like to avoid 👍
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.
Flake8 is gone, wasn't sure if you meant black too (or sphinx too? Kind of fall in the same boat of not always necessary dev tools) so just let me know!
Yeah, I can see the arguments for all of these. on the flip side, with the work you've done it would be possible for someone to use a custom decorator with
Yeah, I think that would be a great change 👍 |
I don't think types outside of access/refresh will likely be all that widely used so making it slightly less accessible likely isn't an issue - there wasn't a ton of buzz around #441. That being said, Quick aside - I'd vote to simplify name
Easy enough 😄 Is just fixing requirements.txt all you want to see in this merge? I think it makes sense to keep custom types as a separate pull, since there's a tiny bit more discussion to be had and I don't think anything about it would block implementing Let me know what you need. Thanks! |
No problem, thanks for checking!
Not a bad idea if you're OK sticking with typing going forward. There are likely a handful of things that need to be resolved before mypy passes, so handling it in a separate issue is probably a good idea. Your call, doesn't matter to me either way. |
Yep, I think a separate PR would be just fine. 👍 |
Nope! I’ve just been meaning to clean up a few last things. I’ll try to get the release out when I’m back at home in a few days :) |
Sounds good, thanks for the quick reply! Let me know if there's anywhere to help. |
There are a handful of changes in this PR:
verify_type
argument to jwt methods to allow accepting both refresh & access tokensLet me know if anything else is needed to clean up. Verified tox passes except for pypy3 (didn't have it available to test)