-
-
Notifications
You must be signed in to change notification settings - Fork 247
Added support for access token freshness date. #110
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
Conversation
|
Not sure whats going on here. Something related to cookies is failing and I didn't change anything with that. Also, when I clone the master branch and run tox without any changes to the project I also get these errors. Seems strange. |
|
Still not sure why this is happening but after further examination it seems that the problem has to do with the |
|
Looks like changes in the newest werkzeug release: http://werkzeug.pocoo.org/docs/0.14/changes/#version-0-14 I'll get this updated in master soon (today or tomorrow hopefully), then you can rebase this pr and we can get it merged and push out a new release. Cheers |
|
Ok, assuming all goes well that fix should be in place. If you can rebase this, I would be happy to get it merged in. Cheers 👍 |
vimalloc
left a comment
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.
Unit test for successful case
tests/test_view_decorators.py
Outdated
| with app.test_request_context(): | ||
| access_token = create_access_token('username') | ||
| fresh_access_token = create_access_token('username', fresh=True) | ||
| fresh_timed_access_token = create_access_token('username', fresh=timedelta(minutes=-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.
Could we add one more unit test somewhere? You have the not fresh test case here, I would like to have a test added that sets the time delta in the future and successfully accesses a fresh jwt required endpoint while using this new feature. Thanks!
1 similar comment
|
Okay so I think I have my branch correct now. This is my first pull request and first time doing a rebase so it took me a little bit but I think its now in good order. I also added the unit test for the successful case and rebased that into my original commit. I hope that was okay to do. Let me know if there is anything else I need to do! |
|
Thanks for working on this! The rebase against master looks good. I'm not seeing that success unit test in the changes for this pull request though. You can push that into this PR with a separate commit, that doesn't have to be rebased. Besides that, everything looks great. Once you get that in this PR I'll get this merged. Thanks for contributing! 👍 |
|
My mistake! Thought I had that in here already. Just added it now. Thanks for having started this repo, this is an awesome extension for Flask! |
This pull request adds the ability to pass in a
datetime.timedeltaobject for thefreshkwarg, instead of aboolean, when creating an access token. When using thefresh_jwt_requireddecorator, if thefreshvalue is old, the endpoint will be inaccessible. But the access token is still valid for endpoints that usejwt_required.