|
1 | 1 | # CHANGELOG
|
2 | 2 |
|
| 3 | +## v2.0.0 |
| 4 | + |
| 5 | +* Add django_util (#332) |
| 6 | +* Avoid OAuth2Credentials `id_token` going out of sync after a token |
| 7 | + refresh (#337) |
| 8 | +* Move to a `contrib` sub-package code not considered a core part of |
| 9 | + the library (#346, #353, #370, #375, #376, #382) |
| 10 | +* Add `token_expiry` to `devshell` credentials (#372) |
| 11 | +* Move `Storage` locking into a base class (#379) |
| 12 | +* Added dictionary storage (#380) |
| 13 | +* Added `to_json` and `from_json` methods to all `Credentials` |
| 14 | + classes (#385) |
| 15 | +* Fall back to read-only credentials on EACCES errors (#389) |
| 16 | +* Coalesced the two `ServiceAccountCredentials` |
| 17 | + classes (#395, #396, #397, #398, #400) |
| 18 | + |
| 19 | +### Special Note About `ServiceAccountCredentials`: |
| 20 | +------------------------------------------------- |
| 21 | + |
| 22 | +For JSON keys, you can create a credential via |
| 23 | + |
| 24 | +```py |
| 25 | +from oauth2client.service_account import ServiceAccountCredentials |
| 26 | +credentials = ServiceAccountCredentials.from_json_keyfile_name( |
| 27 | + key_file_name, scopes=[...]) |
| 28 | +``` |
| 29 | + |
| 30 | +You can still rely on |
| 31 | + |
| 32 | +```py |
| 33 | +from oauth2client.client import GoogleCredentials |
| 34 | +credentials = GoogleCredentials.get_application_default() |
| 35 | +``` |
| 36 | + |
| 37 | +returning these credentials when you set the `GOOGLE_APPLICATION_CREDENTIALS` |
| 38 | +environment variable. |
| 39 | + |
| 40 | +For `.p12` keys, construct via |
| 41 | + |
| 42 | +```py |
| 43 | +credentials = ServiceAccountCredentials.from_p12_keyfil( |
| 44 | + service_account_email, key_file_name, scopes=[...]) |
| 45 | +``` |
| 46 | + |
| 47 | +though we urge you to use JSON keys (rather than `.p12` keys) if you can. |
| 48 | + |
| 49 | +This is equivalent to the previous method |
| 50 | + |
| 51 | +```py |
| 52 | +# PRE-oauth2client 2.0.0 EXAMPLE CODE! |
| 53 | +from oauth2client.client import SignedJwtAssertionCredentials |
| 54 | + |
| 55 | +with open(key_file_name, 'rb') as key_file: |
| 56 | + private_key = key_file.read() |
| 57 | + |
| 58 | +credentials = SignedJwtAssertionCredentials( |
| 59 | + service_account_email, private_key, scope=[...]) |
| 60 | +``` |
| 61 | + |
3 | 62 | ## v1.5.2
|
4 | 63 |
|
5 | 64 | * Add access token refresh error class that includes HTTP status (#310)
|
|
0 commit comments