Skip to content
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

#1066: Revert #967 which incorrectly breaks API. #1068

Merged
merged 2 commits into from
Jan 4, 2022

Conversation

n2ygk
Copy link
Member

@n2ygk n2ygk commented Jan 4, 2022

Fixes #1066

Description of the Change

PR #967 should never have been merged as it changes the signature of a published API.

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

@n2ygk n2ygk requested a review from Natureshadow January 4, 2022 19:24
@n2ygk n2ygk added this to the 1.7.0 milestone Jan 4, 2022
@codecov
Copy link

codecov bot commented Jan 4, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.67%. Comparing base (250120d) to head (827db80).
Report is 215 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1068      +/-   ##
==========================================
- Coverage   96.70%   96.67%   -0.03%     
==========================================
  Files          31       31              
  Lines        1791     1777      -14     
==========================================
- Hits         1732     1718      -14     
  Misses         59       59              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@n2ygk n2ygk requested a review from MattBlack85 January 4, 2022 19:31
@Natureshadow
Copy link
Contributor

Natureshadow commented Jan 4, 2022

@n2ygk Thanks for looking into this!

By now, we have a compatibility layer downstream. If you are interested, isntead of removing the feature the PR introduced, I could try to make a PR adding this compatibility layer to django-oauth-toolkit itself.

On the other hand, I think the feature was implemented incompletely, because publishing all available claims in the discovery info might be a privacy or security risk for some applications. So I think the API should provide for a new validator method, e.g. get_discovery_claims, which can override the list of published claims.

Additionally, the validator implementation should be free to return plain data instead of a callable, like before (both should be supported).

I could make these additions on top of @AndreaGreco's PR.

What do you think?

@Natureshadow Natureshadow mentioned this pull request Jan 4, 2022
5 tasks
@n2ygk
Copy link
Member Author

n2ygk commented Jan 4, 2022

@n2ygk Thanks for looking into this!

By now, we have a compatibility layer downstream. If you are interested, isntead of removing the feature the PR introduced, I could try to make a PR adding this compatibility layer to django-oauth-toolkit itself.

On the other hand, I think the feature was implemented incompletely, because publishing all available claims in the discovery info might be a privacy or security risk for some applications. So I think the API should provide for a new validator method, e.g. get_discovery_claims, which can override the list of published claims.

Additionally, the validator implementation should be free to return plain data instead of a callable, like before (both should be supported).

I could make these additions on top of @AndreaGreco's PR.

What do you think?

It was done incorrectly and the release has been out such a short time that we can just put it back the way it was for now. No need to add compat layer.

@n2ygk n2ygk merged commit 27821a8 into jazzband:master Jan 4, 2022
@n2ygk n2ygk deleted the revert_967 branch January 4, 2022 20:36
@n2ygk
Copy link
Member Author

n2ygk commented Jan 4, 2022

@Natureshadow Also, feel free to start a new issue/PR. I don't quite understand what you are getting at but would love to review it. I didn't want that conversation to be in this thread though;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backwards-incompatible API change in OAuth2Validator in 1.6.0
2 participants