summaryrefslogtreecommitdiff
path: root/rest
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2016-04-20 09:38:59 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2016-06-16 15:01:13 +0200
commit16f40546e3e6483224264d99dd58b572e073dc30 (patch)
tree681e67fd19dd6b5ae1bc6a662698db5a645839ec /rest
parentfe3eff7a8300d2ea173d84230ec75460423c7a9c (diff)
downloadlibrest-16f40546e3e6483224264d99dd58b572e073dc30.tar.gz
oauth-proxy: Remove deprecated API
Diffstat (limited to 'rest')
-rw-r--r--rest/oauth-proxy.c104
-rw-r--r--rest/oauth-proxy.h14
2 files changed, 0 insertions, 118 deletions
diff --git a/rest/oauth-proxy.c b/rest/oauth-proxy.c
index 99148bc..dff54b4 100644
--- a/rest/oauth-proxy.c
+++ b/rest/oauth-proxy.c
@@ -284,110 +284,6 @@ typedef struct {
gpointer user_data;
} AuthData;
-static void
-auth_callback (RestProxyCall *call,
- const GError *error,
- GObject *weak_object,
- gpointer user_data)
-{
- AuthData *data = user_data;
- OAuthProxy *proxy = NULL;
- OAuthProxyPrivate *priv;
- GHashTable *form;
-
- g_object_get (call, "proxy", &proxy, NULL);
- priv = PROXY_GET_PRIVATE (proxy);
-
- if (!error) {
- /* TODO: sanity check response */
- form = soup_form_decode (rest_proxy_call_get_payload (call));
- priv->token = g_strdup (g_hash_table_lookup (form, "oauth_token"));
- priv->token_secret = g_strdup (g_hash_table_lookup (form, "oauth_token_secret"));
- g_hash_table_destroy (form);
- }
-
- data->callback (proxy, error, weak_object, data->user_data);
-
- g_slice_free (AuthData, data);
- g_object_unref (call);
- g_object_unref (proxy);
-}
-
-/**
- * oauth_proxy_auth_step_async:
- * @proxy: an #OAuthProxy
- * @function: the function to invoke on the proxy
- * @callback: (scope async): the callback to invoke when authorisation is complete
- * @weak_object: the #GObject to weakly reference and tie the lifecycle too
- * @user_data: data to pass to @callback
- * @error_out: a #GError, or %NULL
- *
- * Perform an OAuth authorisation step. This calls @function and then updates
- * the token and token secret in the proxy.
- *
- * @proxy must not require binding, the function will be invoked using
- * rest_proxy_call_set_function().
- */
-gboolean
-oauth_proxy_auth_step_async (OAuthProxy *proxy,
- const char *function,
- OAuthProxyAuthCallback callback,
- GObject *weak_object,
- gpointer user_data,
- GError **error_out)
-{
- RestProxyCall *call;
- AuthData *data;
-
- call = rest_proxy_new_call (REST_PROXY (proxy));
- rest_proxy_call_set_function (call, function);
-
- data = g_slice_new0 (AuthData);
- data->callback = callback;
- data->user_data = user_data;
-
- return rest_proxy_call_async (call, auth_callback, weak_object, data, error_out);
- /* TODO: if call_async fails, the call is leaked */
-}
-
-/**
- * oauth_proxy_auth_step:
- * @proxy: an #OAuthProxy
- * @function: the function to invoke on the proxy
- * @error: return location for a #GError
- *
- * Perform an OAuth authorisation step. This calls @function and then updates
- * the token and token secret in the proxy.
- *
- * @proxy must not require binding, the function will be invoked using
- * rest_proxy_call_set_function().
- */
-gboolean
-oauth_proxy_auth_step (OAuthProxy *proxy, const char *function, GError **error)
-{
- OAuthProxyPrivate *priv = PROXY_GET_PRIVATE (proxy);
- RestProxyCall *call;
- GHashTable *form;
-
- call = rest_proxy_new_call (REST_PROXY (proxy));
- rest_proxy_call_set_function (call, function);
-
- if (!rest_proxy_call_run (call, NULL, error)) {
- g_object_unref (call);
- return FALSE;
- }
-
- /* TODO: sanity check response */
- form = soup_form_decode (rest_proxy_call_get_payload (call));
- priv->token = g_strdup (g_hash_table_lookup (form, "oauth_token"));
- priv->token_secret = g_strdup (g_hash_table_lookup (form, "oauth_token_secret"));
- g_hash_table_destroy (form);
-
- g_object_unref (call);
-
- return TRUE;
-}
-
/**
* oauth_proxy_request_token:
* @proxy: an #OAuthProxy
diff --git a/rest/oauth-proxy.h b/rest/oauth-proxy.h
index 23e4ce4..782216e 100644
--- a/rest/oauth-proxy.h
+++ b/rest/oauth-proxy.h
@@ -106,20 +106,6 @@ typedef void (*OAuthProxyAuthCallback)(OAuthProxy *proxy,
GObject *weak_object,
gpointer userdata);
-G_GNUC_DEPRECATED
-gboolean oauth_proxy_auth_step (OAuthProxy *proxy,
- const char *function,
- GError **error);
-
-G_GNUC_DEPRECATED
-gboolean oauth_proxy_auth_step_async (OAuthProxy *proxy,
- const char *function,
- OAuthProxyAuthCallback callback,
- GObject *weak_object,
- gpointer user_data,
- GError **error_out);
-
-
gboolean oauth_proxy_request_token (OAuthProxy *proxy,
const char *function,
const char *callback_uri,