Proactively refresh credentials when applying and treat a missing acces_token as invalid. (#469)

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:
https://github.com/google/google-api-python-client/pull/434#issuecomment-358439456
2 files changed
tree: a6bd7864fcbbfe623807b12b5a3e8d98f26b04fb
  1. .github/
  2. apiclient/
  3. docs/
  4. googleapiclient/
  5. samples/
  6. static/
  7. tests/
  8. tools/
  9. .coveragerc
  10. .gitignore
  11. .gitmodules
  12. .hgignore
  13. .travis.yml
  14. CHANGELOG
  15. describe.py
  16. expandsymlinks.py
  17. LICENSE
  18. Makefile
  19. MANIFEST.in
  20. README.md
  21. samples-index.py
  22. setup.py
  23. sitecustomize.py
  24. tox.ini
README.md

Library maintenance

This client library is supported but in maintenance mode only. We are fixing necessary bugs and adding essential features to ensure this library continues to meet your needs for accessing Google APIs. Non-critical issues will be closed. Any issue may be reopened if it is causing ongoing problems.

About

This is the Python client library for Google's discovery based APIs. To get started, please see the full documentation for this library. Additionally, dynamically generated documentation is available for all of the APIs supported by this library.

Google Cloud Platform APIs

If you're working with Google Cloud Platform APIs such as Datastore or Pub/Sub, consider using the Cloud Client Libraries for Python instead. These are the new and idiomatic Python libraries targeted specifically at Google Cloud Platform Services.

Installation

To install, simply use pip or easy_install:

$ pip install --upgrade google-api-python-client

or

$ easy_install --upgrade google-api-python-client

See the Developers Guide for more detailed instructions and additional documentation.

Python Version

Python 2.7, 3.4, 3.5, and 3.6 are fully supported and tested. This library may work on later versions of 3, but we do not currently run tests against those versions.

Third Party Libraries and Dependencies

The following libraries will be installed when you install the client library:

For development you will also need the following libraries:

Contributing

Please see the contributing page for more information. In particular, we love pull requests - but please make sure to sign the contributor license agreement.