1# CHANGELOG 2 3## v3.0.0 4 5* Populate `token_expiry` for GCE credentials. (#473) 6* Move GCE metadata interface to a separate module. (#520) 7* Populate `scopes` for GCE credentials. (#524) 8* Fix Python 3.5 compatibility. (#531) 9* Add `oauth2client.contrib.sqlalchemy`, a SQLAlchemy-based credential store. (#527) 10* Improve error when an invalid client secret is provided. (#530) 11* Add `oauth2client.contrib.multiprocess_storage`. This supersedes the functionality in `oauth2client.contrib.multistore_file`. (#504) 12* Pull httplib2 usage into a separate transport module. (#559, #561) 13* Refactor all django-related code into `oauth2client.contrib.django_util`. Add `DjangoORMStorage`, remove `FlowField`. (#546) 14* Fix application default credentials resolution order. (#570) 15* Add configurable timeout for GCE metadata server check. (#571) 16* Add warnings when using deprecated `approval_prompt='force'`. (#572) 17* Add deprecation warning to `oauth2client.contrib.multistore_file`. (#574) 18* (Hygiene) PEP8 compliance and various style fixes (#537, #540, #552, #562) 19* (Hygiene) Remove duplicated exception classes in `oauth2client.contrib.appengine`. (#533) 20 21NOTE: The next major release of oauth2client (v4.0.0) will remove the `oauth2client.contrib.multistore_file` module. 22 23## v2.2.0 24 25* Added support to override `token_uri` and `revoke_uri` in `oauth2client.service_account.ServiceAccountCredentials`. (#510) 26* `oauth2client.contrib.multistore_file` now handles `OSError` in addition to `IOError` because Windows may raise `OSError` where other platforms will raise `IOError`. 27* `oauth2client.contrib.django_util` and `oauth2client.contrib.django_orm` have been updated to support Django 1.8 - 1.10. Versions of Django below 1.8 will not work with these modules. 28 29## v2.1.0 30 31* Add basic support for JWT access credentials. (#503) 32* Fix `oauth2client.client.DeviceFlowInfo` to use UTC instead of the system timezone when calculating code expiration. 33 34## v2.0.2 35 36* Fix issue where `flask_util.UserOAuth2.required` would accept expired credentials (#452). 37* Fix issue where `flask_util` would fill the session with `Flow` objects (#498). 38* Fix issue with Python 3 binary strings in `Flow.step2_exchange` (#446). 39* Improve test coverage to 100%. 40 41## v2.0.1 42 43* Making scopes optional on Google Compute Engine `AppAssertionCredentials` 44 and adding a warning that GCE won't honor scopes (#419) 45* Adding common `sign_blob()` to service account types and a 46 `service_account_email` property. (#421) 47* Improving error message in P12 factory 48 `ServiceAccountCredentials.from_p12_keyfile` when pyOpenSSL is 49 missing. (#424) 50* Allowing default flags in `oauth2client.tools.run_flow()` 51 rather than forcing users to create a dummy argparser (#426) 52* Removing `oauth2client.util.dict_to_tuple_key()` from public 53 interface (#429) 54* Adding `oauth2client.contrib._appengine_ndb` helper module 55 for `oauth2client.contrib.appengine` and moving most code that 56 uses the `ndb` library into the helper (#434) 57* Fix error in `django_util` sample code (#438) 58 59## v2.0.0-post1 60 61* Fix Google Compute Engine breakage (#411, breakage introduced in #387) that 62 made it impossible to obtain access tokens 63* Implement `ServiceAccountCredentials.from_p12_keyfile_buffer()` 64 to allow passing a file-like object in addition to the factory 65 constructor that uses a filename directly (#413) 66* Implement `ServiceAccountCredentials.create_delegated()` 67 to allow upgrading a credential to one that acts on behalf 68 of a given subject (#420) 69 70## v2.0.0 71 72* Add django_util (#332) 73* Avoid OAuth2Credentials `id_token` going out of sync after a token 74 refresh (#337) 75* Move to a `contrib` sub-package code not considered a core part of 76 the library (#346, #353, #370, #375, #376, #382) 77* Add `token_expiry` to `devshell` credentials (#372) 78* Move `Storage` locking into a base class (#379) 79* Added dictionary storage (#380) 80* Added `to_json` and `from_json` methods to all `Credentials` 81 classes (#385) 82* Fall back to read-only credentials on EACCES errors (#389) 83* Coalesced the two `ServiceAccountCredentials` 84 classes (#395, #396, #397, #398, #400) 85 86### Special Note About `ServiceAccountCredentials`: 87------------------------------------------------- 88 89For JSON keys, you can create a credential via 90 91```py 92from oauth2client.service_account import ServiceAccountCredentials 93credentials = ServiceAccountCredentials.from_json_keyfile_name( 94 key_file_name, scopes=[...]) 95``` 96 97You can still rely on 98 99```py 100from oauth2client.client import GoogleCredentials 101credentials = GoogleCredentials.get_application_default() 102``` 103 104returning these credentials when you set the `GOOGLE_APPLICATION_CREDENTIALS` 105environment variable. 106 107For `.p12` keys, construct via 108 109```py 110credentials = ServiceAccountCredentials.from_p12_keyfile( 111 service_account_email, key_file_name, scopes=[...]) 112``` 113 114though we urge you to use JSON keys (rather than `.p12` keys) if you can. 115 116This is equivalent to the previous method 117 118```py 119# PRE-oauth2client 2.0.0 EXAMPLE CODE! 120from oauth2client.client import SignedJwtAssertionCredentials 121 122with open(key_file_name, 'rb') as key_file: 123 private_key = key_file.read() 124 125credentials = SignedJwtAssertionCredentials( 126 service_account_email, private_key, scope=[...]) 127``` 128 129## v1.5.2 130 131* Add access token refresh error class that includes HTTP status (#310) 132* Python3 compatibility fixes for Django (#316, #318) 133* Fix incremental auth in flask_util (#322) 134* Fall back to credential refresh on EDEADLK in multistore_file (#336) 135 136## v1.5.1 137 138* Fix bad indent in `tools.run_flow()` (#301, bug was 139 introduced when switching from 2 space indents to 4) 140 141## v1.5.0 142 143* Fix (more like clarify) `bytes` / `str` handling in crypto 144 methods. (#203, #250, #272) 145* Replacing `webapp` with `webapp2` in `oauth2client.appengine` (#217) 146* Added optional `state` parameter to 147 `step1_get_authorize_url`. (#219 and #222) 148* Added `flask_util` module that provides a Flask extension to aid 149 with using OAuth2 web server flow. This provides the same functionality 150 as the `appengine.webapp2` OAuth2Decorator, but will work with any Flask 151 application regardless of hosting environment. (#226, #273) 152* Track scopes used on credentials objects (#230) 153* Moving docs to [readthedocs.org][1] (#237, #238, #244) 154* Removing `old_run` module. Was deprecated July 2, 2013. (#285) 155* Avoid proxies when querying for GCE metadata (to check if 156 running on GCE) (#114, #293) 157 158[1]: https://readthedocs.org/ 159 160## v1.4.12 161 162* Fix OS X flaky test failure (#189). 163* Fix broken OpenSSL import (#191). 164* Remove `@util.positional` from wrapped request in `Credentials.authorize()` 165 (#196, #197). 166* Changing pinned dependencies to `>=` (#200, #204). 167* Support client authentication using `Authorization` header (#206). 168* Clarify environment check in case where GAE imports succeed but GAE services 169 aren't available (#208). 170 171## v1.4.11 172 173* Better environment detection with Managed VMs. 174* Better OpenSSL detection in exotic environments. 175 176## v1.4.10 177 178* Update the `OpenSSL` check to be less strict about finding `crypto.py` in 179 the `OpenSSL` directory. 180* `tox` updates for new environment handling in `tox`. 181 182## v1.4.9 183 184* Ensure that the ADC fails if we try to *write* the well-known file to a 185 directory that doesn't exist, but not if we try to *read* from one. 186 187## v1.4.8 188 189* Better handling of `body` during token refresh when `body` is a stream. 190* Better handling of expired tokens in storage. 191* Cleanup around `openSSL` import. 192* Allow custom directory for the `well_known_file`. 193* Integration tests for python2 and python3. (!!!) 194* Stricter file permissions when saving the `well_known_file`. 195* Test cleanup around config file locations. 196 197## v1.4.7 198 199* Add support for Google Developer Shell credentials. 200* Better handling of filesystem errors in credential refresh. 201* python3 fixes 202* Add `NO_GCE_CHECK` for skipping GCE detection. 203* Better error messages on `InvalidClientSecretsError`. 204* Comment cleanup on `run_flow`. 205 206## v1.4.6 207 208* Add utility function to convert PKCS12 key to PEM. (#115) 209* Change GCE detection logic. (#93) 210* Add a tox env for doc generation. 211 212## v1.4.5 213 214* Set a shorter timeout for an Application Default Credentials issue on some 215 networks. (#93, #101) 216* Test cleanup, switch from mox to mock. (#103) 217* Switch docs to sphinx from epydoc. 218 219## v1.4.4 220 221* Fix a bug in bytes/string encoding of headers. 222 223## v1.4.3 224 225* Big thanks to @dhermes for spotting and fixing a mess in our test setup. 226 227* Fix a serious issue with tests not being run. (#86, #87, #89) 228* Start credentials cleanup for single 2LO/3LO call. (#83, #84) 229* Clean up stack traces when re-raising in some places. (#79) 230* Clean up doc building. (#81, #82) 231* Fixed minimum version for `six` dependency. (#75) 232 233## v1.4.2 234 235* Several small bugfixes related to `six`/py3 support. 236 237## v1.4.1 238 239* Fix a critical bug on import in `oauth2client.tools`. 240 241## v1.4 242 243* Merge python3 branch! Massive thanks due to @pferate and @methane for doing 244 the heavy lifting. 245 246* Make `oauth2client.tools` import gracefully if `argparse` isn't present. 247 248* Change `flow.step2_exchange` to preserve the raw `id_token` in the 249 `token_response` field. 250 251## v1.3.2 252 253* Quick bugfix for an issue with dict-like arguments to `flow.step2_exchange`, 254 which is common in some environments (such as GAE). 255 256## v1.3.1 257 258* Quick bugfix for bad error handling in from_json. 259 260## v1.3 261 262* Added support for the 263 [Google Application Default Credentials](https://developers.google.com/accounts/docs/application-default-credentials) 264 for more information (thanks @orestica). 265* Added support for OAuth2 for devices (#3, thanks @sde-melo). 266* The minimum required Python version is now 2.6. 267* The `anyjson` submodule has been removed. 268 269* Better exception handling around missing crypto libraries (#56). 270* Improve error messages in `AccessTokenRefreshError` (#53, thanks 271 @erickoledadevrel). 272* Drop `uritemplate` as a dependency. 273* Handle X509 certs with PyCrypto (#51, thanks @liujin-google). 274* Handle additional failure types on OSX (#32, thanks @simoncadman). 275* Better unicode handling with PKCS12 passwords (#31, thanks @jterrace). 276* Better retry handling with bad server replies on refresh (#29, thanks 277 @kaste). 278* Better logging for missing `refresh_token` in server replies (#21). 279* Support `login_hint` (#18, thanks @jay0lee). 280* Better overwrite options in `django_orm.Storage`. (#2, thanks @lraccomando). 281 282 283## v1.2 284 285* The use of the `gflags` library is now deprecated, and is no longer a 286 dependency. If you are still using the `oauth2client.tools.run()` function 287 then include `python-gflags` as a dependency of your application or switch to 288 `oauth2client.tools.run_flow`. 289* Samples have been updated to use the new `apiclient.sample_tools`, and no 290 longer use `gflags`. 291* Added support for the experimental Object Change Notification, as found in 292 the Cloud Storage API. 293* The oauth2client App Engine decorators are now threadsafe. 294 295* Use the following redirects feature of httplib2 where it returns the 296 ultimate URL after a series of redirects to avoid multiple hops for every 297 resumable media upload request. 298* Updated AdSense Management API samples to V1.3 299* Add option to automatically retry requests. 300* Ability to list registered keys in `multistore_file`. 301* User-agent must contain `(gzip)`. 302* The `method` parameter for `httplib2` is not positional. This would cause 303 spurious warnings in the logging. 304* Making OAuth2Decorator more extensible. Fixes Issue 256. 305* Update AdExchange Buyer API examples to version v1.2. 306 307 308## v1.1 309 310* Add PEM support to `SignedJWTAssertionCredentials` (used to only support 311 PKCS12 formatted keys). Note that if you use PEM formatted keys you can use 312 PyCrypto 2.6 or later instead of OpenSSL. 313 314* Allow deserialized discovery docs to be passed to `build_from_document()`. 315 316* Make `ResumableUploadError` derive from `HttpError`. 317* Many changes to move all the closures in `apiclient.discovery` into real 318 classes and objects. 319* Make `from_json` behavior inheritable. 320* Expose the full token response in `OAuth2Client` and `OAuth2Decorator`. 321* Handle reasons that are None. 322* Added support for NDB based storing of oauth2client objects. 323* Update `grant_type` for `AssertionCredentials`. 324* Adding a `.revoke()` to Credentials. Closes issue 98. 325* Modify `oauth2client.multistore_file` to store and retrieve credentials 326 using an arbitrary key. 327* Don't accept `403` challenges by default for auth challenges. 328* Set `httplib2.RETRIES` to 1. 329* Consolidate handling of scopes. 330* Upgrade to httplib2 version 0.8. 331* Allow setting the `response_type` in `OAuth2WebServerFlow`. 332* Ensure that `dataWrapper` feature is checked before using the `data` value. 333* HMAC verification does not use a constant time algorithm. 334 335## v1.0 336 337* Changes to the code for running tests and building releases. 338 339## v1.0c3 340 341* In samples and oauth2 decorator, escape untrusted content before displaying it. 342* Do not allow credentials files to be symlinks. 343* Add XSRF protection to oauth2decorator callback state. 344* Handle uploading chunked media by stream. 345* Handle passing streams directly to httplib2. 346* Add support for Google Compute Engine service accounts. 347* Flows no longer need to be saved between uses. 348* Change GET to POST if URI is too long. Fixes issue 96. 349* Add a `keyring`-based `Storage`. 350* More robust picking up JSON error responses. 351* Make batch errors align with normal errors. 352* Add a Google Compute sample. 353* Token refresh to work with old GData API. 354* Loading of `client_secrets` JSON file backed by a cache. 355* Switch to new discovery path parameters. 356* Add support for `additionalProperties` when printing schema'd objects. 357* [Fix media upload parameter names.](http://codereview.appspot.com/6374062/) 358* oauth2client support for URL-encoded format of exchange token response (e.g. 359 Facebook) 360* Build cleaner and easier to read docs for dynamic surfaces. 361 362## v1.0c2 363 364* Parameter values of None should be treated as missing. Fixes issue 144. 365* Distribute the samples separately from the library source. Fixes issue 155. 366* Move all remaining samples over to `client_secrets.json`. Fixes issue 156. 367* Make `locked_file.py` understand win32file primitives for better 368 awesomeness. 369 370## v1.0c1 371 372* Documentation for the library has 373 [switched to epydoc](http://google-api-python-client.googlecode.com/hg/docs/epy/index.html) 374* Many improvements for media support: 375 + Added media download support, including resumable downloads. 376 + Better handling of streams that report their size as 0. 377 + Update `MediaUpload` to include `io.Base` and also fix some bugs. 378* OAuth bug fixes and improvements. 379 + Remove OAuth 1.0 support. 380 + Added `credentials_from_code` and `credentials_from_clientsecrets_and_code`. 381 + Make oauth2client support Windows-friendly locking. 382 + Fix bug in `StorageByKeyName`. 383 + Fix `None` handling in Django fields. 384 [Fixes issue 128](http://codereview.appspot.com/6298084/). 385* [Add epydoc generated docs.](http://codereview.appspot.com/6305043/) 386* Move to PEP386 compliant version numbers. 387* New and updated samples 388 + Ad Exchange Buyer API v1 code samples. 389 + Automatically generate Samples wiki page from `README` files. 390 + Update Google Prediction samples. 391 + Add a Tasks sample that demonstrates Service accounts. 392 + [new analytics api samples.](http://codereview.appspot.com/5494058/) 393* Convert all inline samples to the Farm API for consistency. 394 395## v1.0beta8 396 397* Updated media upload support. 398* Many fixes for batch requests. 399* Better handling for requests that don't require a body. 400* Fix issues with Google App Engine Python 2.7 runtime. 401* Better support for proxies. 402* All Storages now have a `.delete()` method. 403* Important changes which might break your code: 404 + `apiclient.anyjson` has moved to `oauth2client.anyjson`. 405 + Some calls, for example, `taskqueue().lease()` used to require a parameter 406 named body. In this new release only methods that really need to send a 407 body require a body parameter, and so you may get errors about an unknown 408 `body` parameter in your call. The solution is to remove the unneeded 409 `body={}` parameter. 410 411## v1.0beta7 412 413* Support for 414 [batch requests](http://code.google.com/p/google-api-python-client/wiki/Batch). 415* Support for 416 [media upload](http://code.google.com/p/google-api-python-client/wiki/MediaUpload). 417* Better handling for APIs that return something other than JSON. 418* Major cleanup and consolidation of the samples. 419* Bug fixes and other enhancements: 420 72 Defect Appengine OAuth2Decorator: Convert redirect address to string 421 22 Defect Better error handling for unknown service name or version 422 48 Defect StorageByKeyName().get() has side effects 423 50 Defect Need sample client code for Admin Audit API 424 28 Defect better comments for app engine sample Nov 9 425 63 Enhancement Let OAuth2Decorator take a list of scope 426