Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdds blacklist token feature as separate subapp #91
Conversation
avimeir
and others
added some commits
Mar 22, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
erichonkanen
Mar 28, 2015
Contributor
Tested this in a local project by logging into my app with a distant expiring JWT_EXPIRATION_DATE, issuing a POST to /api/v1/auth-token-blacklist/ with the token, and then attempting to access the api (navigated to another page with api call). A 401 Unauthorized is issued and I am logged out of my ember app as expected... Let me know if anyone has input.. seems like nice feature
|
Tested this in a local project by logging into my app with a distant expiring JWT_EXPIRATION_DATE, issuing a POST to /api/v1/auth-token-blacklist/ with the token, and then attempting to access the api (navigated to another page with api call). A 401 Unauthorized is issued and I am logged out of my ember app as expected... Let me know if anyone has input.. seems like nice feature |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
erichonkanen
Mar 28, 2015
Contributor
Should this package include an admin.py for the default black list token implementation? Should the JWTBlackListToken model include any other fields like the actual token value?
|
Should this package include an admin.py for the default black list token implementation? Should the JWTBlackListToken model include any other fields like the actual token value? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
avimeir
Mar 28, 2015
@erichonkanen nice work!
I'd add the exp claim to the model, so that we can later clean-up the DB by removing all expired tokens.
avimeir
commented
Mar 28, 2015
|
@erichonkanen nice work! I'd add the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
erichonkanen
Mar 28, 2015
Contributor
@avimeir thanks! should the exp be a DateTimeField or CharField? I know the format it comes in as is seconds since epoch
|
@avimeir thanks! should the exp be a DateTimeField or CharField? I know the format it comes in as is seconds since epoch |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
erichonkanen
Mar 28, 2015
Contributor
def jwt_blacklist_set_handler(payload):
"""
Default implementation that blacklists a jwt token.
"""
jti = payload.get('jti')
exp = datetime.fromtimestamp(payload.get('exp'))
return models.JWTBlackListToken.objects.create(jti=jti, expires_at=exp)
Made it DateTimeField and just converted
Made it DateTimeField and just converted |
erichonkanen
added some commits
Mar 28, 2015
erichonkanen
added some commits
Mar 28, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
erichonkanen
May 4, 2015
Contributor
@jpadilla ran git rebase, fixed conflicts but Im noticing this effectively made a 2nd copy of every commit now at the front.. is this expected or did I do it wrong? Ive mostly just used rebase to squash commits in the past...
|
@jpadilla ran git rebase, fixed conflicts but Im noticing this effectively made a 2nd copy of every commit now at the front.. is this expected or did I do it wrong? Ive mostly just used rebase to squash commits in the past... |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpadilla
May 4, 2015
Member
@erichonkanen oh snap, could you perhaps squash all of this into one commit then?
|
@erichonkanen oh snap, could you perhaps squash all of this into one commit then? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Cleaned commit history and submitted in new PR |
erichonkanen
closed this
May 5, 2015
erichonkanen
deleted the
erichonkanen:jti
branch
May 5, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
uber1geek
commented
Aug 29, 2017
|
How can i implement this feature @erichonkanen ? |
erichonkanen commentedMar 27, 2015
Builds off work submitted by @avimeir and the discussion at #89