[libsoup] SoupPasswordManager: kill



commit 65890298dbe26d1058f523a6eb4741d57b05142c
Author: Dan Winship <danw gnome org>
Date:   Wed Aug 22 11:40:04 2012 -0400

    SoupPasswordManager: kill
    
    Deprecate and remove support for SoupPasswordManager;
    SoupPasswordManagerGNOME is now a dummy class, and the related
    SoupAuth methods are all no-ops. SoupSession also no longer has any
    special support for SoupPasswordManager.
    
    To avoid breaking old builds, the functions/types are still around,
    but are now marked as having always been deprecated (which, really,
    they were).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=594377
    https://bugzilla.gnome.org/show_bug.cgi?id=679866

 configure.ac                          |   10 --
 libsoup/Makefile.am                   |   14 +--
 libsoup/soup-auth.c                   |  154 +-------------------------
 libsoup/soup-auth.h                   |   37 +++---
 libsoup/soup-gnome-features.h         |    5 +-
 libsoup/soup-password-manager-gnome.c |  198 +--------------------------------
 libsoup/soup-password-manager.c       |   47 +--------
 libsoup/soup-password-manager.h       |   10 +-
 libsoup/soup-session-async.c          |   36 ------
 libsoup/soup-session-sync.c           |   21 ----
 libsoup/soup-session.c                |   11 +--
 libsoup/soup.h                        |    1 -
 12 files changed, 37 insertions(+), 507 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 2ef8cb8..3f5097c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -138,16 +138,6 @@ AC_ARG_WITH(gnome,
 	    :, [if test $os_win32 = yes; then with_gnome=no; else with_gnome=yes; fi])
 AC_MSG_RESULT($with_gnome)
 
-if test $with_gnome != no -a $os_win32 != yes; then
-	PKG_CHECK_MODULES(GNOME_KEYRING, gnome-keyring-1, :,
-			  AC_MSG_ERROR(
-[Could not find gnome-keyring devel files.
-Configure with --without-gnome if you wish to build only libsoup
-without GNOME-specific features.]))
-fi
-AC_SUBST(GNOME_KEYRING_CFLAGS)
-AC_SUBST(GNOME_KEYRING_LIBS)
-
 AM_CONDITIONAL(BUILD_LIBSOUP_GNOME, test $with_gnome != no)
 
 if test $with_gnome != no; then
diff --git a/libsoup/Makefile.am b/libsoup/Makefile.am
index 31267a3..3a256e0 100644
--- a/libsoup/Makefile.am
+++ b/libsoup/Makefile.am
@@ -194,14 +194,6 @@ tld_data.inc: tld-parser.py $(TLD_DATA_FILE)
 
 if BUILD_LIBSOUP_GNOME
 
-if OS_WIN32
-soup_password_manager_gnome_files =	
-else
-soup_password_manager_gnome_files =	\
-	soup-password-manager-gnome.h	\
-	soup-password-manager-gnome.c
-endif
-
 libsoupgnomeincludedir = $(includedir)/libsoup-gnome-2.4/libsoup
 
 libsoupgnomeinclude_HEADERS =	\
@@ -221,15 +213,15 @@ EXTRA_DIST += libsoup-gnome-2.4.sym
 libsoup_gnome_2_4_la_LIBADD =		\
 	libsoup-2.4.la			\
 	$(GLIB_LIBS)			\
-	$(SQLITE_LIBS)			\
-	$(GNOME_KEYRING_LIBS)
+	$(SQLITE_LIBS)
 
 libsoup_gnome_2_4_la_SOURCES =		\
 	soup-cookie-jar-sqlite.c	\
 	soup-gnome-features.c		\
 	soup-proxy-resolver-gnome.h	\
 	soup-proxy-resolver-gnome.c	\
-	$(soup_password_manager_gnome_files)
+	soup-password-manager-gnome.h	\
+	soup-password-manager-gnome.c
 
 endif
 
diff --git a/libsoup/soup-auth.c b/libsoup/soup-auth.c
index 6960e52..bb6f3b4 100644
--- a/libsoup/soup-auth.c
+++ b/libsoup/soup-auth.c
@@ -9,8 +9,6 @@
 #include <config.h>
 #endif
 
-#define LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY
-
 #include <string.h>
 
 #include "soup-auth.h"
@@ -40,21 +38,12 @@
 typedef struct {
 	gboolean proxy;
 	char *host;
-
-	GHashTable *saved_passwords;
 } SoupAuthPrivate;
 #define SOUP_AUTH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SOUP_TYPE_AUTH, SoupAuthPrivate))
 
 G_DEFINE_ABSTRACT_TYPE (SoupAuth, soup_auth, G_TYPE_OBJECT)
 
 enum {
-	SAVE_PASSWORD,
-	LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = { 0 };
-
-enum {
 	PROP_0,
 
 	PROP_SCHEME_NAME,
@@ -79,8 +68,6 @@ soup_auth_finalize (GObject *object)
 
 	g_free (auth->realm);
 	g_free (priv->host);
-	if (priv->saved_passwords)
-		g_hash_table_destroy (priv->saved_passwords);
 
 	G_OBJECT_CLASS (soup_auth_parent_class)->finalize (object);
 }
@@ -149,30 +136,6 @@ soup_auth_class_init (SoupAuthClass *auth_class)
 	object_class->set_property = soup_auth_set_property;
 	object_class->get_property = soup_auth_get_property;
 
-	/**
-	 * SoupAuth::save-password:
-	 * @auth: the auth
-	 * @username: the username to save
-	 * @password: the password to save
-	 *
-	 * Emitted to request that the @username/@password pair be
-	 * saved. If the session supports password-saving, it will
-	 * connect to this signal before emitting
-	 * #SoupSession::authenticate, so that it record the password
-	 * if requested by the caller.
-	 *
-	 * Since: 2.28
-	 **/
-	signals[SAVE_PASSWORD] =
-		g_signal_new ("save-password",
-			      G_OBJECT_CLASS_TYPE (object_class),
-			      G_SIGNAL_RUN_FIRST,
-			      0, NULL, NULL,
-			      _soup_marshal_NONE__STRING_STRING,
-			      G_TYPE_NONE, 2,
-			      G_TYPE_STRING,
-			      G_TYPE_STRING);
-
 	/* properties */
 	/**
 	 * SOUP_AUTH_SCHEME_NAME:
@@ -356,9 +319,6 @@ soup_auth_update (SoupAuth *auth, SoupMessage *msg, const char *auth_header)
  *
  * Call this on an auth to authenticate it; normally this will cause
  * the auth's message to be requeued with the new authentication info.
- *
- * This does not cause the password to be saved to persistent storage;
- * see soup_auth_save_password() for that.
  **/
 void
 soup_auth_authenticate (SoupAuth *auth, const char *username, const char *password)
@@ -537,136 +497,26 @@ soup_auth_free_protection_space (SoupAuth *auth, GSList *space)
 	g_slist_free_full (space, g_free);
 }
 
-/**
- * soup_auth_get_saved_users:
- * @auth: a #SoupAuth
- *
- * Gets a list of usernames for which a saved password is available.
- * (If the session is not configured to save passwords, this will
- * always be %NULL.)
- *
- * Return value: (transfer container): the list of usernames. You must
- * free the list with g_slist_free(), but do not free or modify the
- * contents.
- *
- * Since: 2.28
- **/
 GSList *
 soup_auth_get_saved_users (SoupAuth *auth)
 {
-	SoupAuthPrivate *priv;
-	GSList *users;
-
-	g_return_val_if_fail (SOUP_IS_AUTH (auth), NULL);
-
-	priv = SOUP_AUTH_GET_PRIVATE (auth);
-	users = NULL;
-
-	if (priv->saved_passwords) {
-		GHashTableIter iter;
-		gpointer key, value;
-
-		g_hash_table_iter_init (&iter, priv->saved_passwords);
-		while (g_hash_table_iter_next (&iter, &key, &value))
-			users = g_slist_prepend (users, key);
-	}
-	return users;
+	return NULL;
 }
 
-/**
- * soup_auth_get_saved_password:
- * @auth: a #SoupAuth
- * @user: a username from the list returned from
- * soup_auth_get_saved_users().
- *
- * Given a username for which @auth has a saved password, this returns
- * that password. If @auth doesn't have a passwords saved for @user, it
- * returns %NULL.
- *
- * Return value: the saved password, or %NULL.
- *
- * Since: 2.28
- **/
 const char *
 soup_auth_get_saved_password (SoupAuth *auth, const char *user)
 {
-	SoupAuthPrivate *priv;
-
-	g_return_val_if_fail (SOUP_IS_AUTH (auth), NULL);
-	g_return_val_if_fail (user != NULL, NULL);
-
-	priv = SOUP_AUTH_GET_PRIVATE (auth);
-	if (!priv->saved_passwords)
-		return NULL;
-	return g_hash_table_lookup (priv->saved_passwords, user);
-}
-
-static void
-free_password (gpointer password)
-{
-	memset (password, 0, strlen (password));
-	g_free (password);
-}
-
-static inline void
-init_saved_passwords (SoupAuthPrivate *priv)
-{
-	priv->saved_passwords = g_hash_table_new_full (
-		g_str_hash, g_str_equal, g_free, free_password);
+	return NULL;
 }
 
-/**
- * soup_auth_has_saved_password:
- * @auth: a #SoupAuth
- * @username: a username
- * @password: a password
- *
- * Updates @auth to be aware of an already-saved username/password
- * combination. This method <emphasis>does not</emphasis> cause the
- * given @username and @password to be saved; use
- * soup_auth_save_password() for that. (soup_auth_has_saved_password()
- * is an internal method, which is used by the code that actually
- * saves and restores the passwords.)
- *
- * Since: 2.28
- **/
 void
 soup_auth_has_saved_password (SoupAuth *auth, const char *username,
 			      const char *password)
 {
-	SoupAuthPrivate *priv;
-
-	g_return_if_fail (SOUP_IS_AUTH (auth));
-	g_return_if_fail (username != NULL);
-	g_return_if_fail (password != NULL);
-
-	priv = SOUP_AUTH_GET_PRIVATE (auth);
-
-	if (!priv->saved_passwords)
-		init_saved_passwords (priv);
-	g_hash_table_insert (priv->saved_passwords,
-			     g_strdup (username), g_strdup (password));
 }
 
-/**
- * soup_auth_save_password:
- * @auth: a #SoupAuth
- * @username: the username provided by the user or client
- * @password: the password provided by the user or client
- *
- * Requests that the username/password pair be saved to whatever form
- * of persistent password storage the session supports.
- *
- * Since: 2.28
- **/
 void
 soup_auth_save_password (SoupAuth *auth, const char *username,
 			 const char *password)
 {
-	g_return_if_fail (SOUP_IS_AUTH (auth));
-	g_return_if_fail (username != NULL);
-	g_return_if_fail (password != NULL);
-
-	g_signal_emit (auth, signals[SAVE_PASSWORD], 0,
-		       username, password);
 }
diff --git a/libsoup/soup-auth.h b/libsoup/soup-auth.h
index 9951021..8abda8e 100644
--- a/libsoup/soup-auth.h
+++ b/libsoup/soup-auth.h
@@ -72,18 +72,6 @@ const char *soup_auth_get_host              (SoupAuth      *auth);
 const char *soup_auth_get_realm             (SoupAuth      *auth);
 char       *soup_auth_get_info              (SoupAuth      *auth);
 
-#ifdef LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY
-SOUP_AVAILABLE_IN_2_28
-GSList     *soup_auth_get_saved_users       (SoupAuth      *auth);
-SOUP_AVAILABLE_IN_2_28
-const char *soup_auth_get_saved_password    (SoupAuth      *auth,
-					     const char    *user);
-SOUP_AVAILABLE_IN_2_28
-void        soup_auth_save_password         (SoupAuth      *auth,
-					     const char    *username,
-					     const char    *password);
-#endif
-
 void        soup_auth_authenticate          (SoupAuth      *auth,
 					     const char    *username,
 					     const char    *password);
@@ -97,12 +85,6 @@ GSList     *soup_auth_get_protection_space  (SoupAuth      *auth,
 void        soup_auth_free_protection_space (SoupAuth      *auth,
 					     GSList        *space);
 
-#ifdef LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY
-void        soup_auth_has_saved_password    (SoupAuth      *auth,
-					     const char    *username,
-					     const char    *password);
-#endif
-
 /* The actual auth types, which can be added/removed as features */
 
 #define SOUP_TYPE_AUTH_BASIC  (soup_auth_basic_get_type ())
@@ -112,6 +94,25 @@ GType soup_auth_digest_get_type (void);
 #define SOUP_TYPE_AUTH_NTLM   (soup_auth_ntlm_get_type ())
 GType soup_auth_ntlm_get_type   (void);
 
+/* Deprecated SoupPasswordManager-related APIs: all are now no-ops */
+SOUP_AVAILABLE_IN_2_28
+SOUP_DEPRECATED_IN_2_28
+GSList     *soup_auth_get_saved_users    (SoupAuth   *auth);
+SOUP_AVAILABLE_IN_2_28
+SOUP_DEPRECATED_IN_2_28
+const char *soup_auth_get_saved_password (SoupAuth   *auth,
+					  const char *user);
+SOUP_AVAILABLE_IN_2_28
+SOUP_DEPRECATED_IN_2_28
+void        soup_auth_save_password      (SoupAuth   *auth,
+					  const char *username,
+					  const char *password);
+SOUP_AVAILABLE_IN_2_28
+SOUP_DEPRECATED_IN_2_28
+void        soup_auth_has_saved_password (SoupAuth   *auth,
+					  const char *username,
+					  const char *password);
+
 G_END_DECLS
 
 #endif /* SOUP_AUTH_H */
diff --git a/libsoup/soup-gnome-features.h b/libsoup/soup-gnome-features.h
index 6e36b0e..3485672 100644
--- a/libsoup/soup-gnome-features.h
+++ b/libsoup/soup-gnome-features.h
@@ -18,13 +18,10 @@ SOUP_AVAILABLE_IN_2_26
 GType soup_gnome_features_2_26_get_type (void);
 #define SOUP_TYPE_GNOME_FEATURES_2_26 (soup_gnome_features_2_26_get_type ())
 
-#ifndef G_OS_WIN32
-#ifdef LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY
 SOUP_AVAILABLE_IN_2_28
+SOUP_DEPRECATED_IN_2_28
 GType soup_password_manager_gnome_get_type (void);
 #define SOUP_TYPE_PASSWORD_MANAGER_GNOME (soup_password_manager_gnome_get_type ())
-#endif /* LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY */
-#endif
 
 G_END_DECLS
 
diff --git a/libsoup/soup-password-manager-gnome.c b/libsoup/soup-password-manager-gnome.c
index 475cb59..8101683 100644
--- a/libsoup/soup-password-manager-gnome.c
+++ b/libsoup/soup-password-manager-gnome.c
@@ -5,216 +5,24 @@
  * Copyright (C) 2008 Red Hat, Inc.
  */
 
+/* This is just a stub now; eventually it will go away completely. */
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
-#include <gnome-keyring.h>
-
-#define LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY
-
 #include "soup-password-manager-gnome.h"
 #include "soup.h"
 
-static void soup_password_manager_gnome_interface_init (SoupPasswordManagerInterface *password_manager_interface);
-
 G_DEFINE_TYPE_EXTENDED (SoupPasswordManagerGNOME, soup_password_manager_gnome, G_TYPE_OBJECT, 0,
-			G_IMPLEMENT_INTERFACE (SOUP_TYPE_SESSION_FEATURE, NULL)
-			G_IMPLEMENT_INTERFACE (SOUP_TYPE_PASSWORD_MANAGER, soup_password_manager_gnome_interface_init))
+			G_IMPLEMENT_INTERFACE (SOUP_TYPE_SESSION_FEATURE, NULL))
 
 static void
 soup_password_manager_gnome_init (SoupPasswordManagerGNOME *manager_gnome)
 {
 }
 
-
-static void
-save_password_callback (GnomeKeyringResult result, guint32 val, gpointer data)
-{
-}
-
-static void
-async_save_password (SoupAuth *auth, const char *username,
-		     const char *password, gpointer user_data)
-{
-	SoupURI *uri = user_data;
-
-	gnome_keyring_set_network_password (
-		NULL, /* use default keyring */
-		username,
-		soup_auth_get_realm (auth),
-		uri->host,
-		NULL,
-		uri->scheme,
-		soup_auth_get_scheme_name (auth),
-		uri->port,
-		password,
-		save_password_callback, NULL, NULL);
-}
-
-static void
-sync_save_password (SoupAuth *auth, const char *username,
-		    const char *password, gpointer user_data)
-{
-	SoupURI *uri = user_data;
-	guint32 item_id;
-
-	gnome_keyring_set_network_password_sync (
-		NULL, /* use default keyring */
-		username,
-		soup_auth_get_realm (auth),
-		uri->host,
-		NULL,
-		uri->scheme,
-		soup_auth_get_scheme_name (auth),
-		uri->port,
-		password,
-		&item_id);
-}
-
-static void
-update_auth_for_passwords (SoupAuth *auth, SoupMessage *msg,
-			   GList *passwords, gboolean async)
-{
-	GnomeKeyringNetworkPasswordData *pdata;
-	SoupURI *uri;
-
-	while (passwords) {
-		pdata = passwords->data;
-		soup_auth_has_saved_password (auth, pdata->user,
-					      pdata->password);
-		passwords = passwords->next;
-	}
-
-	uri = g_object_get_data (G_OBJECT (auth),
-				 "SoupPasswordManagerGNOME-save_password-uri");
-	if (uri) {
-		g_signal_handlers_disconnect_by_func (auth, async_save_password, uri);
-		g_signal_handlers_disconnect_by_func (auth, sync_save_password, uri);
-	}
-
-	uri = soup_uri_copy (soup_message_get_uri (msg));
-	g_signal_connect (auth, "save_password",
-			  G_CALLBACK (async ? async_save_password : sync_save_password),
-			  uri);
-	g_object_set_data_full (G_OBJECT (auth),
-				"SoupPasswordManagerGNOME-save_password-uri",
-				uri, (GDestroyNotify)soup_uri_free);
-}
-
-typedef struct {
-	SoupPasswordManager *password_manager;
-	SoupMessage *msg;
-	SoupAuth *auth;
-	gboolean retrying;
-
-	SoupPasswordManagerCallback callback;
-	gpointer user_data;
-
-	gpointer request;
-} SoupPasswordManagerGNOMEAuthData;
-
-static void
-find_password_callback (GnomeKeyringResult result, GList *list,
-			gpointer user_data)
-{
-	SoupPasswordManagerGNOMEAuthData *auth_data = user_data;
-
-	/* FIXME: check result? */
-
-	update_auth_for_passwords (auth_data->auth, auth_data->msg, list, TRUE);
-	auth_data->callback (auth_data->password_manager,
-			     auth_data->msg, auth_data->auth,
-			     auth_data->retrying, auth_data->user_data);
-
-	/* gnome-keyring will call free_auth_data to clean up for us. */
-}
-
-static void
-free_auth_data (gpointer data)
-{
-	SoupPasswordManagerGNOMEAuthData *auth_data = data;
-
-	g_object_unref (auth_data->auth);
-	g_object_unref (auth_data->msg);
-	g_slice_free (SoupPasswordManagerGNOMEAuthData, auth_data);
-}
-
-static void
-soup_password_manager_gnome_get_passwords_async (SoupPasswordManager  *password_manager,
-						 SoupMessage          *msg,
-						 SoupAuth             *auth,
-						 gboolean              retrying,
-						 GMainContext         *async_context,
-						 GCancellable         *cancellable,
-						 SoupPasswordManagerCallback callback,
-						 gpointer              user_data)
-{
-	SoupPasswordManagerGNOMEAuthData *auth_data;
-	SoupURI *uri = soup_message_get_uri (msg);
-
-	auth_data = g_slice_new (SoupPasswordManagerGNOMEAuthData);
-	auth_data->password_manager = password_manager;
-	auth_data->msg = g_object_ref (msg);
-	auth_data->auth = g_object_ref (auth);
-	auth_data->retrying = retrying;
-
-	/* FIXME: async_context, cancellable */
-
-	auth_data->callback = callback;
-	auth_data->user_data = user_data;
-
-	/* FIXME: should we be specifying protocol and port here, or
-	 * leaving them NULL/0 and filtering results in the callback?
-	 * We don't want to send https passwords to http, but the
-	 * reverse might be OK (if that's how other clients tend to
-	 * behave).
-	 */
-	auth_data->request = gnome_keyring_find_network_password (
-		NULL,                             /* user -- accept any */
-		soup_auth_get_realm (auth),       /* domain */
-		uri->host,                        /* server */
-		NULL,                             /* object -- unused */
-		uri->scheme,                      /* protocol */
-		soup_auth_get_scheme_name (auth), /* authtype */
-		uri->port,                        /* port */
-		find_password_callback, auth_data, free_auth_data);
-}
-
-static void
-soup_password_manager_gnome_get_passwords_sync (SoupPasswordManager  *password_manager,
-						SoupMessage          *msg,
-						SoupAuth             *auth,
-						GCancellable         *cancellable)
-{
-	SoupURI *uri = soup_message_get_uri (msg);
-	GList *results = NULL;
-
-	/* FIXME: cancellable */
-
-	gnome_keyring_find_network_password_sync (
-		NULL,                             /* user -- accept any */
-		soup_auth_get_realm (auth),       /* domain */
-		uri->host,                        /* server */
-		NULL,                             /* object -- unused */
-		uri->scheme,                      /* protocol */
-		soup_auth_get_scheme_name (auth), /* authtype */
-		uri->port,                        /* port */
-		&results);
-
-	update_auth_for_passwords (auth, msg, results, FALSE);
-}
-
 static void
 soup_password_manager_gnome_class_init (SoupPasswordManagerGNOMEClass *gnome_class)
 {
 }
-
-static void
-soup_password_manager_gnome_interface_init (SoupPasswordManagerInterface *password_manager_interface)
-{
-	password_manager_interface->get_passwords_async =
-		soup_password_manager_gnome_get_passwords_async;
-	password_manager_interface->get_passwords_sync =
-		soup_password_manager_gnome_get_passwords_sync;
-}
diff --git a/libsoup/soup-password-manager.c b/libsoup/soup-password-manager.c
index 3914179..d9cf81c 100644
--- a/libsoup/soup-password-manager.c
+++ b/libsoup/soup-password-manager.c
@@ -9,8 +9,6 @@
 #include <config.h>
 #endif
 
-#define LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY
-
 #include "soup-password-manager.h"
 #include "soup.h"
 
@@ -23,29 +21,6 @@ soup_password_manager_default_init (SoupPasswordManagerInterface *iface)
 {
 }
 
-/**
- * soup_password_manager_get_passwords_async:
- * @password_manager: the #SoupPasswordManager
- * @msg: the #SoupMessage being authenticated
- * @auth: the #SoupAuth being authenticated
- * @retrying: whether or not this is a re-attempt to authenticate
- * @async_context: (allow-none): the #GMainContext to invoke @callback in
- * @cancellable: a #GCancellable, or %NULL
- * @callback: callback to invoke after fetching passwords
- * @user_data: data for @callback
- *
- * Asynchronously attempts to look up saved passwords for @auth/@msg
- * and then calls @callback after updating @auth with the information.
- * Also registers @auth with @password_manager so that if the caller
- * calls soup_auth_save_password() on it, the password will be saved.
- *
- * #SoupPasswordManager does not actually use the @retrying flag itself;
- * it just passes its value on to @callback.
- * 
- * If @cancellable is cancelled, @callback will still be invoked.
- *
- * Since: 2.28
- **/
 void
 soup_password_manager_get_passwords_async (SoupPasswordManager  *password_manager,
 					   SoupMessage          *msg,
@@ -56,32 +31,14 @@ soup_password_manager_get_passwords_async (SoupPasswordManager  *password_manage
 					   SoupPasswordManagerCallback callback,
 					   gpointer              user_data)
 {
-	SOUP_PASSWORD_MANAGER_GET_CLASS (password_manager)->
-		get_passwords_async (password_manager, msg, auth, retrying,
-				     async_context, cancellable,
-				     callback, user_data);
+	g_warn_if_reached ();
 }
 
-/**
- * soup_password_manager_get_passwords_sync:
- * @password_manager: the #SoupPasswordManager
- * @msg: the #SoupMessage being authenticated
- * @auth: the #SoupAuth being authenticated
- * @cancellable: a #GCancellable, or %NULL
- *
- * Synchronously attempts to look up saved passwords for @auth/@msg
- * and updates @auth with the information. Also registers @auth with
- * @password_manager so that if the caller calls
- * soup_auth_save_password() on it, the password will be saved.
- *
- * Since: 2.28
- **/
 void
 soup_password_manager_get_passwords_sync (SoupPasswordManager  *password_manager,
 					  SoupMessage          *msg,
 					  SoupAuth             *auth,
 					  GCancellable         *cancellable)
 {
-	SOUP_PASSWORD_MANAGER_GET_CLASS (password_manager)->
-		get_passwords_sync (password_manager, msg, auth, cancellable);
+	g_warn_if_reached ();
 }
diff --git a/libsoup/soup-password-manager.h b/libsoup/soup-password-manager.h
index 775f84c..d4e60ac 100644
--- a/libsoup/soup-password-manager.h
+++ b/libsoup/soup-password-manager.h
@@ -6,8 +6,6 @@
 #ifndef SOUP_PASSWORD_MANAGER_H
 #define SOUP_PASSWORD_MANAGER_H 1
 
-#ifdef LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY
-
 #include <libsoup/soup-types.h>
 
 #define SOUP_TYPE_PASSWORD_MANAGER            (soup_password_manager_get_type ())
@@ -37,8 +35,12 @@ typedef struct {
 
 } SoupPasswordManagerInterface;
 
+SOUP_AVAILABLE_IN_2_28
+SOUP_DEPRECATED_IN_2_28
 GType soup_password_manager_get_type (void);
 
+SOUP_AVAILABLE_IN_2_28
+SOUP_DEPRECATED_IN_2_28
 void  soup_password_manager_get_passwords_async (SoupPasswordManager  *password_manager,
 						 SoupMessage          *msg,
 						 SoupAuth             *auth,
@@ -48,11 +50,11 @@ void  soup_password_manager_get_passwords_async (SoupPasswordManager  *password_
 						 SoupPasswordManagerCallback callback,
 						 gpointer              user_data);
 
+SOUP_AVAILABLE_IN_2_28
+SOUP_DEPRECATED_IN_2_28
 void  soup_password_manager_get_passwords_sync  (SoupPasswordManager  *password_manager,
 						 SoupMessage          *msg,
 						 SoupAuth             *auth,
 						 GCancellable         *cancellable);
 
-#endif /* LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY */
-
 #endif /* SOUP_PASSWORD_MANAGER_H */
diff --git a/libsoup/soup-session-async.c b/libsoup/soup-session-async.c
index a24f4ba..4c08a61 100644
--- a/libsoup/soup-session-async.c
+++ b/libsoup/soup-session-async.c
@@ -9,8 +9,6 @@
 #include <config.h>
 #endif
 
-#define LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY
-
 #include "soup-session-async.h"
 #include "soup.h"
 #include "soup-session-private.h"
@@ -134,39 +132,6 @@ soup_session_async_cancel_message (SoupSession *session, SoupMessage *msg,
 }
 
 static void
-got_passwords (SoupPasswordManager *password_manager, SoupMessage *msg,
-	       SoupAuth *auth, gboolean retrying, gpointer session)
-{
-	soup_session_unpause_message (session, msg);
-	SOUP_SESSION_CLASS (soup_session_async_parent_class)->
-		auth_required (session, msg, auth, retrying);
-	g_object_unref (auth);
-}
-
-static void
-soup_session_async_auth_required (SoupSession *session, SoupMessage *msg,
-				  SoupAuth *auth, gboolean retrying)
-{
-	SoupSessionFeature *password_manager;
-
-	password_manager = soup_session_get_feature_for_message (
-		session, SOUP_TYPE_PASSWORD_MANAGER, msg);
-	if (password_manager) {
-		soup_session_pause_message (session, msg);
-		g_object_ref (auth);
-		soup_password_manager_get_passwords_async (
-			SOUP_PASSWORD_MANAGER (password_manager),
-			msg, auth, retrying,
-			soup_session_get_async_context (session),
-			NULL, /* FIXME cancellable */
-			got_passwords, session);
-	} else {
-		SOUP_SESSION_CLASS (soup_session_async_parent_class)->
-			auth_required (session, msg, auth, retrying);
-	}
-}
-
-static void
 soup_session_async_class_init (SoupSessionAsyncClass *soup_session_async_class)
 {
 	SoupSessionClass *session_class = SOUP_SESSION_CLASS (soup_session_async_class);
@@ -175,5 +140,4 @@ soup_session_async_class_init (SoupSessionAsyncClass *soup_session_async_class)
 	session_class->queue_message = soup_session_async_queue_message;
 	session_class->send_message = soup_session_async_send_message;
 	session_class->cancel_message = soup_session_async_cancel_message;
-	session_class->auth_required = soup_session_async_auth_required;
 }
diff --git a/libsoup/soup-session-sync.c b/libsoup/soup-session-sync.c
index cbd2460..f6ae968 100644
--- a/libsoup/soup-session-sync.c
+++ b/libsoup/soup-session-sync.c
@@ -9,8 +9,6 @@
 #include <config.h>
 #endif
 
-#define LIBSOUP_I_HAVE_READ_BUG_594377_AND_KNOW_SOUP_PASSWORD_MANAGER_MIGHT_GO_AWAY
-
 #include "soup-session-sync.h"
 #include "soup.h"
 #include "soup-session-private.h"
@@ -139,24 +137,6 @@ soup_session_sync_send_message (SoupSession *session, SoupMessage *msg)
 }
 
 static void
-soup_session_sync_auth_required (SoupSession *session, SoupMessage *msg,
-				 SoupAuth *auth, gboolean retrying)
-{
-	SoupSessionFeature *password_manager;
-
-	password_manager = soup_session_get_feature_for_message (
-		session, SOUP_TYPE_PASSWORD_MANAGER, msg);
-	if (password_manager) {
-		soup_password_manager_get_passwords_sync (
-			SOUP_PASSWORD_MANAGER (password_manager),
-			msg, auth, NULL); /* FIXME cancellable */
-	}
-
-	SOUP_SESSION_CLASS (soup_session_sync_parent_class)->
-		auth_required (session, msg, auth, retrying);
-}
-
-static void
 soup_session_sync_class_init (SoupSessionSyncClass *session_sync_class)
 {
 	SoupSessionClass *session_class = SOUP_SESSION_CLASS (session_sync_class);
@@ -164,5 +144,4 @@ soup_session_sync_class_init (SoupSessionSyncClass *session_sync_class)
 	/* virtual method override */
 	session_class->queue_message = soup_session_sync_queue_message;
 	session_class->send_message = soup_session_sync_send_message;
-	session_class->auth_required = soup_session_sync_auth_required;
 }
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 94a2214..a5fac7d 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -923,19 +923,11 @@ free_host (SoupSessionHost *host)
 }
 
 static void
-soup_session_real_auth_required (SoupSession *session, SoupMessage *msg,
-	       SoupAuth *auth, gboolean retrying)
-{
-	g_signal_emit (session, signals[AUTHENTICATE], 0, msg, auth, retrying);
-}
-
-static void
 auth_manager_authenticate (SoupAuthManager *manager, SoupMessage *msg,
 			   SoupAuth *auth, gboolean retrying,
 			   gpointer session)
 {
-	SOUP_SESSION_GET_CLASS (session)->auth_required (
-		session, msg, auth, retrying);
+	g_signal_emit (session, signals[AUTHENTICATE], 0, msg, auth, retrying);
 }
 
 #define SOUP_SESSION_WOULD_REDIRECT_AS_GET(session, msg) \
@@ -2645,7 +2637,6 @@ soup_session_class_init (SoupSessionClass *session_class)
 	/* virtual method definition */
 	session_class->requeue_message = soup_session_real_requeue_message;
 	session_class->cancel_message = soup_session_real_cancel_message;
-	session_class->auth_required = soup_session_real_auth_required;
 	session_class->flush_queue = soup_session_real_flush_queue;
 	session_class->kick = soup_session_real_kick_queue;
 
diff --git a/libsoup/soup.h b/libsoup/soup.h
index f99f3e6..b1b7472 100644
--- a/libsoup/soup.h
+++ b/libsoup/soup.h
@@ -31,7 +31,6 @@ extern "C" {
 #include <libsoup/soup-misc.h>
 #include <libsoup/soup-multipart.h>
 #include <libsoup/soup-multipart-input-stream.h>
-#include <libsoup/soup-password-manager.h>
 #include <libsoup/soup-proxy-resolver.h>
 #include <libsoup/soup-proxy-resolver-default.h>
 #include <libsoup/soup-proxy-uri-resolver.h>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]