google-auth-library-python-oauthlib icon indicating copy to clipboard operation
google-auth-library-python-oauthlib copied to clipboard

Fix: Ensure autogenerate_code_verifier defaults to True in from_client_config

Open kosperun opened this issue 1 year ago • 5 comments

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • [x] Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • [x] Ensure the tests and linter pass
  • [x] Code coverage does not decrease (if any source code was changed)
  • [x] Appropriate docs were updated (if necessary)

Fixes #354 🦕

kosperun avatar Jun 11 '24 21:06 kosperun

Not sure I am doing something wrong here, but I cannot leave a comment on this line. Maybe because your PR does not touch it?

Instead, I think we should change line 242 to:

if self.code_verifier is None and self.autogenerate_code_verifier:

My thoughts are:

  1. We want to use PKCE as much as possible.
  2. This keeps the logic near where the variables are used, so other refactors don't accidentally revert this behavior and new constructors don't have to repeat this check.

@Perun108 what are your thoughts?

clundin25 avatar Jun 19 '24 00:06 clundin25

@clundin25 Thank you so much for the suggestions. They make total sense. I updated my PR accordingly, please review. Thanks!

kosperun avatar Jun 29 '24 00:06 kosperun

Thank you @Perun108 for your contribution! This looks great! Would you mind fixing the unit tests?

clundin25 avatar Jul 01 '24 16:07 clundin25

@clundin25 Thank you, I'm so happy you found my little contribution valuable. Sure, I will try to fix the unit tests, but it will probably take me some time to figure out how the tests are set up and how the objects are mocked.

kosperun avatar Jul 05 '24 00:07 kosperun

@clundin25 Could you please take a look at my updated PR? I fixed failing tests. Thanks!

kosperun avatar Oct 14 '24 00:10 kosperun