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

Obtaining Credentials Vs Using Credentials --- Separate Them For Clarity's Sake #328

Open
mohsenBanan opened this issue Jun 18, 2022 · 0 comments
Assignees

Comments

@mohsenBanan
Copy link

Summary

To the extent that this is sample code, clarity should be considered integral and fundamental.

Lack of clarity is an "issue". This "issue" applies to most google quickstart.py. All of those can benefit from this.

main() is doing two things:

  1. obtains the credentials
  2. uses the credentials to do some thing

So, on top of main() create a function called: obtain_credentials(scopes).
It would return creds.

main() would then first do
creds = obtain_credentials(scopes)
and then comes the service usage part.

This way, the whole thing is a lot more clear and less duplicated (across all quickstart.py-s)

Expected Behavior

See above.

Actual Behavior

See Above.

Steps to Reproduce the Problem

See Above.

Specifications

  • Python version (python --version) = ALL
  • OS (Mac/Linux/Windows) = ALL
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

No branches or pull requests

2 participants