-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Adding get_for_service_account_json function in credentials. #641
Conversation
@@ -72,8 +73,34 @@ def get_credentials(): | |||
return client.GoogleCredentials.get_application_default() | |||
|
|||
|
|||
def get_for_service_account_json(private_key_path, scope=None): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This LGTM. That said - I think it'd be useful to add an example which would ideally go in a separate "auth" section in the docs. Do we have an open issue for that or should I create one? |
#633 is the issue, I actually have a branch I've been working on for awhile, I just keep getting sidetracked on it. |
Renamed to |
"""Gets the credentials for a service account with JSON key. | ||
|
||
:type json_credentials_path: string | ||
:param json_credentials_path: The path to a private key file (this file was |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
LGTM after pep8 passes. |
Was private_key_path.
Adding get_for_service_account_json function in credentials.
* feat: added dialogflow_assist_answer feat: added session_ttl feat: added human_agent_side_config feat: added suggestion_input feat: added suggest_dialogflow_assists_response feat: added suggest_entity_extraction_response PiperOrigin-RevId: 542021587 Source-Link: googleapis/googleapis@f40416d Source-Link: googleapis/googleapis-gen@04ca491 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDRjYTQ5MWRlYzhmMzUxNzNlZTU5OWQ3ZWQwNzkzNmI0MDg2ZTk2ZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: added dialogflow_assist_answer feat: added session_ttl feat: added human_agent_side_config feat: added suggestion_input feat: added suggest_dialogflow_assists_response feat: added suggest_entity_extraction_response PiperOrigin-RevId: 542024928 Source-Link: googleapis/googleapis@06f7999 Source-Link: googleapis/googleapis-gen@0f124f3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGYxMjRmM2MzN2I1YTYwNDk5MDZhOTUxNGNkOTk0ZGFmMDczZGMwMSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Fixes #638.
@jgeewax PTAL
I thought about wrapping JSON key and PKCS12 key into one method but the JSON key is actual a JSON payload with everything needed, e.g.
whereas a P12 key is just the bytes in
private_key
(and created for PKCS12 rather than PEM).I don't think it's worth trying to smash together the two API surfaces: