Example #1
0
 def _get_storage(self):
   """Returns oauth2client.Storage with cached tokens."""
   # Do not mix cache keys for different externally provided tokens.
   if self._external_token:
     token_hash = hashlib.sha1(self._external_token.refresh_token).hexdigest()
     cache_key = '%s:refresh_tok:%s' % (self._token_cache_key, token_hash)
   else:
     cache_key = self._token_cache_key
   return multistore_file.get_credential_storage_custom_string_key(
       OAUTH_TOKENS_CACHE, cache_key)
Example #2
0
 def _get_storage(self):
     """Returns oauth2client.Storage with cached tokens."""
     # Do not mix cache keys for different externally provided tokens.
     if self._external_token:
         token_hash = hashlib.sha1(self._external_token.refresh_token).hexdigest()
         cache_key = "%s:refresh_tok:%s" % (self._token_cache_key, token_hash)
     else:
         cache_key = self._token_cache_key
     path = _get_token_cache_path()
     logging.debug("Using token storage %r (cache key %r)", path, cache_key)
     return multistore_file.get_credential_storage_custom_string_key(path, cache_key)
Example #3
0
 def _get_storage(self):
   """Returns oauth2client.Storage with cached tokens."""
   # Do not mix cache keys for different externally provided tokens.
   if self._external_token:
     token_hash = hashlib.sha1(self._external_token.refresh_token).hexdigest()
     cache_key = '%s:refresh_tok:%s' % (self._token_cache_key, token_hash)
   else:
     cache_key = self._token_cache_key
   path = _get_token_cache_path()
   logging.debug('Using token storage %r (cache key %r)', path, cache_key)
   return multistore_file.get_credential_storage_custom_string_key(
       path, cache_key)