Distributed claims#420
Conversation
| _uinfo = self.do_user_info_request( | ||
| token=callback(csrc), | ||
| userinfo_endpoint=spec["endpoint"]) | ||
| if callback: |
There was a problem hiding this comment.
This part is not covered by tests.
There was a problem hiding this comment.
Does the recent changes meet your requirements ?
There was a problem hiding this comment.
Sorry for not responding earlier. I am having a busy week at work. I will have a look today.
There was a problem hiding this comment.
Here again, comparison to None and test without callback is missing.
There was a problem hiding this comment.
OK now ? Need to get this out the door soon.
| if 'as_query_parameter' == _behav: | ||
| method = 'GET' | ||
| else: | ||
| elif token: |
There was a problem hiding this comment.
- Comparison to
Noneshould be explicit. - In tests, this condition is always true, so a test with token =
Noneshould be added.
There was a problem hiding this comment.
The comparison is still not explicit. It believe that it should be elif token is not None: as token is previously assigned None.
There was a problem hiding this comment.
I don't think that is good enough. token='' should be handled the same way as token=None
hence the use of elif token which implicitly include token is not ''.
And I'd rather not use elif token is not None and token is not ''
There was a problem hiding this comment.
And is there any case where token would be an empty string?
If yes, then OK, leave the code as is.
| _ttype = token.token_type | ||
| except AttributeError: | ||
| raise MissingParameter("Unspecified token type") | ||
| if token: |
There was a problem hiding this comment.
The same goes here: if token is not None:
| if state: | ||
| # Verify userinfo sub claim against what's returned in the ID Token | ||
| idt = self.grant[state].get_id_token() | ||
| if idt: |
There was a problem hiding this comment.
This seems to never be triggered in tests.
|
I know this is a lot of tests to be added, but if you are already poking into the code, we might as well add test to cover the changes... |
1 similar comment
|
I would like to see more tests, but I understand that any progress is better than none. |
Agreed! If we feel like we're missing coverage, just create an issue with a link to this PR and we can track that. If a bug is ever raised, we will be motivated to come back to cover the remaining cases. Nice work @rohe. |
|
Sounds good to me. |
|
🍰
Hey, you may be VIP but you're not getting out of merging your own PRs ;) I won't get time to make a release, please someone, go for it and keep #419 in mind. |
|
Excellent new! Thanks ! |
* Modified fetch_distributed_claims * Use HTTP GET for all requests
Fixed bug in handling of distributed claims.
Thanks for contributing to this library! Please include the following check
list in your pull request submission (you can delete this message). If your
changes don't need a change log or documentation update, please ignore this.
CHANGELOG.md.