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

auth: add client_json and client_json_dict #206

Merged
merged 4 commits into from
Jul 18, 2022
Merged

auth: add client_json and client_json_dict #206

merged 4 commits into from
Jul 18, 2022

Conversation

efiop
Copy link
Contributor

@efiop efiop commented Jul 18, 2022

client_creds_dict was introduced in experimental mode before (a few days back) and wasn't documented. Renaming it into client_json_dict to be consistent with other options.

Introducing client_json for convenience to syncronize with oauth2 storage options so that users can use either dict or json and not be forced to use both of them when authenticating.

@efiop efiop temporarily deployed to internal July 18, 2022 19:45 Inactive
@efiop efiop temporarily deployed to internal July 18, 2022 19:47 Inactive

if not keyfile_dict and keyfile_json:
# Compensating for missing ServiceAccountCredentials.from_json_keyfile
keyfile_dict = json.loads(keyfile_json)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note, from_json_keyfile_name is naively loading the json too and any errors pass right through. Same here.

@efiop efiop temporarily deployed to internal July 18, 2022 19:58 Inactive
Comment on lines +76 to +78
client_json_file_path: {{str}}
client_json_dict: {{dict}}
client_json: {{str}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understand that having all three might seem excessive, but it is really useful and in sync with the flexibility that ServiceAccountCredentials.from_json* provides.

pydrive2/auth.py Show resolved Hide resolved
docs/oauth.rst Outdated Show resolved Hide resolved
docs/oauth.rst Outdated Show resolved Hide resolved
@efiop efiop temporarily deployed to internal July 18, 2022 20:51 Inactive
Copy link
Member

@shcheklein shcheklein left a comment

Choose a reason for hiding this comment

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

looks good to me, only minor questions

@efiop efiop temporarily deployed to internal July 18, 2022 21:04 Inactive
@efiop efiop temporarily deployed to internal July 18, 2022 21:09 Inactive
@efiop efiop temporarily deployed to internal July 18, 2022 21:16 Inactive
@efiop efiop temporarily deployed to internal July 18, 2022 21:31 Inactive
@efiop efiop temporarily deployed to internal July 18, 2022 21:43 Inactive
@efiop efiop merged commit f2de358 into master Jul 18, 2022
@efiop efiop deleted the auth branch July 18, 2022 21:50
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.

2 participants