[grilo] core: add grl_config_get/set_api_token_secret()
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] core: add grl_config_get/set_api_token_secret()
- Date: Tue, 23 Apr 2013 08:29:40 +0000 (UTC)
commit b590157c45a14eb95c54091a75eb109cf1bcf438
Author: Marek Chalupa <mchalupa redhat com>
Date: Mon Apr 22 09:19:25 2013 +0200
core: add grl_config_get/set_api_token_secret()
Two new functions added to grl-config.[ch], needed by oauth
authentication proccess.
https://bugzilla.gnome.org/show_bug.cgi?id=697175
Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
src/data/grl-config.c | 35 +++++++++++++++++++++++++++++++++++
src/data/grl-config.h | 21 +++++++++++++--------
2 files changed, 48 insertions(+), 8 deletions(-)
---
diff --git a/src/data/grl-config.c b/src/data/grl-config.c
index 0d68f01..fb981af 100644
--- a/src/data/grl-config.c
+++ b/src/data/grl-config.c
@@ -446,6 +446,25 @@ grl_config_set_api_token (GrlConfig *config, const gchar *token)
}
/**
+ * grl_config_set_api_token_secret:
+ * @config: the config instance
+ * @secret: the API token
+ *
+ * Set the webservice API token secret in the configuration
+ * (Needed by OAuth)
+ *
+ * Since: 0.2.5
+ */
+void
+grl_config_set_api_token_secret (GrlConfig *config, const gchar *secret)
+{
+ grl_config_set_string (GRL_CONFIG (config),
+ GRL_CONFIG_KEY_APITOKEN_SECRET,
+ secret);
+}
+
+
+/**
* grl_config_set_api_secret:
* @config: the config instance
* @secret: the webservice passphrase
@@ -570,6 +589,22 @@ grl_config_get_api_token (GrlConfig *config)
}
/**
+ * grl_config_get_api_token_secret:
+ * @config: the config instance
+ *
+ * Returns: the webservice API token secret
+ * (Needed by OAuth)
+ *
+ * Since: 0.2.5
+ */
+gchar *
+grl_config_get_api_token_secret (GrlConfig *config)
+{
+ return grl_config_get_string (GRL_CONFIG (config),
+ GRL_CONFIG_KEY_APITOKEN_SECRET);
+}
+
+/**
* grl_config_get_api_secret:
* @config: the config instance
*
diff --git a/src/data/grl-config.h b/src/data/grl-config.h
index 020521c..df5536c 100644
--- a/src/data/grl-config.h
+++ b/src/data/grl-config.h
@@ -63,14 +63,15 @@ G_BEGIN_DECLS
GRL_TYPE_CONFIG, \
GrlConfigClass))
-#define GRL_CONFIG_KEY_PLUGIN "target-plugin"
-#define GRL_CONFIG_KEY_SOURCE "target-source"
-#define GRL_CONFIG_KEY_APIKEY "api-key"
-#define GRL_CONFIG_KEY_APIKEY_BLOB "api-key-blob"
-#define GRL_CONFIG_KEY_APITOKEN "api-token"
-#define GRL_CONFIG_KEY_APISECRET "api-secret"
-#define GRL_CONFIG_KEY_USERNAME "username"
-#define GRL_CONFIG_KEY_PASSWORD "password"
+#define GRL_CONFIG_KEY_PLUGIN "target-plugin"
+#define GRL_CONFIG_KEY_SOURCE "target-source"
+#define GRL_CONFIG_KEY_APIKEY "api-key"
+#define GRL_CONFIG_KEY_APIKEY_BLOB "api-key-blob"
+#define GRL_CONFIG_KEY_APITOKEN "api-token"
+#define GRL_CONFIG_KEY_APITOKEN_SECRET "api-token-secret"
+#define GRL_CONFIG_KEY_APISECRET "api-secret"
+#define GRL_CONFIG_KEY_USERNAME "username"
+#define GRL_CONFIG_KEY_PASSWORD "password"
typedef struct _GrlConfig GrlConfig;
typedef struct _GrlConfigPrivate GrlConfigPrivate;
@@ -109,6 +110,8 @@ void grl_config_set_api_key_blob (GrlConfig *config, const guint8 *blob, gsize s
void grl_config_set_api_token (GrlConfig *config, const gchar *token);
+void grl_config_set_api_token_secret (GrlConfig *config, const gchar *secret);
+
void grl_config_set_api_secret (GrlConfig *config, const gchar *secret);
void grl_config_set_username (GrlConfig *config, const gchar *username);
@@ -125,6 +128,8 @@ guint8 *grl_config_get_api_key_blob (GrlConfig *config, gsize *size);
gchar *grl_config_get_api_token (GrlConfig *config);
+gchar *grl_config_get_api_token_secret (GrlConfig *config);
+
gchar *grl_config_get_api_secret (GrlConfig *config);
gchar *grl_config_get_username (GrlConfig *config);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]