Commit 5210996
authored
fix: fix expiry for
* This patch for </issues/501> includes the following fixes:
- The access token is always set to `None`, so the fix involves using (the access) `token` from the saved JSON credentials file.
- For refresh needs, `expiry` also needs to be saved via `to_json()`.
- DUMP: As `expiry` is a `datetime.datetime` object, serialize to `datetime.isoformat()` in the same [`oauth2client` format](https://github.com/googleapis/oauth2client/blob/master/oauth2client/client.py#L55) for consistency.
- LOAD: Add code to restore `expiry` back to `datetime.datetime` object when imported.
- LOAD: If `expiry` was unsaved, automatically set it as expired so refresh takes place.
- Minor `scopes` updates
- DUMP: Add property for `scopes` so `to_json()` can grab it
- LOAD: `scopes` may be saved as a string instead of a JSON array (Python list), so ensure it is Sequence[str] when imported.to_json() (#589)1 parent ca3b882 commit 5210996
File tree
2 files changed
+57
-10
lines changed- packages/google-auth
- google/oauth2
- tests/oauth2
2 files changed
+57
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| 100 | + | |
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
| |||
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
| |||
241 | 249 | | |
242 | 250 | | |
243 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
244 | 267 | | |
245 | | - | |
246 | | - | |
247 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
248 | 271 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
254 | 276 | | |
255 | 277 | | |
256 | 278 | | |
| |||
294 | 316 | | |
295 | 317 | | |
296 | 318 | | |
| 319 | + | |
| 320 | + | |
297 | 321 | | |
298 | | - | |
| 322 | + | |
299 | 323 | | |
300 | 324 | | |
301 | 325 | | |
| |||
316 | 340 | | |
317 | 341 | | |
318 | 342 | | |
319 | | - | |
320 | 343 | | |
321 | 344 | | |
322 | 345 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
362 | 376 | | |
363 | 377 | | |
364 | 378 | | |
| |||
381 | 395 | | |
382 | 396 | | |
383 | 397 | | |
| 398 | + | |
| 399 | + | |
384 | 400 | | |
| 401 | + | |
385 | 402 | | |
386 | 403 | | |
387 | 404 | | |
| |||
392 | 409 | | |
393 | 410 | | |
394 | 411 | | |
| 412 | + | |
395 | 413 | | |
396 | 414 | | |
397 | 415 | | |
| |||
403 | 421 | | |
404 | 422 | | |
405 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
406 | 430 | | |
407 | 431 | | |
408 | 432 | | |
| |||
0 commit comments