A class to implement caching for any object implementing FetchAuthTokenInterface

CloneableInstantiable
ImplementsGoogle\Auth\FetchAuthTokenInterface
Google\Auth\GetQuotaProjectInterface
Google\Auth\ProjectIdProviderInterface
Google\Auth\SignBlobInterface
Constants
public Google\Auth\GetQuotaProjectInterface::X_GOOG_USER_PROJECT_HEADER = 'X-Goog-User-Project'
Methods
public __construct(Google\Auth\FetchAuthTokenInterface $fetcher, ?array $cacheConfig = NULL, Psr\Cache\CacheItemPoolInterface $cache)
public fetchAuthToken(?callable $httpHandler = NULL)
 
Implements FetchAuthTokenInterface#fetchAuthToken.

Checks the cache for a valid auth token and fetches the auth tokens
from the supplied fetcher.

  • return array the response
  • throws Exception
public getCacheKey()
 


  • return string
public getClientName(?callable $httpHandler = NULL)
 
Get the client name from the fetcher.

  • return string
public getLastReceivedToken()
 


  • return array|null
public getProjectId(?callable $httpHandler = NULL)
public getQuotaProject()
 
Get the quota project used for this API request from the credentials fetcher.

  • return string|null
public signBlob( $stringToSign, $forceOpenSsl = false)
 
Sign a blob using the fetcher.

  • return string The resulting signature.
  • throws RuntimeException If the fetcher does not implement `Google\Auth\SignBlobInterface`.
Properties
private $cache
 


  • var CacheItemPoolInterface
private $cacheConfig
 


  • var array
private $fetcher
private $maxKeyLength
Methods
private getCachedValue( $k)
 
Gets the cached value if it is present in the cache when that is available.

private getFullCacheKey( $key)
private setCachedValue( $k, $v)
 
Saves the value in the cache when that is available.

© 2020 Bruce Wells
Search Namespaces \ Classes
ConfigurationNumbers (0-9.) only