-
Notifications
You must be signed in to change notification settings - Fork 430
Support token_uri and revoke_uri in ServiceAccountCredentials #510
Conversation
This change adds support for custom authorization token and revocation URIs in the various ServiceAccountCredentials factory methods. It also makes the factory method from_p12_keyfile_contents public for use by clients who have already loaded the file.
token_uri: string, URI for token endpoint. For convenience defaults | ||
to Google's endpoints but any OAuth 2.0 provider can be | ||
used. | ||
revoke_uri: string, URI for revoke endpoint. |
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.
Who wants to lead review? @dhermes? @jonparrott? Should we be reticent about promoting |
@nathanielmanistaatgoogle You get the prize (as the official official maintainer). No need to make |
The argument for publicizing from_p12_keyfile_contents is that currently if I have already read the file (say for the purposes of determining whether it's a JSON file or not), there is no need for oauth2client to re-open the file |
ping @nathanielmanistaatgoogle (this request blocks a few others in my pipeline) |
RE:
A user can just use |
Done. |
FYI, I need to amend this to take token/revoke URIs from a JSON key file to fix #513. The new behavior will be:
|
Amendments complete, this now fixes #513 |
Ping - this should be ready to go. |
@nathanielmanistaatgoogle is out on vacation. @thobrla I'd still like to see the comments around the After that, this change LGTM. However, I'd like to have @dhermes take a look before I merge if he has the time. |
PTAL Made |
@@ -172,22 +188,41 @@ def _from_parsed_json_keyfile(cls, keyfile_dict, scopes): | |||
private_key_pkcs8_pem = keyfile_dict['private_key'] | |||
private_key_id = keyfile_dict['private_key_id'] | |||
client_id = keyfile_dict['client_id'] | |||
if not token_uri: | |||
if 'token_uri' in keyfile_dict: |
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.
Two more comments. If @dhermes doesn't object by EOD today, I'll merge once those two comments are addressed. |
I don't have much bandwidth but this looks mostly OK. |
Thanks, @dhermes |
This change adds support for custom authorization token
and revocation URIs in the various ServiceAccountCredentials
factory methods.
It also makes the factory method from_p12_keyfile_contents
public for use by clients who have already loaded the file.