Google APIs Client Library for C++
|
Base class for a data store of persisted credentials. More...
#include "client/auth/credential_store.h"
Public Member Functions | |
CredentialStore () | |
Standard constructor. | |
virtual | ~CredentialStore () |
Standard destructor. | |
void | set_codec (Codec *codec) |
Sets the Codec that this store should use for re-encoding and decoding data streams. | |
Codec * | codec () const |
Returns the codec for this store. | |
virtual util::Status | InitCredential (const StringPiece &user_name, AuthorizationCredential *credential)=0 |
Restore a credential for the given user name. | |
virtual util::Status | Store (const StringPiece &user_name, const AuthorizationCredential &credential)=0 |
Stores the credential under the given user_name. | |
virtual util::Status | Delete (const StringPiece &user_name)=0 |
Deletes the credential with the given user_name. | |
Protected Member Functions | |
DataReader * | DecodedToEncodingReader (DataReader *reader, util::Status *status) |
Applies the codec (if any) to decode a reader. | |
DataReader * | EncodedToDecodingReader (DataReader *reader, util::Status *status) |
Applies the codec (if any) to encode a reader. |
Base class for a data store of persisted credentials.
This interface is in terms of the DataReader that the abstract AuthorizationCredential uses. Therefore it is suitable for any type of credential derived from AuthorizationCredential, including the OAuth2Credential introduced in the OAuth 2.0 module.
Although no encryption mechanism is provided at this time, the CredentialStore will accomodate one injected using a Codec that you can write.
CredentialStore | ( | ) |
Standard constructor.
virtual ~CredentialStore | ( | ) | [virtual] |
Standard destructor.
Returns the codec for this store.
DataReader* DecodedToEncodingReader | ( | DataReader * | reader, |
util::Status * | status | ||
) | [protected] |
Applies the codec (if any) to decode a reader.
[in] | reader | The caller passes ownership to the reader. |
[out] | status | Success if the reader could be decoded. |
virtual util::Status Delete | ( | const StringPiece & | user_name | ) | [pure virtual] |
Deletes the credential with the given user_name.
[in] | user_name | The key to remove. |
DataReader* EncodedToDecodingReader | ( | DataReader * | reader, |
util::Status * | status | ||
) | [protected] |
Applies the codec (if any) to encode a reader.
[in] | reader | The caller passes ownership to the reader. |
[out] | status | Success if the reader could be encoded. |
virtual util::Status InitCredential | ( | const StringPiece & | user_name, |
AuthorizationCredential * | credential | ||
) | [pure virtual] |
Restore a credential for the given user name.
[in] | user_name | The key to store from |
[out] | credential | The credential to load into. |
Sets the Codec that this store should use for re-encoding and decoding data streams.
The intention here is to encrypt and decrypt but the codec can be used for any purpose.
[in] | codec | Ownership is passsed to the store. NULL is permitted to mean do not perform any encryption or decryption. |
virtual util::Status Store | ( | const StringPiece & | user_name, |
const AuthorizationCredential & | credential | ||
) | [pure virtual] |
Stores the credential under the given user_name.
This will replace any previously stored credential for the user_name.
[in] | user_name | The key to store the credential under. |
[in] | credential | The credential to store. |