diff options
author | Ross Burton <ross@linux.intel.com> | 2011-07-11 16:44:06 +0100 |
---|---|---|
committer | Ross Burton <ross@linux.intel.com> | 2011-07-11 16:44:38 +0100 |
commit | c4831f3bb08b7359cb4d66e296ca2928ea5e80f6 (patch) | |
tree | 4fc7d2ba54bc0580a4ed93feb55a67cbc9db84d9 /rest | |
parent | b0cedf9c55487baf29931df629dafe99dbdc3bed (diff) |
oauth: Add property for signature type
Diffstat (limited to 'rest')
-rw-r--r-- | 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 |