Check whether a credential loaded from a store is expired before using it.#158
Check whether a credential loaded from a store is expired before using it.#158mattmoor wants to merge 1 commit intogoogleapis:masterfrom
Conversation
|
What hope is there for test coverage for this change? |
af59aa3 to
b930dde
Compare
|
Technically you were already covering it with bad tests. ;-) I fixed the break and added testing of an actual refresh. |
|
ping? |
|
Please tweak your commit message to be in accordance with http://chris.beams.io/posts/git-commit/#seven-rules. Code looks reasonable to me, but @anthmgoogle or @soltanmm, would you mind being a second pair of eyes and also reviewing? |
Today the _refresh logic lazily loads a credential from its store during _refresh, but blindly trusts its validity (no expiry check). This adds a check that the stored credential has not expired before updating from the cache, falling back on the existing uncached path.
|
Should be done. |
|
Commit message is much better; thanks. |
|
Created a updated pull request based on this logic at #173 that also covers the case where the token in the store is about to expire. |
|
this was actually included in #173 (i think we needed to mention that in the commit to magically close this?). |
No description provided.