Skip to content

Hash application client secrets using Django password hashing #1093

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

Merged
merged 3 commits into from
Jan 25, 2022

Conversation

n2ygk
Copy link
Member

@n2ygk n2ygk commented Jan 20, 2022

Fixes #729

Description of the Change

Pick up where #1020 left off and simplify to always hash the client_secret using the Django default hasher.
The migration is not reversible as it hashes cleartext application client secrets.

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
Copy link
Member Author

n2ygk commented Jan 20, 2022

@pkarman - Thanks for the idea regarding client secret hashing. I've simplified by turning this into a breaking change (migration not reversible) that will always hash the client secret.

@n2ygk n2ygk added this to the 2.0.0 milestone Jan 20, 2022
@n2ygk n2ygk requested a review from a team January 20, 2022 22:55
@codecov
Copy link

codecov bot commented Jan 21, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.61%. Comparing base (a6bd0d0) to head (05de2af).
Report is 195 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1093      +/-   ##
==========================================
+ Coverage   96.58%   96.61%   +0.02%     
==========================================
  Files          32       32              
  Lines        1787     1801      +14     
==========================================
+ Hits         1726     1740      +14     
  Misses         61       61              

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

Copy link
Member

@Andrew-Chen-Wang Andrew-Chen-Wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, it LGTM!

pkarman and others added 2 commits January 24, 2022 11:03
@n2ygk n2ygk force-pushed the issue_729/hash_secrets branch from 1cf4259 to b5f6674 Compare January 24, 2022 16:06
@n2ygk n2ygk marked this pull request as ready for review January 24, 2022 16:57
@n2ygk n2ygk merged commit 691870c into jazzband:master Jan 25, 2022
@n2ygk n2ygk deleted the issue_729/hash_secrets branch January 25, 2022 15:00
flow3d pushed a commit to singular-labs/django-oauth-toolkit that referenced this pull request Mar 22, 2022
…nd#1093)

* Add ClientSecretField field to use Django password hashing algorithms (jazzband#1020)

Co-authored-by: Andrew Chen Wang <[email protected]>
Co-authored-by: Peter Karman <[email protected]>
Co-authored-by: Andrew Chen Wang <[email protected]>
@martin-thoma
Copy link
Contributor

If feels wrong to see "WIP" in the title of a merged PR / to see WIP in a breaking change in the changelog.

@n2ygk n2ygk changed the title WIP: Hash application client secrets using Django password hashing Hash application client secrets using Django password hashing Jul 5, 2022
@n2ygk n2ygk mentioned this pull request Jul 7, 2023
2 tasks
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.

Why are secrets in plain text?
4 participants