Allows multiple values for 'iss'#31
Merged
mpdavis merged 3 commits intompdavis:masterfrom Jul 27, 2016
Merged
Conversation
Current coverage is 95.78% (diff: 100%)@@ master #31 diff @@
==========================================
Files 7 7
Lines 496 498 +2
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 475 477 +2
Misses 21 21
Partials 0 0
|
jose/jwt.py
Outdated
| if issuer is not None: | ||
| if claims.get('iss') != issuer: | ||
| if isinstance(issuer, string_types): | ||
| issuer = [issuer] |
Owner
There was a problem hiding this comment.
Since we don't need to mutate this, can we construct this as a tuple instead of a list?
Contributor
Author
There was a problem hiding this comment.
Good point. I changed jws._get_keys() to use a tuple as well, for consistency. (I do think 1-element tuples are kind of ugly, though)
Owner
There was a problem hiding this comment.
I can't disagree that they are ugly.
Owner
|
lgtm |
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apparently Google may send either
https://accounts.google.comoraccounts.google.comfor their 'iss' value, so it's necessary to check both.This pull request allows passing a list or tuple to
jwt.decode(issuer=so, for example, you can check against both valid Google values, instead of having to catch an exception and re-validate.