-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
moves caching to wrapper class 'FetchAuthTokenCache' and adds Memory cache #123
Conversation
@dwsupplee and @jdpedrie I would love it if you could take a look as well! |
0da60bd
to
c781f7d
Compare
// Use the cached value if its available. | ||
// | ||
// TODO: correct caching; update the call to setCachedValue to set the expiry | ||
// to the value returned with the auth token. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
LGTM, I have one question but it can be left as TODO and you can file another PR. |
As discussed, we should add an in-memory implementation for PSR-6 (for example) to this library to use as a default caching mechanism. This can be consumed by googleapis/gax-php and googlecloudplatform/gcloud-php |
I've opened #126 against this PR which includes an in-memory implementation. Let me know what you think :). |
* add simple in-memory cache implementation
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
I consent |
yeah it doesn't seem to work quite right in this scenario 😄 |
Addresses #121
Highlights:
FetchAuthTokenCache
wrapper class to implement caching on anything implementingFetchAuthTokenInterface
.AppIdentityCredentials
- Caching here is handled by the AppIdentityServicegetCacheKey
from Cache Trait - that function does not exist as part of the trait, and as a result was causing some unexpected problems. The cache key is now explicitly passed in.