| Home | Trees | Indices | Help |
|---|
|
|
Utilities for reading OAuth 2.0 client secret files. A client_secrets.json file contains all the information needed to interact with an OAuth 2.0 protected service.
Author: jcgregorio@google.com (Joe Gregorio)
|
|||
|
Error Base error for this module. |
|||
|
InvalidClientSecretsError Format of ClientSecrets file is invalid. |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
TYPE_WEB = 'web'
|
|||
TYPE_INSTALLED = 'installed'
|
|||
VALID_CLIENT = {TYPE_WEB: {'required': ['client_id', 'client_s
|
|||
|
|||
Loading of client_secrets JSON file, optionally backed by a cache.
Typical cache storage would be App Engine memcache service,
but you can pass in any other cache client that implements
these methods:
- get(key, namespace=ns)
- set(key, value, namespace=ns)
Usage:
# without caching
client_type, client_info = loadfile('secrets.json')
# using App Engine memcache service
from google.appengine.api import memcache
client_type, client_info = loadfile('secrets.json', cache=memcache)
Args:
filename: string, Path to a client_secrets.json file on a filesystem.
cache: An optional cache service client that implements get() and set()
methods. If not specified, the file is always being loaded from
a filesystem.
Raises:
InvalidClientSecretsError: In case of a validation error or some
I/O failure. Can happen only on cache miss.
Returns:
(client_type, client_info) tuple, as _loadfile() normally would.
JSON contents is validated only during first load. Cache hits are not
validated.
|
|
|||
VALID_CLIENT
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Mon Sep 29 15:21:51 2014 | http://epydoc.sourceforge.net |