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

📝 Update docs for handling HTTP Basic Auth with secrets.compare_digest() to account for non-ASCII characters #3536

Merged
merged 4 commits into from Aug 24, 2022

Conversation

lewoudar
Copy link
Contributor

@lewoudar lewoudar commented Jul 15, 2021

Updated by @tiangolo:

📝 Update docs for handling HTTP Basic Auth with secrets.compare_digest() to account for non-ASCII characters.


I changed the basic auth security example to encode data in bytes using the idna format. This is because compare_digest only checks ascii characters but in the real world, many people have a name with non-ascii characters 😃

I also removed useless docstring comment.

@tiangolo tiangolo changed the title fix basic auth security example and docstring 📝 Update docs for handling HTTP Basic Auth with secrets.compare_digest() to account for non-ASCII characters Aug 24, 2022
@codecov
Copy link

codecov bot commented Aug 24, 2022

Codecov Report

Merging #3536 (fa8fa26) into master (2201f29) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master     #3536   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          533       533           
  Lines        13755     13755           
=========================================
  Hits         13755     13755           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tiangolo
Copy link
Owner

Thank you @lewoudar! 🤓

I updated the example and docs a bit to make it more explicit. I used UTF-8 instead of IDNA, as this is not related to domains.

I reverted the change in the docstring to put it in a different PR as that is a different thing. Also because only removing that line also left the example code broken. But let's fix that in another PR later.

Thanks for your contribution! 🍰

@tiangolo tiangolo merged commit 8c6ad35 into tiangolo:master Aug 24, 2022
@lewoudar
Copy link
Contributor Author

@tiangolo perfect!

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.

None yet

2 participants