CouchdbCredentials

CouchdbCredentials

Synopsis

                    CouchdbCredentials;
                    CouchdbCredentialsClass;
enum                CouchdbCredentialsType;
CouchdbCredentials * couchdb_credentials_new_with_oauth (const gchar *consumer_key,
                                                         const gchar *consumer_secret,
                                                         const gchar *token_key,
                                                         const gchar *token_secret);
CouchdbCredentials * couchdb_credentials_new_with_username_and_password
                                                        (const gchar *username,
                                                         const gchar *password);
CouchdbCredentialsType  couchdb_credentials_get_auth_type
                                                        (CouchdbCredentials *credentials);
#define             COUCHDB_CREDENTIALS_ITEM_OAUTH_CONSUMER_KEY
#define             COUCHDB_CREDENTIALS_ITEM_OAUTH_CONSUMER_SECRET
#define             COUCHDB_CREDENTIALS_ITEM_OAUTH_TOKEN_KEY
#define             COUCHDB_CREDENTIALS_ITEM_OAUTH_TOKEN_SECRET
#define             COUCHDB_CREDENTIALS_ITEM_USERNAME
#define             COUCHDB_CREDENTIALS_ITEM_PASSWORD
const gchar *       couchdb_credentials_get_item        (CouchdbCredentials *credentials,
                                                         const gchar *item);
void                couchdb_credentials_set_item        (CouchdbCredentials *credentials,
                                                         const gchar *item,
                                                         const gchar *value);
                    CouchdbCredentialsPrivate;

Object Hierarchy

  GObject
   +----CouchdbCredentials

Description

Details

CouchdbCredentials

typedef struct _CouchdbCredentials CouchdbCredentials;


CouchdbCredentialsClass

typedef struct {
	GObjectClass parent_class;
} CouchdbCredentialsClass;


enum CouchdbCredentialsType

typedef enum {
	COUCHDB_CREDENTIALS_TYPE_UNKNOWN = -1,
	COUCHDB_CREDENTIALS_TYPE_OAUTH,
	COUCHDB_CREDENTIALS_TYPE_USERNAME_AND_PASSWORD
} CouchdbCredentialsType;


couchdb_credentials_new_with_oauth ()

CouchdbCredentials * couchdb_credentials_new_with_oauth (const gchar *consumer_key,
                                                         const gchar *consumer_secret,
                                                         const gchar *token_key,
                                                         const gchar *token_secret);

Create a new CouchdbCredentials object to be used for OAuth authentication.

consumer_key :

OAuth consumer key

consumer_secret :

OAuth consumer secret

token_key :

OAuth token key

token_secret :

OAuth token secret

Returns :

A CouchdbCredentials object.

couchdb_credentials_new_with_username_and_password ()

CouchdbCredentials * couchdb_credentials_new_with_username_and_password
                                                        (const gchar *username,
                                                         const gchar *password);

Create a new CouchdbCredentials object to be used for username and password based HTTP authentication scheme such as Basic or Digest.

Authentication is delegated to LibSoup.

username :

HTTP Authentication username

password :

HTTP Authentication password

Returns :

A CouchdbCredentials object.

couchdb_credentials_get_auth_type ()

CouchdbCredentialsType  couchdb_credentials_get_auth_type
                                                        (CouchdbCredentials *credentials);

Retrieve the type of authentication defined for the given CouchdbCredentials object.

credentials :

A CouchdbCredentials object

Returns :

A CouchdbCredentialsType specifying the type of authentication.

COUCHDB_CREDENTIALS_ITEM_OAUTH_CONSUMER_KEY

#define COUCHDB_CREDENTIALS_ITEM_OAUTH_CONSUMER_KEY    "oauth_consumer_key"


COUCHDB_CREDENTIALS_ITEM_OAUTH_CONSUMER_SECRET

#define COUCHDB_CREDENTIALS_ITEM_OAUTH_CONSUMER_SECRET "oauth_consumer_secret"


COUCHDB_CREDENTIALS_ITEM_OAUTH_TOKEN_KEY

#define COUCHDB_CREDENTIALS_ITEM_OAUTH_TOKEN_KEY       "oauth_token_key"


COUCHDB_CREDENTIALS_ITEM_OAUTH_TOKEN_SECRET

#define COUCHDB_CREDENTIALS_ITEM_OAUTH_TOKEN_SECRET    "oauth_token_secret"


COUCHDB_CREDENTIALS_ITEM_USERNAME

#define COUCHDB_CREDENTIALS_ITEM_USERNAME	       "username"


COUCHDB_CREDENTIALS_ITEM_PASSWORD

#define COUCHDB_CREDENTIALS_ITEM_PASSWORD	       "password"


couchdb_credentials_get_item ()

const gchar *       couchdb_credentials_get_item        (CouchdbCredentials *credentials,
                                                         const gchar *item);

Get the value associated with one authentication item on the given CouchdbCredentials object. The valid values are the COUCHDB_CREDENTIALS_ITEM_* values defined in couchdb-credentials.h.

credentials :

A CouchdbCredentials object

item :

Name of the item to retrieve

Returns :

The value associated with the given item, or NULL if not found.

couchdb_credentials_set_item ()

void                couchdb_credentials_set_item        (CouchdbCredentials *credentials,
                                                         const gchar *item,
                                                         const gchar *value);

Set the value associated with one authentication item on the given CouchdbCredentials object. The valid values are the COUCHDB_CREDENTIALS_ITEM_* values defined in couchdb-credentials.h.

credentials :

A CouchdbCredentials object

item :

Name of the item to set the value of value: Value of the item

CouchdbCredentialsPrivate

typedef struct _CouchdbCredentialsPrivate CouchdbCredentialsPrivate;