aliev / aioauth

Asynchronous OAuth 2.0 provider for Python 3
https://aliev.me/aioauth
MIT License
214 stars 19 forks source link

A client_secret is not required for the password grant type #78

Closed tdg5 closed 1 year ago

tdg5 commented 1 year ago

Believe it or not, this is the beginning of working to make it so the password grant doesn't require a client_secret.

In broad strokes, this aims to make the setting of the WWW-Authenticate header the responsibility of the InvalidClientError instead of being the responsibility of the get_client_credentials function.

EDIT: I was going to make client_secret optional for the password grant in another PR, but it doesn't seem like there's enough extra code required to warrant that. So this now includes logic to make it so the password grant type doesn't require a client_secret. Viewing the changes by commit may help disentangle things.

codecov-commenter commented 1 year ago

Codecov Report

Merging #78 (29dc2bb) into master (c6ddffa) will decrease coverage by 0.57%. The diff coverage is 75.00%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master      #78      +/-   ##
==========================================
- Coverage   98.80%   98.24%   -0.57%     
==========================================
  Files          14       14              
  Lines         669      683      +14     
  Branches      102      106       +4     
==========================================
+ Hits          661      671      +10     
- Misses          4        8       +4     
  Partials        4        4              
Impacted Files Coverage Δ
aioauth/utils.py 97.75% <ø> (ø)
aioauth/server.py 97.05% <50.00%> (-2.95%) :arrow_down:
aioauth/errors.py 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

tdg5 commented 1 year ago

Sorry for pushing a bunch of late commits to this PR. I am satisfied with what's here now :+1:

aliev commented 1 year ago

Sorry for pushing a bunch of late commits to this PR. I am satisfied with what's here now 👍

merging then :)