After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 774031 - API to clear cached credentials from SoupAuthManager
API to clear cached credentials from SoupAuthManager
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: API
2.56.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks: 774033
 
 
Reported: 2016-11-07 07:44 UTC by Carlos Garcia Campos
Modified: 2016-11-15 11:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add API to clear cached credentials from SoupAuthManager (3.65 KB, patch)
2016-11-07 07:46 UTC, Carlos Garcia Campos
committed Details | Review

Description Carlos Garcia Campos 2016-11-07 07:44:13 UTC
In WebKit, we need to clear the cached credentials. It's mainly used by tests to ensure that auth tests are independent to each other. See https://bugs.webkit.org/show_bug.cgi?id=158919
Comment 1 Carlos Garcia Campos 2016-11-07 07:46:28 UTC
Created attachment 339222 [details] [review]
Add API to clear cached credentials from SoupAuthManager
Comment 2 Sergio Villar 2016-11-09 16:04:08 UTC
Review of attachment 339222 [details] [review]:

lgtm. Dan has the final word though

::: libsoup/soup-auth-manager.c
@@ -743,0 +743,13 @@
+/**
+ * soup_auth_manager_clear_cached_credentials:
+ * @manager: a #SoupAuthManager
... 10 more ...

Nit: too many blank lines here. Also I'd prefer the g_return_if_fail to be the first thing in the body of the function as it checks the function preconditions.
Comment 3 Carlos Garcia Campos 2016-11-10 08:36:23 UTC
(In reply to Sergio Villar from comment #2)
> Review of attachment 339222 [details] [review] [review]:
> 
> lgtm. Dan has the final word though
> 
> ::: libsoup/soup-auth-manager.c
> @@ -743,0 +743,13 @@
> +/**
> + * soup_auth_manager_clear_cached_credentials:
> + * @manager: a #SoupAuthManager
> ... 10 more ...
> 
> Nit: too many blank lines here. Also I'd prefer the g_return_if_fail to be
> the first thing in the body of the function as it checks the function
> preconditions.

Oh, right, there's an extra line there. g_return is indeed the first line of the body after the declaration variables block.
Comment 4 Dan Winship 2016-11-13 16:13:11 UTC
Comment on attachment 339222 [details] [review]
Add API to clear cached credentials from SoupAuthManager

>+	session = soup_test_session_new (SOUP_TYPE_SESSION_ASYNC, NULL);

Use SOUP_TYPE_SESSION for new tests if you're not explicitly testing something related to the deprecated subclasses.

Other than that (and the extra blank line Sergio pointed out) looks good.
Comment 5 Carlos Garcia Campos 2016-11-15 11:42:11 UTC
Comment on attachment 339222 [details] [review]
Add API to clear cached credentials from SoupAuthManager

Pushed, thanks for the review.