| Trees | Indices | Help |
|---|
|
|
Multi-credential file store with lock support.
This module implements a JSON credential store where multiple
credentials can be stored in one file. That file supports locking
both in a single process and across processes.
The credential themselves are keyed off of:
* client_id
* user_agent
* scope
The format of the stored data is like so:
{
'file_version': 1,
'data': [
{
'key': {
'clientId': '<client id>',
'userAgent': '<user agent>',
'scope': '<scope>'
},
'credential': {
# JSON serialized Credentials.
}
}
]
}
Author: jbeda@google.com (Joe Beda)
|
|||
|
Error Base error for this module. |
|||
|
NewerCredentialStoreError The credential store is a newer version that supported. |
|||
|
_MultiStore A file backed store for multiple credentials. |
|||
|
|||
|
|||
|
|||
logger = logging.getLogger(__name__)
|
|||
_multistores = {}
|
|||
_multistores_lock = threading.Lock()
|
|||
|
|||
Get a Storage instance for a credential. Args: filename: The JSON file storing a set of credentials client_id: The client_id for the credential user_agent: The user agent for the credential scope: string or list of strings, Scope(s) being requested warn_on_readonly: if True, log a warning if the store is readonly Returns: An object derived from client.Storage for getting/setting the credential.
|
| Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Tue Nov 6 12:07:11 2012 | http://epydoc.sourceforge.net |