[librest] oauth: Add property for signature type
- From: Ross Burton <rburton src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librest] oauth: Add property for signature type
- Date: Mon, 11 Jul 2011 15:45:11 +0000 (UTC)
commit c4831f3bb08b7359cb4d66e296ca2928ea5e80f6
Author: Ross Burton <ross linux intel com>
Date: Mon Jul 11 16:44:06 2011 +0100
oauth: Add property for signature type
rest/oauth-proxy.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/rest/oauth-proxy.c b/rest/oauth-proxy.c
index 1d293b6..076ce8c 100644
--- a/rest/oauth-proxy.c
+++ b/rest/oauth-proxy.c
@@ -35,6 +35,7 @@ enum {
PROP_TOKEN,
PROP_TOKEN_SECRET,
PROP_SIGNATURE_HOST,
+ PROP_SIGNATURE_METHOD,
};
static RestProxyCall *
@@ -71,6 +72,9 @@ oauth_proxy_get_property (GObject *object, guint property_id,
case PROP_SIGNATURE_HOST:
g_value_set_string (value, priv->signature_host);
break;
+ case PROP_SIGNATURE_METHOD:
+ g_value_set_enum (value, priv->method);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -108,6 +112,9 @@ oauth_proxy_set_property (GObject *object, guint property_id,
g_free (priv->signature_host);
priv->signature_host = g_value_dup_string (value);
break;
+ case PROP_SIGNATURE_METHOD:
+ priv->method = g_value_get_enum (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -182,7 +189,13 @@ oauth_proxy_class_init (OAuthProxyClass *klass)
PROP_SIGNATURE_HOST,
pspec);
- /* TODO: add enum property for signature method */
+ pspec = g_param_spec_enum ("signature-method", "signature-method",
+ "Signature method used",
+ OAUTH_TYPE_SIGNATURE_METHOD, HMAC_SHA1,
+ G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class,
+ PROP_SIGNATURE_METHOD,
+ pspec);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]