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

Proactively refresh credentials when applying and treat a missing access_token as invalid. #469

Merged
merged 1 commit into from
Jan 18, 2018

Conversation

theacodes
Copy link
Contributor

@theacodes theacodes commented Jan 17, 2018

Closes #350, Supersedes #434

Note: This change reveals surprising behavior between default credentials and batches. If you allow googleapiclient.discovery.build to use default credentials and specify different credentials by providing batch.execute() with an explicit http argument, your individual requests will use the default credentials and not the credentials specified to the batch http. To avoid this, tell build explicitly not to use default credentials by specifying build(..., http=httplib2.Http().

For context, see:
#434 (comment)

…es_token as invalid.

Closes #350, Supersedes #434

Note: This change reveals surprising behavior between default credentials and batches. If you allow `googleapiclient.discovery.build` to use default credentials *and* specify different credentials by providing `batch.execut()` with an explicit `http` argument, your individual requests will use the default credentials and *not* the credentials specified to the bathc http. To avoid this, tell `build` explicitly not to use default credentials by specifying `build(..., http=httplib2.Http()`.

For context, see:
#434 (comment)
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 17, 2018
@theacodes theacodes merged commit 20e6135 into master Jan 18, 2018
@theacodes theacodes deleted the fix-batch-for-reals-this-time branch January 18, 2018 17:27
snarfed added a commit to snarfed/bridgy that referenced this pull request Jan 18, 2018
we no longer need the bug fix in my fork now that we have the workaround in snarfed/oauth-dropins@7641605 and improved refresh token handling in googleapis/google-api-python-client#469.
snarfed added a commit to snarfed/bridgy that referenced this pull request Oct 22, 2018
for #846. inspired by https://developers.googleblog.com/2018/03/discontinuing-support-for-json-rpc-and.html

had to pay attention to googleapis/google-api-python-client#469 since it affects us, but we pass its criteria - we do `build(..., http=httplib2.Http())` explicitly - so we should be ok.
snarfed added a commit to snarfed/oauth-dropins that referenced this pull request Oct 22, 2018
inspired by https://developers.googleblog.com/2018/03/discontinuing-support-for-json-rpc-and.html

had to pay attention to googleapis/google-api-python-client#469 since it affects us, but we pass its criteria - we do `build(..., http=httplib2.Http())` explicitly - so we should be ok.
snarfed added a commit to snarfed/granary that referenced this pull request Oct 22, 2018
inspired by https://developers.googleblog.com/2018/03/discontinuing-support-for-json-rpc-and.html

had to pay attention to googleapis/google-api-python-client#469 since it affects us, but we pass its criteria - we do `build(..., http=httplib2.Http())` explicitly - so we should be ok.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants